@agilemotion/oui-react-js 1.8.55 → 1.8.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/ApplicationManager.js +446 -472
  2. package/dist/BasicApp.js +30 -0
  3. package/dist/BasicAppHome.js +2 -3
  4. package/dist/DateUtils.js +2 -2
  5. package/dist/DynamicJS.js +94 -101
  6. package/dist/InteractionPortalAppHome.js +1 -1
  7. package/dist/InteractionPortalApp_old.js +1 -2
  8. package/dist/MouseTracker.js +23 -0
  9. package/dist/RestService.js +13 -11
  10. package/dist/RestUtils.js +1 -1
  11. package/dist/TypedValue.js +15 -14
  12. package/dist/Utils.js +121 -114
  13. package/dist/ViewContext.js +152 -159
  14. package/dist/assets/jss/components/authNavbarStyle.js +34 -37
  15. package/dist/assets/jss/components/cardHeaderStyle.js +11 -18
  16. package/dist/assets/jss/components/customDropdownStyle.js +25 -27
  17. package/dist/assets/jss/components/customInputStyle.js +7 -3
  18. package/dist/assets/jss/components/dropdownStyle.js +14 -11
  19. package/dist/assets/jss/components/footerStyle.js +17 -12
  20. package/dist/assets/jss/components/headerLinksStyle.js +12 -9
  21. package/dist/assets/jss/components/headerStyle.js +24 -26
  22. package/dist/assets/jss/components/navbarLinksStyle.js +12 -9
  23. package/dist/assets/jss/components/navbarStyle.js +24 -26
  24. package/dist/assets/jss/components/sidebarStyle.js +42 -42
  25. package/dist/assets/jss/components/typographyStyle.js +7 -3
  26. package/dist/assets/jss/rootStyle.js +30 -34
  27. package/dist/assets/jss/views/layoutStyle.js +12 -9
  28. package/dist/assets/jss/views/loginStyle.js +9 -6
  29. package/dist/components/AlertBar.js +1 -1
  30. package/dist/components/Button.js +18 -11
  31. package/dist/components/Calendar.js +9 -6
  32. package/dist/components/Chart.js +1 -1
  33. package/dist/components/DataGrid.css +10 -1
  34. package/dist/components/DataGrid.js +115 -56
  35. package/dist/components/DataGridColumn.js +2 -1
  36. package/dist/components/DocumentTemplateDesignerComponent.js +7 -7
  37. package/dist/components/DocumentTemplateDesignerComponent2.js +3 -4
  38. package/dist/components/DocumentTemplatePlaceholderDialog.js +3 -4
  39. package/dist/components/DocumentViewer.js +15 -5
  40. package/dist/components/ElementResizeHandler.js +177 -174
  41. package/dist/components/FaceApi.js +2 -2
  42. package/dist/components/FileThumb.js +5 -5
  43. package/dist/components/Graph.js +77 -74
  44. package/dist/components/GraphNode.js +39 -36
  45. package/dist/components/HtmlPanel.js +2 -1
  46. package/dist/components/Icon.js +1 -2
  47. package/dist/components/PDFViewer.js +2 -3
  48. package/dist/components/PopupView.js +1 -1
  49. package/dist/components/Portlet.js +3 -2
  50. package/dist/components/RegularButton.js +17 -14
  51. package/dist/components/SocketManager.js +97 -94
  52. package/dist/components/StepperTitleBar.js +7 -6
  53. package/dist/components/TabPage.js +10 -7
  54. package/dist/components/TabPanel.js +11 -6
  55. package/dist/components/TableCellContent.js +15 -11
  56. package/dist/components/TemplateDesigner.js +2 -2
  57. package/dist/components/TemplateItemEventHandler.js +232 -228
  58. package/dist/components/TemplateTable.js +32 -29
  59. package/dist/components/TitleBar.js +2 -2
  60. package/dist/components/Toolbar.js +17 -10
  61. package/dist/components/Tree.js +3 -3
  62. package/dist/components/WordDocumentViewer.css +1 -0
  63. package/dist/components/WordDocumentViewer.js +205 -14
  64. package/dist/components/card/Card.js +18 -15
  65. package/dist/components/card/CardAvatar.js +11 -8
  66. package/dist/components/card/CardBody.js +16 -13
  67. package/dist/components/card/CardFooter.js +15 -12
  68. package/dist/components/card/CardHeader.js +16 -13
  69. package/dist/components/card/CardIcon.js +9 -6
  70. package/dist/components/card/CardText.js +9 -6
  71. package/dist/components/customInput/File.js +4 -5
  72. package/dist/components/dashboard/FoldingSideTabDashboard.bck.js +1 -1
  73. package/dist/components/dashboard/FoldingSideTabDashboard.js +2 -3
  74. package/dist/components/dashboard/components/Header.js +6 -4
  75. package/dist/components/dashboard/components/LeftDrawer.js +2 -2
  76. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +26 -28
  77. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.bck.js +182 -188
  78. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +27 -30
  79. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +12 -14
  80. package/dist/components/drag-spec-design.json +15 -0
  81. package/dist/components/facialRecognition/FaceRecognitionComponent.js +10 -11
  82. package/dist/components/facialRecognition/service/faceApi.js +3 -3
  83. package/dist/components/form/AddressSearch.js +8 -5
  84. package/dist/components/form/AutoComplete.js +4 -4
  85. package/dist/components/form/BaseField.js +3 -2
  86. package/dist/components/form/CurrencyField.js +9 -9
  87. package/dist/components/form/DatePicker.js +3 -2
  88. package/dist/components/form/FieldSet.js +2 -1
  89. package/dist/components/form/Form.css +1 -1
  90. package/dist/components/form/Form.js +10 -7
  91. package/dist/components/form/GridField.js +6 -4
  92. package/dist/components/form/IconField.js +2 -1
  93. package/dist/components/form/ImageEditor.js +13 -8
  94. package/dist/components/form/LookupField.js +8 -7
  95. package/dist/components/form/MultiFileUploadField.js +14 -8
  96. package/dist/components/form/SelectItem.js +7 -6
  97. package/dist/components/form/TextField.js +6 -6
  98. package/dist/components/form/TimePicker.js +3 -2
  99. package/dist/components/form/TransferList.js +2 -2
  100. package/dist/components/form/UploadField.js +5 -5
  101. package/dist/components/grid/GridContainer.js +7 -4
  102. package/dist/components/grid/GridItem.js +7 -4
  103. package/dist/components/layout/CollapsiblePanel.js +7 -5
  104. package/dist/components/layout/Layout.js +5 -5
  105. package/dist/components/layout/View.js +6 -5
  106. package/dist/components/layout/ViewContainer.js +1 -2
  107. package/dist/components/layout/ViewPort.js +1 -1
  108. package/dist/components/layout/Window.js +2 -3
  109. package/dist/components/layout/WindowDialog.js +9 -7
  110. package/dist/components/layout/WindowViewPort.js +3 -3
  111. package/dist/components/media/Chat.js +2 -1
  112. package/dist/components/media/MediaSoupHelper.js +57 -53
  113. package/dist/components/media/SocketRequest.js +9 -7
  114. package/dist/components/media/SocketResponse.js +7 -5
  115. package/dist/components/media/Timer.js +1 -2
  116. package/dist/components/media/Toolbar.js +3 -3
  117. package/dist/components/media/ToolbarButton.js +3 -3
  118. package/dist/components/media/Toolbar_bck.js +3 -3
  119. package/dist/components/media/Tracks.js +24 -19
  120. package/dist/components/media/TrainingRoom.js +3 -4
  121. package/dist/components/media/Transports.js +21 -17
  122. package/dist/components/media/VCEventManager.js +25 -24
  123. package/dist/components/media/VCEventType.js +81 -79
  124. package/dist/components/media/VCParticipantList.js +1 -2
  125. package/dist/components/media/VCParticipantListItem.js +2 -3
  126. package/dist/components/media/VCRoomParticipant.js +4 -5
  127. package/dist/components/media/VCRoomRecorder.js +163 -160
  128. package/dist/components/media/VCRoomWorkspace.js +3 -4
  129. package/dist/components/media/Video.js +1 -2
  130. package/dist/components/media/VideoPlayer.js +1 -2
  131. package/dist/components/media/chat/ChatPoll.js +15 -15
  132. package/dist/components/media/chat/ChatRoom.js +15 -15
  133. package/dist/components/media/chat/ChatRoomItem.js +2 -3
  134. package/dist/components/media/chat/ChatRoomList.js +1 -2
  135. package/dist/components/media/chat/ChatRoomWrapper.js +1 -1
  136. package/dist/components/media/chat/PollContainer.js +14 -8
  137. package/dist/components/media/chat/PollResult.js +1 -2
  138. package/dist/components/menu/MenuBars.js +8 -5
  139. package/dist/components/menu/MenuButton.js +11 -5
  140. package/dist/components/menu/MenuItem.js +13 -6
  141. package/dist/components/menu/MenuLink.js +2 -1
  142. package/dist/components/navbars/HomeNavbar.js +43 -41
  143. package/dist/components/navbars/PortalNavbar.js +1 -2
  144. package/dist/components/signatures/AgilitySignaturePanel.js +39 -15
  145. package/dist/components/signatures/{DocumentContainer.js → HtmlSignatureDocumentContainer.js} +4 -4
  146. package/dist/components/signatures/ImageSignatureInput.js +27 -16
  147. package/dist/components/signatures/ResponsiveTable.js +1 -1
  148. package/dist/components/signatures/SearchView.js +1 -1
  149. package/dist/components/signatures/SignatureInput.js +42 -98
  150. package/dist/components/signatures/SignatureInputProps.js +1 -1
  151. package/dist/components/signatures/SignatureTemplateDesigner.js +13 -10
  152. package/dist/components/signatures/Toolbar.js +7 -3
  153. package/dist/components/signatures/ViewUtils.js +21 -16
  154. package/dist/event/ActionHandlers.js +10 -7
  155. package/dist/event/Event.js +15 -13
  156. package/dist/event/EventListener.js +39 -41
  157. package/dist/event/EventType.js +24 -19
  158. package/dist/event/Observable.js +120 -125
  159. package/dist/event/RouteActionHandler.js +4 -4
  160. package/dist/event/ScriptActionHandler.js +1 -1
  161. package/dist/event/ServiceCallActionHandler.js +1 -1
  162. package/dist/interaction/CursorOverlay.js +48 -0
  163. package/dist/interaction/DragContext.js +39 -0
  164. package/dist/interaction/GrabContext.js +40 -0
  165. package/dist/js/Addresses.js +9 -8
  166. package/dist/js/Calendar.js +152 -149
  167. package/dist/js/Docs.js +92 -87
  168. package/dist/js/DynamicLib.js +9 -6
  169. package/dist/js/Media.js +134 -131
  170. package/dist/js/ProcurementMeetings.js +81 -78
  171. package/dist/js/Validators.js +53 -50
  172. package/dist/js/Windows.js +35 -32
  173. package/dist/redux/store/ConfigureStore.js +8 -5
  174. package/dist/redux/store/DashboardStore.js +13 -12
  175. package/dist/redux/store/SecurityStore.js +9 -6
  176. package/dist/security/TokenManager.js +1 -1
  177. package/dist/view/Dashboard.js +11 -12
  178. package/dist/view/security/ForgotPassword.js +3 -3
  179. package/dist/view/security/ForgotPasswordBasic.js +1 -1
  180. package/dist/view/security/Login.js +4 -4
  181. package/dist/view/security/LoginBasic.js +2 -2
  182. package/dist/view/security/LoginInteractionPortal.js +2 -2
  183. package/dist/view/security/ResetPassword.js +1 -1
  184. package/dist/view/security/ResetPasswordBasic.js +1 -1
  185. package/dist/view/security/Security.js +4 -4
  186. package/package.json +1 -1
package/dist/Utils.js CHANGED
@@ -9,11 +9,27 @@ var _Event = _interopRequireDefault(require("./event/Event"));
9
9
  var _ApplicationManager = _interopRequireDefault(require("./ApplicationManager"));
10
10
  var _Observable = _interopRequireDefault(require("./event/Observable"));
11
11
  var _EventType = _interopRequireDefault(require("./event/EventType"));
12
+ var _Utils;
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
19
  const colors = ['#F44336', '#e91e63', '#9c27b0', '#673ab7', '#ff9800', '#ff5722', '#795548', '#607d8b', '#3f51b5', '#2196F3', '#00bcd4', '#009688', '#2196F3', '#32c787', '#00BCD4', '#ff5652', '#ffc107', '#ff85af', '#FF9800', '#39bbb0', '#4CAF50', '#ffeb3b', '#ffc107'];
14
20
  class Utils {
15
- constructor() {}
16
- static SYSTEM_ERROR_MESSAGE = "A system error has occurred. Please contact your system administrator";
21
+ constructor() {
22
+ _defineProperty(this, "showMessage", (viewRef, message, type) => {
23
+ if (Utils.isNull(message)) {
24
+ message = "";
25
+ }
26
+ let messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
27
+ viewRef.setState({
28
+ message: message,
29
+ messageStyle: messageType
30
+ });
31
+ });
32
+ }
17
33
  static isNull(value) {
18
34
  return value === null || typeof value === 'undefined';
19
35
  }
@@ -21,7 +37,7 @@ class Utils {
21
37
  if (value == null) return fallback;
22
38
  // allow "72px", "5rem", etc.
23
39
  if (typeof value === "string" && value.trim()) return value.trim();
24
- if (typeof value === "number" && Number.isFinite(value)) return `${value}px`;
40
+ if (typeof value === "number" && Number.isFinite(value)) return "".concat(value, "px");
25
41
  return fallback;
26
42
  }
27
43
  static getInitials(name) {
@@ -42,10 +58,6 @@ class Utils {
42
58
  }
43
59
  }
44
60
  }
45
- static capitalize = s => {
46
- if (typeof s !== 'string') return '';
47
- return s.charAt(0).toUpperCase() + s.slice(1);
48
- };
49
61
  static joinScript(lines) {
50
62
  let script = '';
51
63
  for (let i = 0; i < lines.length; i++) {
@@ -71,7 +83,7 @@ class Utils {
71
83
  let configJson = JSON.stringify(config);
72
84
  let replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
73
85
  if (index !== null) {
74
- replace = replace.replace(/\[#i]/g, `[${index}]`);
86
+ replace = replace.replace(/\[#i]/g, "[".concat(index, "]"));
75
87
  }
76
88
  return JSON.parse(replace);
77
89
  }
@@ -153,29 +165,6 @@ class Utils {
153
165
  request.paged = typeof paged === 'undefined' || paged === null || paged;
154
166
  return JSON.stringify(request);
155
167
  }
156
- static getFieldColspan = field => {
157
- return !Utils.isNull(field.attributes) && !Utils.isNull(field.attributes['colspan']) ? parseInt(typeof field.attributes.colspan === 'string' ? _DynamicJS.default.executeScript("__colspan_" + field.id, field.attributes.colspan) : field.attributes.colspan) : 1;
158
- };
159
- static prop = value => {
160
- return _ApplicationManager.default.isExpression(value) ? _DynamicJS.default.executeScript("readProp_" + Math.random(), value, null, true, null, null, false) : value;
161
- };
162
- static createRow = () => {
163
- let row = {};
164
- row.fields = [];
165
- row.usedSlots = 0;
166
- return row;
167
- };
168
- static fillRowWithSpacers = (row, max) => {
169
- for (let i = row.usedSlots; i < max; i++) {
170
- let field = {};
171
- field.fieldType = 'LABEL';
172
- field.id = 'system_col_span_spacer_' + i;
173
- row.fields.push(field);
174
- }
175
- };
176
- static rowHasSpaceForNewField = (row, colspan, max) => {
177
- return colspan <= max - row.usedSlots;
178
- };
179
168
  static getFieldGrid(attributes, fields) {
180
169
  let fieldGrid = {};
181
170
  let maxColspan = !Utils.isNull(attributes) && !Utils.isNull(attributes.layoutColumns) ? attributes.layoutColumns : 1;
@@ -204,7 +193,7 @@ class Utils {
204
193
  } else if (expression === "true" || expression === true) {
205
194
  return true;
206
195
  } else if (!Utils.isNull(expression)) {
207
- return _DynamicJS.default.executeScript(`${id}UtilsBoolEval`, expression);
196
+ return _DynamicJS.default.executeScript("".concat(id, "UtilsBoolEval"), expression);
208
197
  }
209
198
  return !this.isNull(defaultValue) ? defaultValue : false;
210
199
  } catch (e) {
@@ -242,16 +231,6 @@ class Utils {
242
231
  legend.innerHTML = text;
243
232
  }
244
233
  }
245
- showMessage = (viewRef, message, type) => {
246
- if (Utils.isNull(message)) {
247
- message = "";
248
- }
249
- let messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
250
- viewRef.setState({
251
- message: message,
252
- messageStyle: messageType
253
- });
254
- };
255
234
  saveForm(viewRef, formRef, url) {
256
235
  this.saveForm(viewRef, formRef, url, null, null, null);
257
236
  }
@@ -268,10 +247,9 @@ class Utils {
268
247
  let stateDate = viewRef.state[refDateName];
269
248
  let tempDate = stateDate;
270
249
  if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
271
- viewRef.setState({
272
- ...viewRef.state,
250
+ viewRef.setState(_objectSpread(_objectSpread({}, viewRef.state), {}, {
273
251
  [refDateName]: newDate
274
- }, () => {
252
+ }), () => {
275
253
  if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
276
254
  let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
277
255
  formRef.current.setValue(autoFillDateName, autoFillDate);
@@ -295,38 +273,6 @@ class Utils {
295
273
  return arg;
296
274
  });
297
275
  }
298
- static getPropertyChainPath = expression => {
299
- let path = {};
300
- if (!this.isNull(expression)) {
301
- let tokens = expression.split('.');
302
- path.property = tokens[tokens.length - 1];
303
- let voExpression = expression.substring(0, expression.indexOf('.'));
304
- path.valueObject = _DynamicJS.default.executeScript(`${Math.random()}_PropertyChainUtilsEval`, voExpression);
305
- for (let i = 1; i < tokens.length - 1; i++) {
306
- let token = tokens[i];
307
- if (!this.isNull(path.valueObject)) {
308
- let getter = path.valueObject[token];
309
- if (!Utils.isNull(getter)) {
310
- if (typeof getter === 'function') {
311
- path.valueObject = getter();
312
- } else {
313
- path.valueObject = getter;
314
- }
315
- }
316
- } else {
317
- break;
318
- }
319
- }
320
- }
321
- return path;
322
- };
323
- static mergeStyles = (defaultStyle, config) => {
324
- let configStyle = Utils.getComponentAttribute(config, 'style', null);
325
- if (configStyle) {
326
- return this.mergeObjects(configStyle, defaultStyle);
327
- }
328
- return defaultStyle;
329
- };
330
276
  static mergeObjects(source, target) {
331
277
  if (!target) {
332
278
  return source;
@@ -338,42 +284,6 @@ class Utils {
338
284
  }
339
285
  return result;
340
286
  }
341
- static publishErrorMessage = async function (e, viewId) {
342
- let component = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
343
- let messageText;
344
- if (e.json) {
345
- let data = await e.json();
346
- messageText = data.message;
347
- if (!messageText) {
348
- messageText = Utils.SYSTEM_ERROR_MESSAGE;
349
- }
350
- } else {
351
- messageText = Utils.SYSTEM_ERROR_MESSAGE;
352
- }
353
- let message = {
354
- messageType: 'ERROR',
355
- message: messageText
356
- };
357
- let event = new _Event.default(_ApplicationManager.default, viewId, message);
358
- _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
359
- if (component !== null) {
360
- event = new _Event.default(component, viewId, message);
361
- _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
362
- }
363
- };
364
- static publishSystemErrorMessage = function (viewId) {
365
- let component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
366
- Utils.publishErrorMessage('A system error has occurred. Please try again later', viewId, component);
367
- };
368
- static base64ToArrayBuffer = base64 => {
369
- const binaryString = window.atob(base64);
370
- const len = binaryString.length;
371
- const bytes = new Uint8Array(len);
372
- for (let i = 0; i < len; i++) {
373
- bytes[i] = binaryString.charCodeAt(i);
374
- }
375
- return bytes.buffer;
376
- };
377
287
  static getAvatarColor(name) {
378
288
  name = name.substr(0, 6);
379
289
  let hash = 0;
@@ -417,4 +327,101 @@ class Utils {
417
327
  return current[keys[keys.length - 1]];
418
328
  }
419
329
  }
420
- exports.default = Utils;
330
+ exports.default = Utils;
331
+ _Utils = Utils;
332
+ _defineProperty(Utils, "SYSTEM_ERROR_MESSAGE", "A system error has occurred. Please contact your system administrator");
333
+ _defineProperty(Utils, "capitalize", s => {
334
+ if (typeof s !== 'string') return '';
335
+ return s.charAt(0).toUpperCase() + s.slice(1);
336
+ });
337
+ _defineProperty(Utils, "getFieldColspan", field => {
338
+ return !_Utils.isNull(field.attributes) && !_Utils.isNull(field.attributes['colspan']) ? parseInt(typeof field.attributes.colspan === 'string' ? _DynamicJS.default.executeScript("__colspan_" + field.id, field.attributes.colspan) : field.attributes.colspan) : 1;
339
+ });
340
+ _defineProperty(Utils, "prop", value => {
341
+ return _ApplicationManager.default.isExpression(value) ? _DynamicJS.default.executeScript("readProp_" + Math.random(), value, null, true, null, null, false) : value;
342
+ });
343
+ _defineProperty(Utils, "createRow", () => {
344
+ let row = {};
345
+ row.fields = [];
346
+ row.usedSlots = 0;
347
+ return row;
348
+ });
349
+ _defineProperty(Utils, "fillRowWithSpacers", (row, max) => {
350
+ for (let i = row.usedSlots; i < max; i++) {
351
+ let field = {};
352
+ field.fieldType = 'LABEL';
353
+ field.id = 'system_col_span_spacer_' + i;
354
+ row.fields.push(field);
355
+ }
356
+ });
357
+ _defineProperty(Utils, "rowHasSpaceForNewField", (row, colspan, max) => {
358
+ return colspan <= max - row.usedSlots;
359
+ });
360
+ _defineProperty(Utils, "getPropertyChainPath", expression => {
361
+ let path = {};
362
+ if (!_Utils.isNull(expression)) {
363
+ let tokens = expression.split('.');
364
+ path.property = tokens[tokens.length - 1];
365
+ let voExpression = expression.substring(0, expression.indexOf('.'));
366
+ path.valueObject = _DynamicJS.default.executeScript("".concat(Math.random(), "_PropertyChainUtilsEval"), voExpression);
367
+ for (let i = 1; i < tokens.length - 1; i++) {
368
+ let token = tokens[i];
369
+ if (!_Utils.isNull(path.valueObject)) {
370
+ let getter = path.valueObject[token];
371
+ if (!_Utils.isNull(getter)) {
372
+ if (typeof getter === 'function') {
373
+ path.valueObject = getter();
374
+ } else {
375
+ path.valueObject = getter;
376
+ }
377
+ }
378
+ } else {
379
+ break;
380
+ }
381
+ }
382
+ }
383
+ return path;
384
+ });
385
+ _defineProperty(Utils, "mergeStyles", (defaultStyle, config) => {
386
+ let configStyle = _Utils.getComponentAttribute(config, 'style', null);
387
+ if (configStyle) {
388
+ return _Utils.mergeObjects(configStyle, defaultStyle);
389
+ }
390
+ return defaultStyle;
391
+ });
392
+ _defineProperty(Utils, "publishErrorMessage", async function (e, viewId) {
393
+ let component = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
394
+ let messageText;
395
+ if (e.json) {
396
+ let data = await e.json();
397
+ messageText = data.message;
398
+ if (!messageText) {
399
+ messageText = _Utils.SYSTEM_ERROR_MESSAGE;
400
+ }
401
+ } else {
402
+ messageText = _Utils.SYSTEM_ERROR_MESSAGE;
403
+ }
404
+ let message = {
405
+ messageType: 'ERROR',
406
+ message: messageText
407
+ };
408
+ let event = new _Event.default(_ApplicationManager.default, viewId, message);
409
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
410
+ if (component !== null) {
411
+ event = new _Event.default(component, viewId, message);
412
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
413
+ }
414
+ });
415
+ _defineProperty(Utils, "publishSystemErrorMessage", function (viewId) {
416
+ let component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
417
+ _Utils.publishErrorMessage('A system error has occurred. Please try again later', viewId, component);
418
+ });
419
+ _defineProperty(Utils, "base64ToArrayBuffer", base64 => {
420
+ const binaryString = window.atob(base64);
421
+ const len = binaryString.length;
422
+ const bytes = new Uint8Array(len);
423
+ for (let i = 0; i < len; i++) {
424
+ bytes[i] = binaryString.charCodeAt(i);
425
+ }
426
+ return bytes.buffer;
427
+ });
@@ -11,170 +11,173 @@ var _Utils = _interopRequireDefault(require("./Utils"));
11
11
  var _DynamicJS = _interopRequireWildcard(require("./DynamicJS"));
12
12
  var _Graph = _interopRequireDefault(require("./components/Graph"));
13
13
  var _ApplicationManager = _interopRequireDefault(require("./ApplicationManager"));
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; }
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
19
  const SYSTEM_EVENT = exports.SYSTEM_EVENT = 'SYSTEM_EVENT';
18
- const LEGEND_ARROW_ICON = exports.LEGEND_ARROW_ICON = ` <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> `;
20
+ const LEGEND_ARROW_ICON = exports.LEGEND_ARROW_ICON = " <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> ";
19
21
  class ViewContext {
20
- constructor(id) {
21
- this.views = [];
22
- this.props = {};
23
- this.navHistory = [];
24
- this.graphs = [];
25
- this.id = id;
26
- }
27
-
28
- /**
29
- * update appbar title
30
- *
31
- * @param viewId
32
- * @param title
33
- */
34
- updateAppBarTitle = (viewId, title) => {
35
- let view = this.getView(viewId);
36
- if (!view) {
37
- return;
38
- }
39
- let legendIconArrow = LEGEND_ARROW_ICON.replace('__COLOR__', this.props.secondaryColor);
40
- let titleValue = '';
41
- if (!title.match(_DynamicJS.TEMPLATE_REGEX)) {
42
- titleValue = title;
43
- } else {
44
- titleValue = _DynamicJS.default.executeScript(viewId + 'Title', title, viewId);
45
- }
46
- for (const navHistoryElement of this.navHistory) {
47
- if (navHistoryElement.viewId === viewId) {
48
- navHistoryElement.title = titleValue;
22
+ constructor(_id) {
23
+ /**
24
+ * update appbar title
25
+ *
26
+ * @param viewId
27
+ * @param title
28
+ */
29
+ _defineProperty(this, "updateAppBarTitle", (viewId, title) => {
30
+ let view = this.getView(viewId);
31
+ if (!view) {
32
+ return;
49
33
  }
50
- }
51
- let legendValue = '<span>';
52
- let counter = 0;
53
- for (const navHistoryElement of this.navHistory) {
54
- legendValue += `${navHistoryElement.title}`;
55
- if (counter++ < this.navHistory.length - 1) {
56
- legendValue += legendIconArrow;
34
+ let legendIconArrow = LEGEND_ARROW_ICON.replace('__COLOR__', this.props.secondaryColor);
35
+ let titleValue = '';
36
+ if (!title.match(_DynamicJS.TEMPLATE_REGEX)) {
37
+ titleValue = title;
38
+ } else {
39
+ titleValue = _DynamicJS.default.executeScript(viewId + 'Title', title, viewId);
57
40
  }
58
- }
59
- legendValue += '</span>';
60
- this.props.appBarTitle = legendValue;
61
- let property = {};
62
- property.name = 'title-' + viewId;
63
- property.value = this.props.appBarTitle;
41
+ for (const navHistoryElement of this.navHistory) {
42
+ if (navHistoryElement.viewId === viewId) {
43
+ navHistoryElement.title = titleValue;
44
+ }
45
+ }
46
+ let legendValue = '<span>';
47
+ let counter = 0;
48
+ for (const navHistoryElement of this.navHistory) {
49
+ legendValue += "".concat(navHistoryElement.title);
50
+ if (counter++ < this.navHistory.length - 1) {
51
+ legendValue += legendIconArrow;
52
+ }
53
+ }
54
+ legendValue += '</span>';
55
+ this.props.appBarTitle = legendValue;
56
+ let property = {};
57
+ property.name = 'title-' + viewId;
58
+ property.value = this.props.appBarTitle;
64
59
 
65
- // When we introduce the view manager, it must become the event source instead of applicationManager
66
- let event = new _Event.default(_ApplicationManager.default, SYSTEM_EVENT, property);
67
- _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
68
- if (this.graphs.length > 0) {
69
- property = {};
70
- property.name = 'stepperTitle';
60
+ // When we introduce the view manager, it must become the event source instead of applicationManager
71
61
  let event = new _Event.default(_ApplicationManager.default, SYSTEM_EVENT, property);
72
62
  _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
73
- }
74
- };
75
-
76
- /**
77
- * clears all views
78
- *
79
- */
80
- clear = () => {
81
- this.views.splice(0, this.views.length);
82
- };
83
-
84
- /**
85
- * add view configuration
86
- *
87
- * @param view the listener to be added
88
- * @param path
89
- * @param forward
90
- */
91
- addView = (view, path, forward) => {
92
- let topView = this.getTopView();
93
- if (topView) {
94
- this.closeView(topView.config.id, forward);
95
- }
96
- if (view.parent) {
97
- this.navHistory.splice(0, this.navHistory.length);
98
- for (const contextView of this.views) {
99
- if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api)) {
100
- this.closeView(contextView.handle.api.id, forward);
63
+ if (this.graphs.length > 0) {
64
+ property = {};
65
+ property.name = 'stepperTitle';
66
+ let event = new _Event.default(_ApplicationManager.default, SYSTEM_EVENT, property);
67
+ _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
68
+ }
69
+ });
70
+ /**
71
+ * clears all views
72
+ *
73
+ */
74
+ _defineProperty(this, "clear", () => {
75
+ this.views.splice(0, this.views.length);
76
+ });
77
+ /**
78
+ * add view configuration
79
+ *
80
+ * @param view the listener to be added
81
+ * @param path
82
+ * @param forward
83
+ */
84
+ _defineProperty(this, "addView", (view, path, forward) => {
85
+ let topView = this.getTopView();
86
+ if (topView) {
87
+ this.closeView(topView.config.id, forward);
88
+ }
89
+ if (view.parent) {
90
+ this.navHistory.splice(0, this.navHistory.length);
91
+ for (const contextView of this.views) {
92
+ if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api)) {
93
+ this.closeView(contextView.handle.api.id, forward);
94
+ }
101
95
  }
102
96
  }
103
- }
104
- if ((forward || view.parent) && !view.graphId) {
105
- let historyElement = {};
106
- historyElement.viewId = view.config.id;
107
- historyElement.parent = view.parent;
108
- historyElement.graphId = view.graphId;
109
- historyElement.path = path;
110
- this.navHistory.push(historyElement);
111
- }
112
- this.views.push(view);
113
- };
114
-
115
- /**
116
- * closes the current view
117
- *
118
- */
119
- closeAllViews = () => {
120
- for (const view of this.views) {
121
- this.closeView(view.config.id, false);
122
- }
123
- };
124
-
125
- /**
126
- * get all view
127
- *
128
- */
129
- getViews = () => {
130
- return this.views;
131
- };
132
-
133
- /**
134
- * get all graphs
135
- *
136
- */
137
- getGraphs = () => {
138
- return this.graphs;
139
- };
140
-
141
- /**
142
- * closes the specified view
143
- *
144
- * @param viewId the listener to be added
145
- * @param forward
146
- */
147
- closeView = (viewId, forward) => {
148
- let view = this.getView(viewId);
149
- if (view) {
150
- if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle.api)) {
151
- _Observable.default.clearEventListeners(viewId);
152
- let index = this.views.findIndex(v => v.handle.api.id === viewId);
153
- if (index >= 0) {
154
- this.views.splice(index, 1);
155
- if (!forward) {
156
- let viewIndex = this.navHistory.findIndex(h => h.viewId === viewId);
157
- if (viewIndex >= 0) {
158
- this.navHistory.splice(viewIndex, 1);
97
+ if ((forward || view.parent) && !view.graphId) {
98
+ let historyElement = {};
99
+ historyElement.viewId = view.config.id;
100
+ historyElement.parent = view.parent;
101
+ historyElement.graphId = view.graphId;
102
+ historyElement.path = path;
103
+ this.navHistory.push(historyElement);
104
+ }
105
+ this.views.push(view);
106
+ });
107
+ /**
108
+ * closes the current view
109
+ *
110
+ */
111
+ _defineProperty(this, "closeAllViews", () => {
112
+ for (const view of this.views) {
113
+ this.closeView(view.config.id, false);
114
+ }
115
+ });
116
+ /**
117
+ * get all view
118
+ *
119
+ */
120
+ _defineProperty(this, "getViews", () => {
121
+ return this.views;
122
+ });
123
+ /**
124
+ * get all graphs
125
+ *
126
+ */
127
+ _defineProperty(this, "getGraphs", () => {
128
+ return this.graphs;
129
+ });
130
+ /**
131
+ * closes the specified view
132
+ *
133
+ * @param viewId the listener to be added
134
+ * @param forward
135
+ */
136
+ _defineProperty(this, "closeView", (viewId, forward) => {
137
+ let view = this.getView(viewId);
138
+ if (view) {
139
+ if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle.api)) {
140
+ _Observable.default.clearEventListeners(viewId);
141
+ let index = this.views.findIndex(v => v.handle.api.id === viewId);
142
+ if (index >= 0) {
143
+ this.views.splice(index, 1);
144
+ if (!forward) {
145
+ let viewIndex = this.navHistory.findIndex(h => h.viewId === viewId);
146
+ if (viewIndex >= 0) {
147
+ this.navHistory.splice(viewIndex, 1);
148
+ }
159
149
  }
160
150
  }
161
151
  }
162
152
  }
163
- }
164
- };
165
-
166
- /**
167
- * Returns a view configuration with a particular id
168
- *
169
- */
170
- getView = id => {
171
- for (const view of this.views) {
172
- if (id === view.config.id) {
173
- return view;
153
+ });
154
+ /**
155
+ * Returns a view configuration with a particular id
156
+ *
157
+ */
158
+ _defineProperty(this, "getView", id => {
159
+ for (const view of this.views) {
160
+ if (id === view.config.id) {
161
+ return view;
162
+ }
174
163
  }
175
- }
176
- return null;
177
- };
164
+ return null;
165
+ });
166
+ /**
167
+ *
168
+ */
169
+ _defineProperty(this, "getPreviousHistoryElement", () => {
170
+ if (this.navHistory.length > 1) {
171
+ return this.navHistory[this.navHistory.length - 2];
172
+ }
173
+ return null;
174
+ });
175
+ this.views = [];
176
+ this.props = {};
177
+ this.navHistory = [];
178
+ this.graphs = [];
179
+ this.id = _id;
180
+ }
178
181
  getTopView() {
179
182
  if (this.views.length > 0) {
180
183
  return this.views[this.views.length - 1];
@@ -230,15 +233,5 @@ class ViewContext {
230
233
  }
231
234
  graph.init();
232
235
  }
233
-
234
- /**
235
- *
236
- */
237
- getPreviousHistoryElement = () => {
238
- if (this.navHistory.length > 1) {
239
- return this.navHistory[this.navHistory.length - 2];
240
- }
241
- return null;
242
- };
243
236
  }
244
237
  exports.ViewContext = ViewContext;