@agilemotion/oui-react-js 1.3.1 → 1.3.3

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 (96) hide show
  1. package/dist/ApplicationContext.js +148 -39
  2. package/dist/BasicApp.js +12 -5
  3. package/dist/BasicAppHome.js +18 -12
  4. package/dist/BusinessPortalApp.css +37 -0
  5. package/dist/BusinessPortalApp.js +90 -0
  6. package/dist/BusinessPortalAppHome.js +160 -0
  7. package/dist/RestUtils.js +65 -40
  8. package/dist/Utils.js +47 -1
  9. package/dist/assets/jss/components/footerStyle.js +7 -4
  10. package/dist/assets/jss/views/loginBasicStyle.js +0 -1
  11. package/dist/assets/jss/views/loginBusinessPortalStyle.js +76 -0
  12. package/dist/components/AlertBar.js +40 -11
  13. package/dist/components/ConfirmationDialog.js +54 -8
  14. package/dist/components/DataGrid.css +3 -1
  15. package/dist/components/DataGrid.js +149 -82
  16. package/dist/components/DataGridFilter.js +85 -8
  17. package/dist/components/Dialog.js +258 -0
  18. package/dist/components/Graph.js +26 -18
  19. package/dist/components/GraphNode.js +0 -2
  20. package/dist/components/HtmlPanel.js +103 -4
  21. package/dist/components/Icon.js +60 -0
  22. package/dist/components/PopupView.js +55 -6
  23. package/dist/components/SignaturePanel.js +147 -0
  24. package/dist/components/StepperTitleBar.bck.css +85 -0
  25. package/dist/components/StepperTitleBar.css +53 -54
  26. package/dist/components/StepperTitleBar.js +42 -29
  27. package/dist/components/TabPanel.js +10 -11
  28. package/dist/components/TableCellContent.js +6 -3
  29. package/dist/components/TemplateDesigner.css +13 -0
  30. package/dist/components/TemplateDesigner.js +494 -0
  31. package/dist/components/TemplateItemEventHandler.js +440 -0
  32. package/dist/components/TemplateTable.js +222 -0
  33. package/dist/components/TitleBar.js +21 -14
  34. package/dist/components/Toolbar.js +7 -5
  35. package/dist/components/Tree.js +5 -2
  36. package/dist/components/dashboard/{BasicBusinessApp.js → BasicBusinessAppDashboard.js} +30 -25
  37. package/dist/components/dashboard/BusinessPortalAppDashboard.css +5 -0
  38. package/dist/components/dashboard/BusinessPortalAppDashboard.js +236 -0
  39. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +23 -12
  40. package/dist/components/dashboard/components/portal/Timeline.js +17 -0
  41. package/dist/components/dashboard/components/portal/Workspace.css +25 -0
  42. package/dist/components/dashboard/components/portal/Workspace.js +48 -0
  43. package/dist/components/dashboard/components/portal/portal-dashboard.css +25 -0
  44. package/dist/components/footer/Footer.js +43 -10
  45. package/dist/components/form/AddressSearch.js +140 -0
  46. package/dist/components/form/BaseField.js +42 -8
  47. package/dist/components/form/Checkbox.js +3 -0
  48. package/dist/components/form/DatePicker.js +70 -4
  49. package/dist/components/form/FieldSet.js +247 -72
  50. package/dist/components/form/Form.js +178 -127
  51. package/dist/components/form/GridField.js +3 -2
  52. package/dist/components/form/ImageEditor.js +461 -0
  53. package/dist/components/form/LabelField.js +2 -2
  54. package/dist/components/form/LookupField.js +16 -4
  55. package/dist/components/form/RadioGroup.js +107 -0
  56. package/dist/components/form/Section.js +58 -19
  57. package/dist/components/form/SelectItem.js +14 -5
  58. package/dist/components/form/SignatureTemplateDesignerField.js +46 -0
  59. package/dist/components/form/TextField.js +5 -9
  60. package/dist/components/form/TransferList.js +7 -7
  61. package/dist/components/form/UploadField.js +184 -55
  62. package/dist/components/form/noimage-person.png +0 -0
  63. package/dist/components/form/noimage.png +0 -0
  64. package/dist/components/form/transparent.jpeg +0 -0
  65. package/dist/components/layout/CollapsiblePanel.js +0 -6
  66. package/dist/components/layout/Layout.js +49 -19
  67. package/dist/components/layout/View.css +43 -0
  68. package/dist/components/layout/View.js +76 -156
  69. package/dist/components/layout/ViewPort.js +32 -49
  70. package/dist/components/menu/MenuLink.js +7 -0
  71. package/dist/components/navbars/HomeNavbar.js +29 -14
  72. package/dist/components/navbars/PortalNavbar.css +75 -0
  73. package/dist/components/navbars/PortalNavbar.js +227 -0
  74. package/dist/components/signatures/AgilitySignaturePanel.js +312 -0
  75. package/dist/components/signatures/DocumentContainer.css +33 -0
  76. package/dist/components/signatures/DocumentContainer.js +206 -0
  77. package/dist/components/signatures/ImageSignatureInput.js +265 -0
  78. package/dist/components/signatures/ResponsiveTable.js +1 -3
  79. package/dist/components/signatures/SignatureInput.js +303 -0
  80. package/dist/components/signatures/SignatureInputProps.js +17 -11
  81. package/dist/components/signatures/SignatureTemplateDesigner.js +192 -81
  82. package/dist/components/signatures/transparent.jpeg +0 -0
  83. package/dist/event/LoadDataActionHandler.js +1 -1
  84. package/dist/event/Observable.js +1 -1
  85. package/dist/event/RouteActionHandler.js +18 -5
  86. package/dist/event/ServiceCallActionHandler.js +7 -3
  87. package/dist/js/Addresses.js +16 -9
  88. package/dist/view/Dashboard.js +27 -19
  89. package/dist/view/PortalDashboard.js +33 -0
  90. package/dist/view/security/ChangePasswordBasic.js +1 -0
  91. package/dist/view/security/ForgotPasswordBasic.js +1 -0
  92. package/dist/view/security/LoginBasic.js +6 -1
  93. package/dist/view/security/LoginBusinessPortal.js +268 -0
  94. package/dist/view/security/ResetPasswordBasic.js +1 -0
  95. package/package.json +25 -21
  96. package/dist/assets/img/flogo.png +0 -0
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactRouterDom = require("react-router-dom");
11
+
12
+ var _LoadingIndicator = _interopRequireDefault(require("./components/LoadingIndicator"));
13
+
14
+ var _BusinessPortalAppDashboard = _interopRequireDefault(require("./components/dashboard/BusinessPortalAppDashboard"));
15
+
16
+ var _ApplicationContext = _interopRequireDefault(require("./ApplicationContext"));
17
+
18
+ var _TokenManager = _interopRequireDefault(require("./security/TokenManager"));
19
+
20
+ var _Utils = _interopRequireDefault(require("./Utils"));
21
+
22
+ var _reactPromiseTracker = require("react-promise-tracker");
23
+
24
+ var _reactRouter = require("react-router");
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+
28
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
+
30
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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 _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
37
+
38
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
+
40
+ const location = window.location.protocol + "//" + window.location.hostname;
41
+
42
+ const status = response => {
43
+ if (response.ok) {
44
+ return Promise.resolve(response);
45
+ } else {
46
+ let error = new Error(response.statusText);
47
+ error.code = response.status;
48
+ return Promise.reject(error);
49
+ }
50
+ };
51
+
52
+ const json = response => {
53
+ return response.text();
54
+ };
55
+
56
+ const BusinessPortalAppHome = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
57
+ const _React$useState = _react.default.useState(null),
58
+ _React$useState2 = _slicedToArray(_React$useState, 2),
59
+ dashboardSettings = _React$useState2[0],
60
+ setDashboardSettings = _React$useState2[1];
61
+
62
+ const _React$useState3 = _react.default.useState(null),
63
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
64
+ tokenRefreshMonitorStarted = _React$useState4[0],
65
+ setTokenRefreshMonitorStarted = _React$useState4[1];
66
+
67
+ const _React$useState5 = _react.default.useState(null),
68
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
69
+ loadingColor = _React$useState6[0],
70
+ setLoadingColor = _React$useState6[1];
71
+
72
+ const _React$useState7 = _react.default.useState(location + props.contextRoot + props.implConfig.authUrl + "/user/avatar?" + "access_token=" + sessionStorage.getItem("accessToken") + "&idToken=" + sessionStorage.getItem("idToken")),
73
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
74
+ avatarUrl = _React$useState8[0],
75
+ setAvatarUrl = _React$useState8[1];
76
+
77
+ const history = (0, _reactRouter.useHistory)();
78
+
79
+ _react.default.useEffect(() => {
80
+ if (dashboardSettings === null) {
81
+ _ApplicationContext.default.setApplicationHistory(history);
82
+
83
+ _ApplicationContext.default.setServiceApiPath(props.implConfig.serviceApiPath);
84
+
85
+ _ApplicationContext.default.setUIConfigPath(props.implConfig.uiConfigPath);
86
+
87
+ _ApplicationContext.default.setContextRoot(props.contextRoot);
88
+
89
+ _ApplicationContext.default.setBaseApiUrl(props.implConfig.baseApiUrl);
90
+
91
+ _ApplicationContext.default.setFilesApiPath(props.implConfig.filesApiPath);
92
+
93
+ let implId = sessionStorage.getItem("implId");
94
+ (0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(location + props.contextRoot + props.implConfig.baseApiUrl + "/ui/setup/" + (implId ? implId : "default")), {
95
+ method: 'GET',
96
+ headers: {
97
+ 'Accept': 'application/json',
98
+ 'Authorization': 'Bearer ' + sessionStorage.getItem("accessToken"),
99
+ 'idToken': sessionStorage.getItem("idToken")
100
+ }
101
+ }).then(status).then(json).then(data => {
102
+ setDashboardSettings(JSON.parse(data));
103
+ }).catch(e => {
104
+ if (e.code === 401) {
105
+ _ApplicationContext.default.clear();
106
+
107
+ _ApplicationContext.default.getApplicationHistory().push('/login');
108
+ }
109
+ }));
110
+ }
111
+ });
112
+
113
+ _react.default.useEffect(() => {
114
+ if (dashboardSettings !== null) {
115
+ if (!tokenRefreshMonitorStarted) {
116
+ _TokenManager.default.startTokenRefreshMonitor(location + props.contextRoot + props.implConfig.authUrl + "/refresh", dashboardSettings.userName);
117
+
118
+ setTokenRefreshMonitorStarted(true);
119
+ }
120
+
121
+ if (!_Utils.default.isNull(dashboardSettings.userAvatar)) {
122
+ setAvatarUrl(dashboardSettings.userAvatar.url);
123
+ }
124
+
125
+ _ApplicationContext.default.setApplicationThemeColors(dashboardSettings.primaryColor, dashboardSettings.secondaryColor);
126
+
127
+ setLoadingColor(dashboardSettings.primaryColor);
128
+ }
129
+ }, [dashboardSettings]);
130
+
131
+ const logout = () => {
132
+ sessionStorage.removeItem("accessToken");
133
+ sessionStorage.removeItem("refreshToken");
134
+ sessionStorage.removeItem("idToken");
135
+ sessionStorage.removeItem("lastLogin");
136
+
137
+ _ApplicationContext.default.clear();
138
+
139
+ history.push('/login');
140
+ };
141
+
142
+ return /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement("div", {
143
+ className: "main w-100 h-100 d-inline-block"
144
+ }, /*#__PURE__*/_react.default.createElement("div", {
145
+ className: "w-100 h-100"
146
+ }, dashboardSettings !== null ? /*#__PURE__*/_react.default.createElement(_BusinessPortalAppDashboard.default, {
147
+ logoutCallBack: () => {
148
+ logout();
149
+ },
150
+ settings: dashboardSettings,
151
+ avatar: !_Utils.default.isNull(avatarUrl) ? avatarUrl : null,
152
+ logo: dashboardSettings.logo,
153
+ appLogoPath: props.implConfig.appLogo
154
+ }) : null), /*#__PURE__*/_react.default.createElement(_LoadingIndicator.default, {
155
+ color: loadingColor
156
+ })));
157
+ }));
158
+
159
+ var _default = BusinessPortalAppHome;
160
+ exports.default = _default;
package/dist/RestUtils.js CHANGED
@@ -97,9 +97,7 @@ class RestUtils {
97
97
 
98
98
  if (httpParameterType === 'PATH_VARIABLE') {
99
99
  if (!_Utils.default.isNull(parameterValue)) {
100
- if (pathParameters.length > 0) {
101
- pathParameters += '/' + JSON.stringify(parameterValue.value);
102
- }
100
+ pathParameters += '/' + (typeof parameterValue.value === 'object' ? JSON.stringify(parameterValue.value) : parameterValue.value);
103
101
  }
104
102
  }
105
103
 
@@ -158,7 +156,13 @@ class RestUtils {
158
156
  this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
159
157
  } else {
160
158
  if (!_Utils.default.isNull(successCallback)) {
161
- this.processSuccessfulResponseData(response, successCallback, viewId, successMessage);
159
+ this.processSuccessfulResponseData(component, response, successCallback, viewId, successMessage);
160
+ }
161
+
162
+ let path = _Utils.default.getPropertyChainPath(returnValueBinding);
163
+
164
+ if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
165
+ path.valueObject[path.property] = response;
162
166
  }
163
167
 
164
168
  this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response);
@@ -178,10 +182,20 @@ class RestUtils {
178
182
  });
179
183
  } else {
180
184
  sendRequest(url, data => {
185
+ let path = _Utils.default.getPropertyChainPath(returnValueBinding);
186
+
187
+ if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
188
+ path.valueObject[path.property] = data;
189
+ }
190
+
191
+ this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, data);
192
+
181
193
  if (!_Utils.default.isNull(successCallback)) {
182
194
  successCallback(data);
183
195
  }
184
196
  }, e => {
197
+ this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
198
+
185
199
  if (!_Utils.default.isNull(errorCallback)) {
186
200
  errorCallback(e);
187
201
  }
@@ -257,8 +271,6 @@ class RestUtils {
257
271
  }
258
272
  }
259
273
  }, e => {
260
- console.error(e);
261
-
262
274
  if (errorCallback !== null) {
263
275
  errorCallback(e);
264
276
  }
@@ -280,40 +292,27 @@ class RestUtils {
280
292
  fetchWithCustomConfig(url, successCallback, errorCallback, secure, config, method, download, body, serviceType, viewId, successMessage, track) {
281
293
  const accessToken = sessionStorage.getItem("accessToken");
282
294
  const idToken = sessionStorage.getItem("idToken");
283
- let data = null;
284
-
285
- if (serviceType === 'rest') {
286
- data = JSON.stringify(body);
295
+ /*let data = null;
296
+ if(serviceType === 'rest') {
297
+ data = JSON.stringify(body);
287
298
  } else {
288
- if (!_Utils.default.isNull(body)) {
289
- data = new FormData();
290
- const json = JSON.stringify(body);
291
- data.append("requestDto", json);
292
-
293
- let currentView = _ApplicationContext.default.getCurrentView();
294
-
295
- if (!_Utils.default.isNull(currentView)) {
296
- let domainCache = _ApplicationContext.default.getFileDomainCache(currentView.config.id);
297
-
298
- if (!_Utils.default.isNull(domainCache)) {
299
- var _iterator2 = _createForOfIteratorHelper(domainCache.files),
300
- _step2;
301
-
302
- try {
303
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
304
- const file = _step2.value;
305
- data.append(file.correlationId, file.content);
306
- }
307
- } catch (err) {
308
- _iterator2.e(err);
309
- } finally {
310
- _iterator2.f();
299
+ if (!Utils.isNull(body)) {
300
+ data = new FormData();
301
+ const json = JSON.stringify(body);
302
+ data.append("requestDto", json);
303
+ let currentView = applicationContext.getCurrentView();
304
+ if (!Utils.isNull(currentView)) {
305
+ let domainCache = applicationContext.getFileDomainCache(currentView.config.id);
306
+ if (!Utils.isNull(domainCache)) {
307
+ for (const file of domainCache.files) {
308
+ data.append(file.correlationId, file.content);
309
+ }
310
+ }
311
311
  }
312
- }
313
312
  }
314
- }
315
- }
313
+ }*/
316
314
 
315
+ let data = body ? JSON.stringify(body) : null;
317
316
  let fetchConfig = config;
318
317
 
319
318
  if (_Utils.default.isNull(fetchConfig)) {
@@ -321,6 +320,7 @@ class RestUtils {
321
320
  fetchConfig = {
322
321
  method: _Utils.default.isNull(method) ? 'GET' : method,
323
322
  headers: {
323
+ 'Content-Type': 'application/json',
324
324
  'Accept': 'application/json',
325
325
  'Authorization': 'Bearer ' + accessToken,
326
326
  'idToken': idToken
@@ -331,6 +331,7 @@ class RestUtils {
331
331
  fetchConfig = {
332
332
  method: _Utils.default.isNull(method) ? 'GET' : method,
333
333
  headers: {
334
+ 'Content-Type': 'application/json',
334
335
  'Accept': 'application/json'
335
336
  },
336
337
  body: data
@@ -363,9 +364,11 @@ class RestUtils {
363
364
 
364
365
  exeuteFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback) {
365
366
  return fetch(encodeURI(url), fetchConfig).then(status).then(json).then(data => {
366
- this.processSuccessfulResponseData(data, successCallback, viewId, successMessage);
367
+ this.processSuccessfulResponseData(null, data, successCallback, viewId, successMessage);
367
368
  }).catch(e => {
368
- if (e.code === 401) {
369
+ console.error(e);
370
+
371
+ if (e.code === 401 && !url.endsWith("/logout")) {
369
372
  errorCallback(e);
370
373
 
371
374
  _ApplicationContext.default.clear();
@@ -379,8 +382,18 @@ class RestUtils {
379
382
  });
380
383
  }
381
384
 
382
- processSuccessfulResponseData(data, successCallback, viewId, successMessage) {
383
- let response = typeof data === "object" || _Utils.default.isNull(data) || data.toString().trim().length === 0 ? data : JSON.parse(data);
385
+ processSuccessfulResponseData(component, data, successCallback, viewId, successMessage) {
386
+ let response;
387
+
388
+ if (typeof data === "object" || _Utils.default.isNull(data) || data.toString().trim().length === 0) {
389
+ response = data;
390
+ } else {
391
+ try {
392
+ response = JSON.parse(data);
393
+ } catch (ignored) {
394
+ response = data;
395
+ }
396
+ }
384
397
 
385
398
  if (successCallback !== null) {
386
399
  let responseData = !_Utils.default.isNull(response) ? response.data : null;
@@ -389,6 +402,12 @@ class RestUtils {
389
402
  let event = new _Event.default(_ApplicationContext.default, viewId, responseData);
390
403
 
391
404
  _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
405
+
406
+ if (component !== null) {
407
+ event = new _Event.default(component, viewId, responseData);
408
+
409
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
410
+ }
392
411
  } else if (!_Utils.default.isNull(successMessage)) {
393
412
  let message = {
394
413
  messageType: 'SUCCESS',
@@ -397,6 +416,12 @@ class RestUtils {
397
416
  let event = new _Event.default(_ApplicationContext.default, viewId, message);
398
417
 
399
418
  _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
419
+
420
+ if (component !== null) {
421
+ event = new _Event.default(component, viewId, message);
422
+
423
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
424
+ }
400
425
  }
401
426
 
402
427
  successCallback(response);
package/dist/Utils.js CHANGED
@@ -17,6 +17,12 @@ var _EventType = _interopRequireDefault(require("./event/EventType"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
+ 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; } } }; }
21
+
22
+ 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); }
23
+
24
+ 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; }
25
+
20
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
21
27
 
22
28
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -165,6 +171,14 @@ class Utils {
165
171
  return this.isNull(field.attributes[attribute]) ? defaultValue : field.attributes[attribute];
166
172
  }
167
173
 
174
+ static getComponentStyleAttribute(field, attribute, defaultValue) {
175
+ if (this.isNull(field.attributes) || this.isNull(field.attributes.style)) {
176
+ return defaultValue;
177
+ }
178
+
179
+ return this.isNull(field.attributes.style[attribute]) ? defaultValue : field.attributes.style[attribute];
180
+ }
181
+
168
182
  static doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
169
183
  var request = {};
170
184
  request.pageSize = curretRowsPerPage;
@@ -358,7 +372,33 @@ _defineProperty(Utils, "getPropertyChainPath", expression => {
358
372
  return path;
359
373
  });
360
374
 
361
- _defineProperty(Utils, "publishSystemErrorMessage", viewId => {
375
+ _defineProperty(Utils, "mergeStyles", (defaultStyle, config) => {
376
+ let configStyle = Utils.getComponentAttribute(config, 'style', null);
377
+ console.log(config.id);
378
+ console.log(configStyle);
379
+
380
+ if (configStyle) {
381
+ let properties = Object.getOwnPropertyNames(configStyle);
382
+
383
+ var _iterator = _createForOfIteratorHelper(properties),
384
+ _step;
385
+
386
+ try {
387
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
388
+ const property = _step.value;
389
+ defaultStyle[property] = configStyle[property];
390
+ }
391
+ } catch (err) {
392
+ _iterator.e(err);
393
+ } finally {
394
+ _iterator.f();
395
+ }
396
+ }
397
+
398
+ return defaultStyle;
399
+ });
400
+
401
+ _defineProperty(Utils, "publishSystemErrorMessage", (viewId, component = null) => {
362
402
  let message = {
363
403
  messageType: 'ERROR',
364
404
  message: 'A system error has accured. Please try again later'
@@ -366,4 +406,10 @@ _defineProperty(Utils, "publishSystemErrorMessage", viewId => {
366
406
  let event = new _Event.default(_ApplicationContext.default, viewId, message);
367
407
 
368
408
  _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
409
+
410
+ if (component !== null) {
411
+ event = new _Event.default(component, viewId, message);
412
+
413
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
414
+ }
369
415
  });
@@ -16,23 +16,26 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
16
16
  const footerStyle = {
17
17
  block: {},
18
18
  left: {
19
- float: "left!important",
20
- display: "block"
19
+ float: "left !important"
21
20
  },
22
21
  right: {
23
22
  margin: "0",
24
23
  fontSize: "14px",
25
- float: "right!important",
24
+ float: "right !important",
26
25
  padding: "15px",
27
26
  paddingRight: "70px"
28
27
  },
29
28
  footer: _objectSpread(_objectSpread({
30
29
  bottom: "0",
31
- borderTop: "1px solid " + _rootStyle.grayColor[15],
32
30
  padding: "15px 0"
33
31
  }, _rootStyle.defaultFont), {}, {
34
32
  zIndex: 4
35
33
  }),
34
+ wrapper: {
35
+ display: "inline-block",
36
+ textAlign: '-webkit-center',
37
+ width: '100%'
38
+ },
36
39
  container: _objectSpread(_objectSpread({
37
40
  zIndex: 3
38
41
  }, _rootStyle.container), {}, {
@@ -13,7 +13,6 @@ const styles = {
13
13
  maxWidth: 400,
14
14
  paddingTop: '56px',
15
15
  height: 'auto',
16
- color: _colors.grey400,
17
16
  fontSize: '30px'
18
17
  },
19
18
  loginContainer: {
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _colors = require("material-ui/styles/colors");
9
+
10
+ const styles = {
11
+ title: {
12
+ minWidth: 320,
13
+ maxWidth: 400,
14
+ height: 'auto',
15
+ fontSize: '30px'
16
+ },
17
+ loginContainer: {
18
+ minWidth: 320,
19
+ maxWidth: 400,
20
+ padding: '16px',
21
+ height: 'auto'
22
+ },
23
+ paper: {
24
+ padding: 20,
25
+ overflow: 'auto'
26
+ },
27
+ buttonsDiv: {
28
+ display: "inline-block",
29
+ textAlign: "center",
30
+ marginTop: '8px'
31
+ },
32
+ flatButton: {
33
+ color: _colors.grey500
34
+ },
35
+ checkRemember: {
36
+ style: {
37
+ float: 'left',
38
+ maxWidth: 180,
39
+ paddingTop: 5
40
+ },
41
+ labelStyle: {
42
+ color: _colors.grey500
43
+ },
44
+ iconStyle: {
45
+ color: _colors.grey500,
46
+ borderColor: _colors.grey500,
47
+ fill: _colors.grey500
48
+ }
49
+ },
50
+ componentWrapper: {
51
+ display: "inline",
52
+ textAlign: "center"
53
+ },
54
+ loginBtn: {
55
+ float: 'right'
56
+ },
57
+ btn: {
58
+ background: '#4f81e9',
59
+ color: _colors.white,
60
+ padding: 7,
61
+ borderRadius: 2,
62
+ margin: 2,
63
+ fontSize: 13
64
+ },
65
+ btnFacebook: {
66
+ background: '#4f81e9'
67
+ },
68
+ btnGoogle: {
69
+ background: '#e14441'
70
+ },
71
+ btnSpan: {
72
+ marginLeft: 5
73
+ }
74
+ };
75
+ var _default = styles;
76
+ exports.default = _default;
@@ -17,6 +17,8 @@ var _Observable = _interopRequireDefault(require("../event/Observable"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
+ 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(_e2) { throw _e2; }, 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(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
21
+
20
22
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
23
 
22
24
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -52,22 +54,49 @@ const AlertBar = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
52
54
  let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
53
55
 
54
56
  let eventHandlingConfig = _Utils.default.isNull(parsedConfig.eventHandlingConfig) ? {} : parsedConfig.eventHandlingConfig;
55
- eventHandlingConfig.subscriptions = _Utils.default.isNull(eventHandlingConfig.subscriptions) ? [] : eventHandlingConfig.subscriptions;
56
- let subscription = {
57
- publisher: "applicationContext",
58
- eventType: _EventType.default.MESSAGE_ARRIVED,
59
- actions: [{
60
- actionType: "script",
61
- script: {
62
- lines: ["@#{".concat(props.config.id, "}.message = $event.data.message"), "@#{".concat(props.config.id, "}.variant = $event.data.messageType === 'ERROR' ? 'danger' : $event.data.messageType === 'WARN' ? 'warning' : $event.data.messageType === 'SUCCESS' ? 'success' : 'info' ")]
63
- }
64
- }]
57
+ let defaultAction = {
58
+ actionType: "script",
59
+ script: {
60
+ lines: ["@#{".concat(props.config.id, "}.message = $event.data.message"), "@#{".concat(props.config.id, "}.variant = $event.data.messageType === 'ERROR' ? 'danger' : $event.data.messageType === 'WARN' ? 'warning' : $event.data.messageType === 'SUCCESS' ? 'success' : 'info' ")]
61
+ }
65
62
  };
66
- eventHandlingConfig.subscriptions.push(subscription);
63
+
64
+ if (_Utils.default.isNull(eventHandlingConfig.subscriptions)) {
65
+ // Add default subscription
66
+ eventHandlingConfig.subscriptions = [];
67
+ let subscription = {
68
+ publisher: "applicationContext",
69
+ eventType: _EventType.default.MESSAGE_ARRIVED,
70
+ actions: [defaultAction]
71
+ };
72
+ eventHandlingConfig.subscriptions.push(subscription);
73
+ } else {
74
+ var _iterator = _createForOfIteratorHelper(eventHandlingConfig.subscriptions),
75
+ _step;
76
+
77
+ try {
78
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
79
+ const subscription = _step.value;
80
+
81
+ if (_Utils.default.isNull(subscription.actions)) {
82
+ subscription.actions = [];
83
+ }
84
+
85
+ if (subscription.actions.length === 0) {
86
+ subscription.actions.push(defaultAction);
87
+ }
88
+ }
89
+ } catch (err) {
90
+ _iterator.e(err);
91
+ } finally {
92
+ _iterator.f();
93
+ }
94
+ }
67
95
 
68
96
  _Observable.default.addSubscriptions(eventHandlingConfig, props.handle, props.viewId);
69
97
 
70
98
  props.loadCompleteHandler(props.config.id);
99
+ setInitializing(false);
71
100
  }
72
101
  });
73
102