@agilemotion/oui-react-js 1.2.6 → 1.2.8

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 (133) hide show
  1. package/dist/ApplicationContext.js +244 -250
  2. package/dist/BasicApp.js +53 -97
  3. package/dist/BasicAppHome.js +86 -122
  4. package/dist/DynamicJS.js +65 -88
  5. package/dist/RestUtils.js +284 -315
  6. package/dist/TypedValue.js +15 -18
  7. package/dist/Utils.js +224 -262
  8. package/dist/assets/jss/components/authNavbarStyle.js +162 -164
  9. package/dist/assets/jss/components/buttonStyle.js +1 -1
  10. package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
  11. package/dist/assets/jss/components/cardBodyStyle.js +1 -1
  12. package/dist/assets/jss/components/cardFooterStyle.js +1 -1
  13. package/dist/assets/jss/components/cardHeaderStyle.js +1 -1
  14. package/dist/assets/jss/components/cardIconStyle.js +1 -1
  15. package/dist/assets/jss/components/cardStyle.js +1 -1
  16. package/dist/assets/jss/components/cardTextStyle.js +1 -1
  17. package/dist/assets/jss/components/customDropdownStyle.js +192 -194
  18. package/dist/assets/jss/components/customInputStyle.js +1 -1
  19. package/dist/assets/jss/components/dropdownStyle.js +107 -109
  20. package/dist/assets/jss/components/footerStyle.js +1 -1
  21. package/dist/assets/jss/components/headerLinksStyle.js +95 -97
  22. package/dist/assets/jss/components/headerStyle.js +60 -62
  23. package/dist/assets/jss/components/navbarLinksStyle.js +137 -139
  24. package/dist/assets/jss/components/navbarStyle.js +71 -73
  25. package/dist/assets/jss/components/sidebarStyle.js +453 -455
  26. package/dist/assets/jss/components/typographyStyle.js +1 -1
  27. package/dist/assets/jss/rootStyle.js +57 -57
  28. package/dist/assets/jss/views/layoutStyle.js +42 -44
  29. package/dist/assets/jss/views/loginBasicStyle.js +1 -1
  30. package/dist/assets/jss/views/loginStyle.js +87 -89
  31. package/dist/components/AlertBar.js +21 -23
  32. package/dist/components/AlertItem.js +23 -25
  33. package/dist/components/AlertTemplate.js +29 -30
  34. package/dist/components/Button.js +35 -37
  35. package/dist/components/ConfirmationDialog.js +3 -3
  36. package/dist/components/DataGrid.js +250 -276
  37. package/dist/components/DataGridColumn.js +34 -36
  38. package/dist/components/DataGridFilter.js +92 -94
  39. package/dist/components/DataGridHeading.js +32 -38
  40. package/dist/components/DocumentViewer.js +12 -11
  41. package/dist/components/Graph.js +34 -50
  42. package/dist/components/GraphNode.js +53 -56
  43. package/dist/components/HtmlPanel.js +6 -8
  44. package/dist/components/Icon.js +28 -58
  45. package/dist/components/LoadingIndicator.js +2 -2
  46. package/dist/components/PopupView.js +15 -17
  47. package/dist/components/RegularButton.js +20 -20
  48. package/dist/components/TabPage.js +23 -25
  49. package/dist/components/TabPanel.js +34 -34
  50. package/dist/components/TableCellContent.js +34 -34
  51. package/dist/components/TitleBar.js +16 -16
  52. package/dist/components/Toolbar.js +112 -118
  53. package/dist/components/Tooltip.js +35 -43
  54. package/dist/components/Tree.js +54 -60
  55. package/dist/components/card/Card.js +17 -17
  56. package/dist/components/card/CardAvatar.js +10 -10
  57. package/dist/components/card/CardBody.js +14 -14
  58. package/dist/components/card/CardFooter.js +13 -13
  59. package/dist/components/card/CardHeader.js +14 -14
  60. package/dist/components/card/CardIcon.js +7 -7
  61. package/dist/components/card/CardText.js +7 -7
  62. package/dist/components/customInput/CustomInput.js +17 -17
  63. package/dist/components/dashboard/BasicApp.js +25 -25
  64. package/dist/components/dashboard/BasicBusinessApp.js +116 -119
  65. package/dist/components/dashboard/components/Header.js +11 -11
  66. package/dist/components/dashboard/components/LeftDrawer.js +3 -3
  67. package/dist/components/dashboard/components/UserIdentity.js +2 -2
  68. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +85 -127
  69. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +151 -191
  70. package/dist/components/footer/Footer.js +8 -8
  71. package/dist/components/footer/HomeFooter.js +34 -66
  72. package/dist/components/form/BaseField.js +78 -78
  73. package/dist/components/form/Checkbox.js +8 -10
  74. package/dist/components/form/DatePicker.js +15 -19
  75. package/dist/components/form/FieldSet.js +62 -88
  76. package/dist/components/form/Form.js +317 -318
  77. package/dist/components/form/GridField.js +81 -86
  78. package/dist/components/form/LabelField.js +10 -12
  79. package/dist/components/form/LookupField.js +40 -42
  80. package/dist/components/form/Section.js +37 -39
  81. package/dist/components/form/SelectItem.js +35 -39
  82. package/dist/components/form/TextField.js +18 -22
  83. package/dist/components/form/TimePicker.js +15 -19
  84. package/dist/components/form/TransferList.js +83 -91
  85. package/dist/components/form/UploadField.js +135 -145
  86. package/dist/components/grid/GridContainer.js +6 -6
  87. package/dist/components/grid/GridItem.js +6 -6
  88. package/dist/components/layout/CollapsiblePanel.js +18 -20
  89. package/dist/components/layout/Layout.js +70 -72
  90. package/dist/components/layout/View.js +134 -136
  91. package/dist/components/layout/ViewPort.js +56 -98
  92. package/dist/components/menu/CollapsibleMenu.js +26 -28
  93. package/dist/components/menu/MenuBars.js +53 -59
  94. package/dist/components/menu/MenuButton.js +70 -77
  95. package/dist/components/menu/MenuItem.js +15 -17
  96. package/dist/components/menu/MenuLink.js +9 -11
  97. package/dist/components/menu/PopupMenu.js +12 -16
  98. package/dist/components/navbars/AuthNavbar.js +12 -12
  99. package/dist/components/navbars/HomeNavbar.js +175 -222
  100. package/dist/components/navbars/NavbarLinks.js +45 -46
  101. package/dist/components/typography/Danger.js +3 -3
  102. package/dist/components/typography/Info.js +3 -3
  103. package/dist/components/typography/Link.js +3 -3
  104. package/dist/event/ActionHandlers.js +43 -57
  105. package/dist/event/Event.js +13 -16
  106. package/dist/event/EventListener.js +36 -39
  107. package/dist/event/EventType.js +1 -5
  108. package/dist/event/LoadDataActionHandler.js +8 -20
  109. package/dist/event/Observable.js +162 -198
  110. package/dist/event/RouteActionHandler.js +76 -88
  111. package/dist/event/ScriptActionHandler.js +8 -20
  112. package/dist/event/ServiceCallActionHandler.js +28 -40
  113. package/dist/event/SignalGraphActionHandler.js +7 -19
  114. package/dist/js/Addresses.js +15 -27
  115. package/dist/js/DynamicLib.js +11 -14
  116. package/dist/js/Validators.js +5 -6
  117. package/dist/redux/store/ConfigureStore.js +6 -6
  118. package/dist/redux/store/DashboardStore.js +83 -95
  119. package/dist/redux/store/History.js +1 -1
  120. package/dist/redux/store/SecurityStore.js +41 -45
  121. package/dist/security/TokenManager.js +30 -44
  122. package/dist/theme-default.js +1 -1
  123. package/dist/view/Dashboard.js +108 -114
  124. package/dist/view/Settings.js +2 -4
  125. package/dist/view/security/ChangePasswordBasic.js +96 -100
  126. package/dist/view/security/ForgotPassword.js +52 -56
  127. package/dist/view/security/ForgotPasswordBasic.js +48 -54
  128. package/dist/view/security/Login.js +58 -62
  129. package/dist/view/security/LoginBasic.js +50 -54
  130. package/dist/view/security/ResetPassword.js +58 -62
  131. package/dist/view/security/ResetPasswordBasic.js +89 -93
  132. package/dist/view/security/Security.js +12 -12
  133. package/package.json +1 -1
@@ -5,30 +5,27 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
-
10
8
  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; }
11
9
 
12
- var TypedValue = function TypedValue(type, value) {
13
- var _this = this;
10
+ class TypedValue {
11
+ constructor(type, value) {
12
+ _defineProperty(this, "getValue", () => {
13
+ return this.value;
14
+ });
14
15
 
15
- _classCallCheck(this, TypedValue);
16
+ _defineProperty(this, "getType", () => {
17
+ return this.type;
18
+ });
16
19
 
17
- _defineProperty(this, "getValue", function () {
18
- return _this.value;
19
- });
20
+ this.type = type;
21
+ this.value = value;
22
+ this.instanceType = 'TypedValue';
23
+ }
24
+ /**
25
+ * getter
26
+ */
20
27
 
21
- _defineProperty(this, "getType", function () {
22
- return _this.type;
23
- });
24
28
 
25
- this.type = type;
26
- this.value = value;
27
- this.instanceType = 'TypedValue';
28
29
  }
29
- /**
30
- * getter
31
- */
32
- ;
33
30
 
34
31
  exports.default = TypedValue;
package/dist/Utils.js CHANGED
@@ -21,26 +21,18 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
21
21
 
22
22
  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; }
23
23
 
24
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
-
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
29
-
30
24
  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; }
31
25
 
32
- var Utils = /*#__PURE__*/function () {
33
- function Utils() {
34
- _classCallCheck(this, Utils);
35
-
26
+ class Utils {
27
+ constructor() {
36
28
  _defineProperty(this, "SYSTEM_ERROR_MESSAGE", "A system error has accured. Please contact your system administrator");
37
29
 
38
- _defineProperty(this, "showMessage", function (viewRef, message, type) {
30
+ _defineProperty(this, "showMessage", (viewRef, message, type) => {
39
31
  if (Utils.isNull(message)) {
40
32
  message = "";
41
33
  }
42
34
 
43
- var messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
35
+ let messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
44
36
  viewRef.setState({
45
37
  message: message,
46
38
  messageStyle: messageType
@@ -48,337 +40,307 @@ var Utils = /*#__PURE__*/function () {
48
40
  });
49
41
  }
50
42
 
51
- _createClass(Utils, [{
52
- key: "saveForm",
53
- value: function saveForm(viewRef, formRef, url) {
54
- this.saveForm(viewRef, formRef, url, null, null, null);
55
- }
56
- }, {
57
- key: "saveForm",
58
- value: function saveForm(viewRef, formRef, url, successCallback, errorCallback) {
59
- this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
60
- }
61
- }, {
62
- key: "autoSetDate",
63
- value: function autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
64
- var stateDate = viewRef.state[refDateName];
65
- var tempDate = stateDate;
66
-
67
- if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
68
- viewRef.setState(_objectSpread(_objectSpread({}, viewRef.state), {}, {
69
- [refDateName]: newDate
70
- }), function () {
71
- if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
72
- var autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
73
- formRef.current.setValue(autoFillDateName, autoFillDate);
74
- } else if (Utils.isNull(viewRef.state.id)) {
75
- var _autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
76
-
77
- formRef.current.setValue(autoFillDateName, _autoFillDate);
78
- }
79
- });
80
- }
81
- }
82
- }], [{
83
- key: "isNull",
84
- value: function isNull(value) {
85
- return value === null || typeof value === 'undefined';
86
- }
87
- }, {
88
- key: "joinScript",
89
- value: function joinScript(lines) {
90
- var script = '';
43
+ static isNull(value) {
44
+ return value === null || typeof value === 'undefined';
45
+ }
91
46
 
92
- for (var i = 0; i < lines.length; i++) {
93
- var line = lines[i].trim();
47
+ static joinScript(lines) {
48
+ let script = '';
94
49
 
95
- if (!line.endsWith(';') && !line.endsWith(':')) {
96
- line += ';';
97
- }
50
+ for (let i = 0; i < lines.length; i++) {
51
+ let line = lines[i].trim();
98
52
 
99
- line += '\n';
100
- script += line;
53
+ if (!line.endsWith(';') && !line.endsWith(':')) {
54
+ line += ';';
101
55
  }
102
56
 
103
- return script;
104
- }
105
- }, {
106
- key: "sleep",
107
- value: function sleep(milliseconds) {
108
- var date = Date.now();
109
- var currentDate = null;
110
-
111
- do {
112
- currentDate = Date.now();
113
- } while (currentDate - date < milliseconds);
57
+ line += '\n';
58
+ script += line;
114
59
  }
115
- }, {
116
- key: "parseConfig",
117
- value: function parseConfig(config, currentViewId) {
118
- var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
119
60
 
120
- if (!this.isNull(config) && !this.isNull(config.id)) {
121
- var configJson = JSON.stringify(config);
122
- var replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
61
+ return script;
62
+ }
123
63
 
124
- if (index !== null) {
125
- replace = replace.replace(/\[#i]/g, "[".concat(index, "]"));
126
- }
64
+ static sleep(milliseconds) {
65
+ const date = Date.now();
66
+ let currentDate = null;
127
67
 
128
- return JSON.parse(replace);
129
- }
68
+ do {
69
+ currentDate = Date.now();
70
+ } while (currentDate - date < milliseconds);
71
+ }
130
72
 
131
- return config;
132
- }
133
- }, {
134
- key: "isFieldRequired",
135
- value: function isFieldRequired(id, formId) {
136
- if (!Utils.isStringEmpty(formId)) {
137
- var fields = Utils.getFields(formId, 'validate');
138
-
139
- for (var i = 0; i < fields.length; i++) {
140
- if (fields[i].id === id) {
141
- return fields[i].required;
142
- }
143
- }
73
+ static parseConfig(config, currentViewId, index = null) {
74
+ if (!this.isNull(config) && !this.isNull(config.id)) {
75
+ let configJson = JSON.stringify(config);
76
+ let replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
77
+
78
+ if (index !== null) {
79
+ replace = replace.replace(/\[#i]/g, "[".concat(index, "]"));
144
80
  }
145
81
 
146
- return false;
82
+ return JSON.parse(replace);
147
83
  }
148
- }, {
149
- key: "isStringEmpty",
150
- value: function isStringEmpty(val) {
151
- return typeof val === 'undefined' || val === null || val.trim().length === 0;
152
- }
153
- }, {
154
- key: "getFields",
155
- value: function getFields(formId, className) {
156
- var inputFields = [];
157
- var form = document.getElementById(formId);
158
84
 
159
- if (!Utils.isNull(form)) {
160
- var inputDivs = form.getElementsByClassName(className);
85
+ return config;
86
+ }
161
87
 
162
- for (var i = 0; i < inputDivs.length; i++) {
163
- var inputs = inputDivs[i].getElementsByTagName("input");
88
+ static isFieldRequired(id, formId) {
89
+ if (!Utils.isStringEmpty(formId)) {
90
+ let fields = Utils.getFields(formId, 'validate');
164
91
 
165
- for (var j = 0; j < inputs.length; j++) {
166
- inputFields.push(inputs[j]);
167
- }
92
+ for (var i = 0; i < fields.length; i++) {
93
+ if (fields[i].id === id) {
94
+ return fields[i].required;
168
95
  }
169
96
  }
170
-
171
- return inputFields;
172
97
  }
173
- }, {
174
- key: "validateField",
175
- value: function validateField(id, required, values, currentValue, validator) {
176
- var message = !this.isNull(validator) ? validator.errorMessage : null;
177
- var regex = !this.isNull(validator) ? validator.regex : null;
178
- var result = {};
179
- result.valid = true;
180
- result.message = "";
181
- var value;
182
98
 
183
- if (currentValue !== null) {
184
- value = currentValue;
185
- } else {
186
- value = values[id];
187
- }
99
+ return false;
100
+ }
188
101
 
189
- var hasErrors = false;
102
+ static isStringEmpty(val) {
103
+ return typeof val === 'undefined' || val === null || val.trim().length === 0;
104
+ }
190
105
 
191
- if (required && (Utils.isNull(value) || Utils.isStringEmpty(value.toString()))) {
192
- result.message = !Utils.isNull(message) ? message : "This field is required";
193
- hasErrors = true;
194
- } else {
195
- result.message = "";
196
- }
106
+ static getFields(formId, className) {
107
+ let inputFields = [];
108
+ let form = document.getElementById(formId);
109
+
110
+ if (!Utils.isNull(form)) {
111
+ let inputDivs = form.getElementsByClassName(className);
197
112
 
198
- if (!hasErrors && !Utils.isNull(regex) && !Utils.isNull(value)) {
199
- hasErrors = Utils.isNull(value.toString().match(regex));
113
+ for (let i = 0; i < inputDivs.length; i++) {
114
+ let inputs = inputDivs[i].getElementsByTagName("input");
200
115
 
201
- if (hasErrors) {
202
- result.message = !Utils.isNull(message) ? message : "This field is invalid";
116
+ for (let j = 0; j < inputs.length; j++) {
117
+ inputFields.push(inputs[j]);
203
118
  }
204
119
  }
120
+ }
121
+
122
+ return inputFields;
123
+ }
205
124
 
206
- result.valid = !hasErrors;
207
- return result;
125
+ static validateField(id, required, values, currentValue, validator) {
126
+ let message = !this.isNull(validator) ? validator.errorMessage : null;
127
+ let regex = !this.isNull(validator) ? validator.regex : null;
128
+ let result = {};
129
+ result.valid = true;
130
+ result.message = "";
131
+ let value;
132
+
133
+ if (currentValue !== null) {
134
+ value = currentValue;
135
+ } else {
136
+ value = values[id];
137
+ }
138
+
139
+ let hasErrors = false;
140
+
141
+ if (required && (Utils.isNull(value) || Utils.isStringEmpty(value.toString()))) {
142
+ result.message = !Utils.isNull(message) ? message : "This field is required";
143
+ hasErrors = true;
144
+ } else {
145
+ result.message = "";
208
146
  }
209
- }, {
210
- key: "getComponentAttribute",
211
- value: function getComponentAttribute(field, attribute, defaultValue) {
212
- if (this.isNull(field.attributes)) {
213
- return defaultValue;
214
- }
215
147
 
216
- return this.isNull(field.attributes[attribute]) ? defaultValue : field.attributes[attribute];
148
+ if (!hasErrors && !Utils.isNull(regex) && !Utils.isNull(value)) {
149
+ hasErrors = Utils.isNull(value.toString().match(regex));
150
+
151
+ if (hasErrors) {
152
+ result.message = !Utils.isNull(message) ? message : "This field is invalid";
153
+ }
217
154
  }
218
- }, {
219
- key: "doGetRequestJson",
220
- value: function doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
221
- var request = {};
222
- request.pageSize = curretRowsPerPage;
223
- request.currentPage = currentPage;
224
- request.searchParameters = currentSearchParameters;
225
- request.paged = typeof paged === 'undefined' || paged === null || paged;
226
- return JSON.stringify(request);
155
+
156
+ result.valid = !hasErrors;
157
+ return result;
158
+ }
159
+
160
+ static getComponentAttribute(field, attribute, defaultValue) {
161
+ if (this.isNull(field.attributes)) {
162
+ return defaultValue;
227
163
  }
228
- }, {
229
- key: "getFieldGrid",
230
- value: function getFieldGrid(attributes, fields) {
231
- var fieldGrid = {};
232
- var maxColspan = !Utils.isNull(attributes) ? attributes.layoutColumns : 1;
233
- fieldGrid.maxColPerRow = maxColspan;
234
- fieldGrid.rows = [];
235
- var currRow = this.createRow();
236
164
 
237
- for (var i = 0; i < fields.length; i++) {
238
- var field = fields[i];
239
- var colspan = this.getFieldColspan(field);
165
+ return this.isNull(field.attributes[attribute]) ? defaultValue : field.attributes[attribute];
166
+ }
240
167
 
241
- if (!this.rowHasSpaceForNewField(currRow, colspan, maxColspan)) {
242
- this.fillRowWithSpacers(currRow, maxColspan);
243
- currRow = this.createRow();
244
- }
168
+ static doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
169
+ var request = {};
170
+ request.pageSize = curretRowsPerPage;
171
+ request.currentPage = currentPage;
172
+ request.searchParameters = currentSearchParameters;
173
+ request.paged = typeof paged === 'undefined' || paged === null || paged;
174
+ return JSON.stringify(request);
175
+ }
245
176
 
246
- if (currRow.fields.length === 0) {
247
- fieldGrid.rows.push(currRow);
248
- }
177
+ static getFieldGrid(attributes, fields) {
178
+ let fieldGrid = {};
179
+ let maxColspan = !Utils.isNull(attributes) ? attributes.layoutColumns : 1;
180
+ fieldGrid.maxColPerRow = maxColspan;
181
+ fieldGrid.rows = [];
182
+ let currRow = this.createRow();
183
+
184
+ for (let i = 0; i < fields.length; i++) {
185
+ let field = fields[i];
186
+ let colspan = this.getFieldColspan(field);
249
187
 
250
- currRow.fields.push(field);
251
- currRow.usedSlots += colspan;
188
+ if (!this.rowHasSpaceForNewField(currRow, colspan, maxColspan)) {
189
+ this.fillRowWithSpacers(currRow, maxColspan);
190
+ currRow = this.createRow();
252
191
  }
253
192
 
254
- return fieldGrid;
255
- }
256
- }, {
257
- key: "evaluateBooleanExpression",
258
- value: function evaluateBooleanExpression(expression, id, defaultValue) {
259
- if (expression === "false") {
260
- return false;
261
- } else if (expression === "true") {
262
- return true;
263
- } else if (!Utils.isNull(expression)) {
264
- return _DynamicJS.default.executeScript("".concat(id, "UtilsBoolEval"), expression);
193
+ if (currRow.fields.length === 0) {
194
+ fieldGrid.rows.push(currRow);
265
195
  }
266
196
 
267
- return !this.isNull(defaultValue) ? defaultValue : false;
197
+ currRow.fields.push(field);
198
+ currRow.usedSlots += colspan;
268
199
  }
269
- }, {
270
- key: "getEntityViewTitle",
271
- value: function getEntityViewTitle(queryParameterState, viewName) {
272
- if (Utils.isNull(queryParameterState) || Utils.isNull(queryParameterState.selection)) {
273
- return !Utils.isNull(viewName) ? viewName + " > Add" : "Add";
274
- }
275
200
 
276
- var props = "";
201
+ return fieldGrid;
202
+ }
277
203
 
278
- for (var _len = arguments.length, fields = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
279
- fields[_key - 2] = arguments[_key];
280
- }
204
+ static evaluateBooleanExpression(expression, id, defaultValue) {
205
+ if (expression === "false") {
206
+ return false;
207
+ } else if (expression === "true") {
208
+ return true;
209
+ } else if (!Utils.isNull(expression)) {
210
+ return _DynamicJS.default.executeScript("".concat(id, "UtilsBoolEval"), expression);
211
+ }
281
212
 
282
- for (var i = 0; i < fields.length; i++) {
283
- if (!Utils.isNull(fields[i])) {
284
- props += fields[i].trim();
285
- props += " ";
286
- }
287
- }
213
+ return !this.isNull(defaultValue) ? defaultValue : false;
214
+ }
288
215
 
289
- props = props.trim();
290
- var prefix = Utils.isNull(viewName) ? "" : " > ";
291
- return (Utils.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
216
+ static getEntityViewTitle(queryParameterState, viewName, ...fields) {
217
+ if (Utils.isNull(queryParameterState) || Utils.isNull(queryParameterState.selection)) {
218
+ return !Utils.isNull(viewName) ? viewName + " > Add" : "Add";
292
219
  }
293
- }, {
294
- key: "setLegendColor",
295
- value: function setLegendColor(color) {
296
- var legends = document.getElementsByClassName("legend");
297
220
 
298
- for (var i = 0; i < legends.length; i++) {
299
- legends[i].style.color = color;
221
+ let props = "";
222
+
223
+ for (let i = 0; i < fields.length; i++) {
224
+ if (!Utils.isNull(fields[i])) {
225
+ props += fields[i].trim();
226
+ props += " ";
300
227
  }
301
228
  }
302
- }, {
303
- key: "setLegend",
304
- value: function setLegend(text) {
305
- if (!Utils.isNull(text)) {
306
- var legend = document.getElementById("globalLegend");
307
- legend.innerHTML = text;
308
- }
229
+
230
+ props = props.trim();
231
+ let prefix = Utils.isNull(viewName) ? "" : " > ";
232
+ return (Utils.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
233
+ }
234
+
235
+ static setLegendColor(color) {
236
+ let legends = document.getElementsByClassName("legend");
237
+
238
+ for (let i = 0; i < legends.length; i++) {
239
+ legends[i].style.color = color;
309
240
  }
310
- }, {
311
- key: "offsetDate",
312
- value: function offsetDate(date, yearOffset, monthOffset, dayOffset) {
313
- var year = date.getFullYear() + yearOffset;
314
- var day = date.getDate() + dayOffset;
315
- var month = date.getMonth() + monthOffset;
316
- return new Date(year, month, day);
241
+ }
242
+
243
+ static setLegend(text) {
244
+ if (!Utils.isNull(text)) {
245
+ let legend = document.getElementById("globalLegend");
246
+ legend.innerHTML = text;
317
247
  }
318
- }, {
319
- key: "getArgs",
320
- value: function getArgs(func) {
321
- // First match everything inside the function argument parens.
322
- var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1]; // Split the arguments string into an array comma delimited.
323
-
324
- return args.split(',').map(function (arg) {
325
- // Ensure no inline comments are parsed and trim the whitespace.
326
- return arg.replace(/\/\*.*\*\//, '').trim();
327
- }).filter(function (arg) {
328
- // Ensure no undefined values are added.
329
- return arg;
248
+ }
249
+
250
+ saveForm(viewRef, formRef, url) {
251
+ this.saveForm(viewRef, formRef, url, null, null, null);
252
+ }
253
+
254
+ saveForm(viewRef, formRef, url, successCallback, errorCallback) {
255
+ this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
256
+ }
257
+
258
+ static offsetDate(date, yearOffset, monthOffset, dayOffset) {
259
+ let year = date.getFullYear() + yearOffset;
260
+ let day = date.getDate() + dayOffset;
261
+ let month = date.getMonth() + monthOffset;
262
+ return new Date(year, month, day);
263
+ }
264
+
265
+ autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
266
+ let stateDate = viewRef.state[refDateName];
267
+ let tempDate = stateDate;
268
+
269
+ if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
270
+ viewRef.setState(_objectSpread(_objectSpread({}, viewRef.state), {}, {
271
+ [refDateName]: newDate
272
+ }), () => {
273
+ if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
274
+ let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
275
+ formRef.current.setValue(autoFillDateName, autoFillDate);
276
+ } else if (Utils.isNull(viewRef.state.id)) {
277
+ let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
278
+ formRef.current.setValue(autoFillDateName, autoFillDate);
279
+ }
330
280
  });
331
281
  }
332
- }]);
282
+ }
283
+
284
+ static getArgs(func) {
285
+ // First match everything inside the function argument parens.
286
+ var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1]; // Split the arguments string into an array comma delimited.
287
+
288
+ return args.split(',').map(function (arg) {
289
+ // Ensure no inline comments are parsed and trim the whitespace.
290
+ return arg.replace(/\/\*.*\*\//, '').trim();
291
+ }).filter(function (arg) {
292
+ // Ensure no undefined values are added.
293
+ return arg;
294
+ });
295
+ }
333
296
 
334
- return Utils;
335
- }();
297
+ }
336
298
 
337
299
  exports.default = Utils;
338
300
 
339
- _defineProperty(Utils, "capitalize", function (s) {
301
+ _defineProperty(Utils, "capitalize", s => {
340
302
  if (typeof s !== 'string') return '';
341
303
  return s.charAt(0).toUpperCase() + s.slice(1);
342
304
  });
343
305
 
344
- _defineProperty(Utils, "getFieldColspan", function (field) {
306
+ _defineProperty(Utils, "getFieldColspan", field => {
345
307
  return !Utils.isNull(field.attributes) && !Utils.isNull(field.attributes['colspan']) ? parseFloat(field.attributes['colspan']) : 1;
346
308
  });
347
309
 
348
- _defineProperty(Utils, "createRow", function () {
349
- var row = {};
310
+ _defineProperty(Utils, "createRow", () => {
311
+ let row = {};
350
312
  row.fields = [];
351
313
  row.usedSlots = 0;
352
314
  return row;
353
315
  });
354
316
 
355
- _defineProperty(Utils, "fillRowWithSpacers", function (row, max) {
356
- for (var i = row.usedSlots; i < max; i++) {
357
- var field = {};
317
+ _defineProperty(Utils, "fillRowWithSpacers", (row, max) => {
318
+ for (let i = row.usedSlots; i < max; i++) {
319
+ let field = {};
358
320
  field.fieldType = 'LABEL';
359
321
  field.id = 'system_col_span_spacer_' + i;
360
322
  row.fields.push(field);
361
323
  }
362
324
  });
363
325
 
364
- _defineProperty(Utils, "rowHasSpaceForNewField", function (row, colspan, max) {
326
+ _defineProperty(Utils, "rowHasSpaceForNewField", (row, colspan, max) => {
365
327
  return colspan <= max - row.usedSlots;
366
328
  });
367
329
 
368
- _defineProperty(Utils, "getPropertyChainPath", function (expression) {
369
- var path = {};
330
+ _defineProperty(Utils, "getPropertyChainPath", expression => {
331
+ let path = {};
370
332
 
371
333
  if (!Utils.isNull(expression)) {
372
- var tokens = expression.split('.');
334
+ let tokens = expression.split('.');
373
335
  path.property = tokens[tokens.length - 1];
374
- var voExpression = expression.substring(0, expression.indexOf('.'));
336
+ let voExpression = expression.substring(0, expression.indexOf('.'));
375
337
  path.valueObject = _DynamicJS.default.executeScript("".concat(Math.random(), "_PropertyChainUtilsEval"), voExpression);
376
338
 
377
- for (var i = 1; i < tokens.length - 1; i++) {
378
- var token = tokens[i];
339
+ for (let i = 1; i < tokens.length - 1; i++) {
340
+ let token = tokens[i];
379
341
 
380
342
  if (!Utils.isNull(path.valueObject)) {
381
- var getter = path.valueObject[token];
343
+ let getter = path.valueObject[token];
382
344
 
383
345
  if (!Utils.isNull(getter)) {
384
346
  if (typeof getter === 'function') {
@@ -396,12 +358,12 @@ _defineProperty(Utils, "getPropertyChainPath", function (expression) {
396
358
  return path;
397
359
  });
398
360
 
399
- _defineProperty(Utils, "publishSystemErrorMessage", function (viewId) {
400
- var message = {
361
+ _defineProperty(Utils, "publishSystemErrorMessage", viewId => {
362
+ let message = {
401
363
  messageType: 'ERROR',
402
364
  message: 'A system error has accured. Please try again later'
403
365
  };
404
- var event = new _Event.default(_ApplicationContext.default, viewId, message);
366
+ let event = new _Event.default(_ApplicationContext.default, viewId, message);
405
367
 
406
368
  _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
407
369
  });