@agilemotion/oui-react-js 1.6.1 → 1.6.2
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.
- package/dist/ApplicationManager.js +698 -421
- package/dist/BasicApp.js +5 -5
- package/dist/BasicAppHome.js +55 -26
- package/dist/DynamicJS.js +147 -65
- package/dist/InteractionPortalApp.css +1 -1
- package/dist/InteractionPortalApp.js +5 -5
- package/dist/InteractionPortalAppHome.js +57 -22
- package/dist/InteractionPortalApp_old.js +107 -61
- package/dist/RestUtils.js +339 -287
- package/dist/TypedValue.js +18 -15
- package/dist/Utils.js +375 -276
- package/dist/WithRouter.js +6 -6
- package/dist/assets/jss/components/authNavbarStyle.js +166 -164
- package/dist/assets/jss/components/buttonStyle.js +1 -1
- package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
- package/dist/assets/jss/components/cardBodyStyle.js +1 -1
- package/dist/assets/jss/components/cardFooterStyle.js +1 -1
- package/dist/assets/jss/components/cardHeaderStyle.js +13 -13
- package/dist/assets/jss/components/cardIconStyle.js +1 -1
- package/dist/assets/jss/components/cardStyle.js +1 -1
- package/dist/assets/jss/components/cardTextStyle.js +1 -1
- package/dist/assets/jss/components/customDropdownStyle.js +168 -169
- package/dist/assets/jss/components/customInputStyle.js +9 -3
- package/dist/assets/jss/components/dropdownStyle.js +69 -69
- package/dist/assets/jss/components/footerStyle.js +19 -13
- package/dist/assets/jss/components/headerLinksStyle.js +45 -48
- package/dist/assets/jss/components/headerStyle.js +68 -65
- package/dist/assets/jss/components/navbarLinksStyle.js +66 -77
- package/dist/assets/jss/components/navbarStyle.js +79 -76
- package/dist/assets/jss/components/sidebarStyle.js +436 -436
- package/dist/assets/jss/components/typographyStyle.js +9 -3
- package/dist/assets/jss/rootStyle.js +96 -81
- package/dist/assets/jss/views/layoutStyle.js +44 -41
- package/dist/assets/jss/views/loginBasicStyle.js +1 -1
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +1 -1
- package/dist/assets/jss/views/loginStyle.js +82 -77
- package/dist/components/AlertBar.js +50 -17
- package/dist/components/AlertItem.js +35 -12
- package/dist/components/AlertTemplate.js +30 -29
- package/dist/components/Button.js +62 -34
- package/dist/components/Calendar.js +140 -91
- package/dist/components/ConfirmationDialog.js +36 -11
- package/dist/components/DataGrid.js +512 -270
- package/dist/components/DataGridColumn.js +47 -22
- package/dist/components/DataGridFilter.js +186 -105
- package/dist/components/DataGridHeading.js +50 -32
- package/dist/components/Dialog.js +90 -35
- package/dist/components/DocumentTemplateDesigner.js +34 -16
- package/dist/components/DocumentTemplateDesignerComponent.js +124 -48
- package/dist/components/DocumentTemplatePlaceholderDialog.js +52 -30
- package/dist/components/DocumentViewer.js +34 -18
- package/dist/components/DocumentViewerComponent.js +26 -9
- package/dist/components/ElementResizeHandler.js +229 -207
- package/dist/components/FileThumb.js +32 -10
- package/dist/components/Graph.js +153 -85
- package/dist/components/GraphNode.js +58 -38
- package/dist/components/HtmlPanel.js +67 -39
- package/dist/components/Icon.js +206 -166
- package/dist/components/LoadingIndicator.js +3 -3
- package/dist/components/LottieIcon.js +1 -1
- package/dist/components/PopupView.js +39 -19
- package/dist/components/Portlet.js +32 -17
- package/dist/components/RegularButton.js +28 -32
- package/dist/components/SignaturePanel.js +37 -17
- package/dist/components/SocketManager.js +178 -119
- package/dist/components/StepperTitleBar.js +62 -42
- package/dist/components/TabPage.js +30 -25
- package/dist/components/TabPanel.js +86 -33
- package/dist/components/TableCellContent.js +51 -32
- package/dist/components/TemplateDesigner.js +173 -121
- package/dist/components/TemplateItemEventHandler.js +335 -221
- package/dist/components/TemplateTable.js +183 -118
- package/dist/components/TitleBar.js +26 -11
- package/dist/components/Toolbar.js +67 -38
- package/dist/components/Tooltip.js +43 -35
- package/dist/components/Tree.js +85 -44
- package/dist/components/UseIsVisible.js +25 -4
- package/dist/components/card/Card.js +27 -33
- package/dist/components/card/CardAvatar.js +20 -19
- package/dist/components/card/CardBody.js +24 -27
- package/dist/components/card/CardFooter.js +23 -24
- package/dist/components/card/CardHeader.js +24 -27
- package/dist/components/card/CardIcon.js +17 -13
- package/dist/components/card/CardText.js +17 -13
- package/dist/components/customInput/CustomInput.js +22 -36
- package/dist/components/dashboard/{BasicBusinessAppDashboard.js → FoldingSideTabDashboard.js} +111 -63
- package/dist/components/dashboard/SideMenuModuleDashboard.css +60 -0
- package/dist/components/dashboard/SideMenuModuleDashboard.js +423 -0
- package/dist/components/dashboard/TopMenuModuleDashboard.js +138 -0
- package/dist/components/dashboard/components/Header.js +29 -12
- package/dist/components/dashboard/components/LeftDrawer.js +3 -5
- package/dist/components/dashboard/components/UserIdentity.js +2 -2
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +131 -87
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +488 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +64 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +65 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +556 -0
- package/dist/components/dashboard/components/portal/Timeline.js +1 -1
- package/dist/components/dashboard/components/portal/Workspace.js +5 -11
- package/dist/components/footer/Footer.js +31 -24
- package/dist/components/footer/HomeFooter.js +68 -34
- package/dist/components/form/AddressSearch.js +78 -42
- package/dist/components/form/AutoComplete.js +136 -55
- package/dist/components/form/BaseField.js +108 -56
- package/dist/components/form/Checkbox.js +10 -8
- package/dist/components/form/DatePicker.js +47 -25
- package/dist/components/form/FieldSet.js +217 -84
- package/dist/components/form/Form.js +334 -200
- package/dist/components/form/GridField.js +185 -82
- package/dist/components/form/IconField.js +9 -7
- package/dist/components/form/ImageEditor.js +141 -92
- package/dist/components/form/LabelField.js +12 -10
- package/dist/components/form/LookupField.js +54 -32
- package/dist/components/form/MultiFileUploadField.js +101 -67
- package/dist/components/form/RadioGroup.js +33 -16
- package/dist/components/form/Section.js +84 -34
- package/dist/components/form/SelectItem.js +55 -33
- package/dist/components/form/SignatureTemplateDesignerField.js +11 -9
- package/dist/components/form/Switch.js +10 -8
- package/dist/components/form/TextField.js +34 -16
- package/dist/components/form/TimePicker.js +19 -15
- package/dist/components/form/TransferList.js +153 -75
- package/dist/components/form/UploadField.js +183 -128
- package/dist/components/grid/GridContainer.js +12 -8
- package/dist/components/grid/GridItem.js +12 -8
- package/dist/components/layout/CollapsiblePanel.js +44 -18
- package/dist/components/layout/Layout.js +81 -40
- package/dist/components/layout/VC.css +1 -1
- package/dist/components/layout/View.js +136 -62
- package/dist/components/layout/ViewContainer.js +13 -11
- package/dist/components/layout/ViewPort.js +25 -10
- package/dist/components/layout/Window.js +87 -53
- package/dist/components/layout/WindowViewPort.js +38 -16
- package/dist/components/media/ClosablePanel.js +7 -7
- package/dist/components/media/LobbyWaitingList.js +7 -9
- package/dist/components/media/MediaSoupHelper.js +379 -187
- package/dist/components/media/SideBarContent.js +22 -14
- package/dist/components/media/SocketRequest.js +5 -1
- package/dist/components/media/SocketResponse.js +5 -1
- package/dist/components/media/Timer.js +35 -15
- package/dist/components/media/Toolbar.css +5 -0
- package/dist/components/media/Toolbar.js +220 -102
- package/dist/components/media/ToolbarButton.js +82 -33
- package/dist/components/media/Toolbar_bck.js +142 -70
- package/dist/components/media/Tracks.js +31 -28
- package/dist/components/media/TrainingRoom.js +284 -121
- package/dist/components/media/Transports.js +27 -24
- package/dist/components/media/VCEventManager.js +95 -31
- package/dist/components/media/VCEventType.js +5 -1
- package/dist/components/media/VCParticipantList.js +40 -14
- package/dist/components/media/VCParticipantListItem.js +92 -41
- package/dist/components/media/VCRoom.js +29 -11
- package/dist/components/media/VCRoomParticipant.js +488 -242
- package/dist/components/media/VCRoomRecorder.js +236 -175
- package/dist/components/media/VCRoomWorkspace.js +505 -245
- package/dist/components/media/Video.js +89 -25
- package/dist/components/media/VideoPlayer.js +56 -22
- package/dist/components/media/chat/ChatRoom.js +255 -132
- package/dist/components/media/chat/ChatRoomItem.js +35 -14
- package/dist/components/media/chat/ChatRoomList.js +43 -13
- package/dist/components/menu/CollapsibleMenu.js +39 -20
- package/dist/components/menu/MenuBars.js +81 -48
- package/dist/components/menu/MenuButton.js +95 -60
- package/dist/components/menu/MenuItem.js +28 -9
- package/dist/components/menu/MenuLink.js +12 -10
- package/dist/components/menu/PopupMenu.js +16 -12
- package/dist/components/navbars/AuthNavbar.js +27 -18
- package/dist/components/navbars/HomeNavbar.js +243 -194
- package/dist/components/navbars/PortalNavbar.js +50 -26
- package/dist/components/signatures/AgilitySignaturePanel.js +96 -39
- package/dist/components/signatures/AlertItem.js +36 -13
- package/dist/components/signatures/Card.js +4 -4
- package/dist/components/signatures/DocumentContainer.js +141 -57
- package/dist/components/signatures/ImageSignatureInput.js +90 -59
- package/dist/components/signatures/MenuButton.js +53 -33
- package/dist/components/signatures/Prompt.js +26 -5
- package/dist/components/signatures/ResponsiveTable.js +302 -197
- package/dist/components/signatures/SearchView.js +77 -36
- package/dist/components/signatures/SignatorySearch.js +30 -10
- package/dist/components/signatures/SignatorySearchForm.js +35 -18
- package/dist/components/signatures/SignatureInput.js +56 -26
- package/dist/components/signatures/SignatureInputProps.js +107 -55
- package/dist/components/signatures/SignatureTemplateDesigner.js +340 -235
- package/dist/components/signatures/Toolbar.js +135 -94
- package/dist/components/signatures/ViewUtils.js +273 -224
- package/dist/components/typography/Danger.js +3 -5
- package/dist/components/typography/Info.js +3 -5
- package/dist/components/typography/Link.js +3 -5
- package/dist/event/ActionHandlers.js +57 -43
- package/dist/event/Event.js +16 -13
- package/dist/event/EventListener.js +39 -36
- package/dist/event/EventType.js +5 -1
- package/dist/event/LoadDataActionHandler.js +20 -8
- package/dist/event/Observable.js +323 -142
- package/dist/event/RouteActionHandler.js +139 -125
- package/dist/event/ScriptActionHandler.js +20 -8
- package/dist/event/ServiceCallActionHandler.js +51 -39
- package/dist/event/SignalGraphActionHandler.js +19 -7
- package/dist/js/Addresses.js +38 -24
- package/dist/js/Calendar.js +168 -161
- package/dist/js/DynamicLib.js +14 -11
- package/dist/js/Media.js +213 -120
- package/dist/js/Validators.js +6 -5
- package/dist/js/Windows.js +48 -47
- package/dist/redux/store/ConfigureStore.js +17 -9
- package/dist/redux/store/DashboardStore.js +110 -43
- package/dist/redux/store/History.js +1 -1
- package/dist/redux/store/SecurityStore.js +59 -20
- package/dist/security/TokenManager.js +44 -30
- package/dist/theme-default.js +1 -1
- package/dist/view/Dashboard.js +230 -137
- package/dist/view/PortalDashboard.js +4 -4
- package/dist/view/Settings.js +4 -2
- package/dist/view/Views.js +27 -14
- package/dist/view/security/ChangePasswordBasic.js +97 -40
- package/dist/view/security/ForgotPassword.js +59 -22
- package/dist/view/security/ForgotPasswordBasic.js +62 -21
- package/dist/view/security/Login.js +64 -24
- package/dist/view/security/LoginBasic.js +65 -26
- package/dist/view/security/LoginInteractionPortal.js +62 -25
- package/dist/view/security/ResetPassword.js +65 -23
- package/dist/view/security/ResetPasswordBasic.js +91 -37
- package/dist/view/security/Security.js +12 -12
- package/package.json +1 -2
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +0 -115
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +0 -447
- /package/dist/components/dashboard/{BusinessPortalAppDashboard.css → TopMenuModuleDashboard.css} +0 -0
- /package/dist/components/dashboard/components/blackDashboard/sidebar/{Sidebar.css → FoldingTabSidebar.css} +0 -0
package/dist/Utils.js
CHANGED
|
@@ -17,16 +17,38 @@ var _EventType = _interopRequireDefault(require("./event/EventType"));
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
21
|
+
|
|
22
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
23
|
+
|
|
24
|
+
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; } } }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
35
|
+
|
|
36
|
+
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); } }
|
|
37
|
+
|
|
38
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
39
|
+
|
|
20
40
|
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; }
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
var Utils = /*#__PURE__*/function () {
|
|
43
|
+
function Utils() {
|
|
44
|
+
_classCallCheck(this, Utils);
|
|
45
|
+
|
|
46
|
+
_defineProperty(this, "showMessage", function (viewRef, message, type) {
|
|
25
47
|
if (Utils.isNull(message)) {
|
|
26
48
|
message = "";
|
|
27
49
|
}
|
|
28
50
|
|
|
29
|
-
|
|
51
|
+
var messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
|
|
30
52
|
viewRef.setState({
|
|
31
53
|
message: message,
|
|
32
54
|
messageStyle: messageType
|
|
@@ -34,349 +56,391 @@ class Utils {
|
|
|
34
56
|
});
|
|
35
57
|
}
|
|
36
58
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
_createClass(Utils, [{
|
|
60
|
+
key: "saveForm",
|
|
61
|
+
value: function saveForm(viewRef, formRef, url) {
|
|
62
|
+
this.saveForm(viewRef, formRef, url, null, null, null);
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "saveForm",
|
|
66
|
+
value: function saveForm(viewRef, formRef, url, successCallback, errorCallback) {
|
|
67
|
+
this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "autoSetDate",
|
|
71
|
+
value: function autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
|
|
72
|
+
var stateDate = viewRef.state[refDateName];
|
|
73
|
+
var tempDate = stateDate;
|
|
74
|
+
|
|
75
|
+
if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
|
|
76
|
+
viewRef.setState(_objectSpread(_objectSpread({}, viewRef.state), {}, _defineProperty({}, refDateName, newDate)), function () {
|
|
77
|
+
if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
|
|
78
|
+
var autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
79
|
+
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
80
|
+
} else if (Utils.isNull(viewRef.state.id)) {
|
|
81
|
+
var _autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
82
|
+
|
|
83
|
+
formRef.current.setValue(autoFillDateName, _autoFillDate);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
48
86
|
}
|
|
49
87
|
}
|
|
88
|
+
}], [{
|
|
89
|
+
key: "isNull",
|
|
90
|
+
value: function isNull(value) {
|
|
91
|
+
return value === null || typeof value === 'undefined';
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "getInitials",
|
|
95
|
+
value: function getInitials(name) {
|
|
96
|
+
var parts = name.split(' ');
|
|
97
|
+
var initials = '';
|
|
98
|
+
|
|
99
|
+
for (var i = 0; i < parts.length; i++) {
|
|
100
|
+
if (parts[i].length > 0 && parts[i] !== '') {
|
|
101
|
+
initials += parts[i][0];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
50
104
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
105
|
+
return initials;
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "updateModel",
|
|
109
|
+
value: function updateModel(values, model) {
|
|
110
|
+
if (!Utils.isNull(values)) {
|
|
111
|
+
for (var i = 0; i < values.length; i++) {
|
|
112
|
+
var value = values[i];
|
|
113
|
+
model[value.name] = value.value;
|
|
114
|
+
}
|
|
59
115
|
}
|
|
60
116
|
}
|
|
61
|
-
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "joinScript",
|
|
119
|
+
value: function joinScript(lines) {
|
|
120
|
+
var script = '';
|
|
62
121
|
|
|
63
|
-
|
|
64
|
-
|
|
122
|
+
for (var i = 0; i < lines.length; i++) {
|
|
123
|
+
var line = lines[i].trim();
|
|
65
124
|
|
|
66
|
-
|
|
67
|
-
|
|
125
|
+
if (!line.endsWith(';') && !line.endsWith(':')) {
|
|
126
|
+
line += ';';
|
|
127
|
+
}
|
|
68
128
|
|
|
69
|
-
|
|
70
|
-
|
|
129
|
+
line += '\n';
|
|
130
|
+
script += line;
|
|
71
131
|
}
|
|
72
132
|
|
|
73
|
-
|
|
74
|
-
script += line;
|
|
133
|
+
return script;
|
|
75
134
|
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "sleep",
|
|
137
|
+
value: function sleep(milliseconds) {
|
|
138
|
+
var date = Date.now();
|
|
139
|
+
var currentDate = null;
|
|
140
|
+
|
|
141
|
+
do {
|
|
142
|
+
currentDate = Date.now();
|
|
143
|
+
} while (currentDate - date < milliseconds);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "parseConfig",
|
|
147
|
+
value: function parseConfig(config, currentViewId) {
|
|
148
|
+
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
76
149
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
static sleep(milliseconds) {
|
|
81
|
-
const date = Date.now();
|
|
82
|
-
let currentDate = null;
|
|
150
|
+
if (!this.isNull(config) && !this.isNull(config.id)) {
|
|
151
|
+
var configJson = JSON.stringify(config);
|
|
152
|
+
var replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
|
|
83
153
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
154
|
+
if (index !== null) {
|
|
155
|
+
replace = replace.replace(/\[#i]/g, "[".concat(index, "]"));
|
|
156
|
+
}
|
|
88
157
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
let configJson = JSON.stringify(config);
|
|
92
|
-
let replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
|
|
158
|
+
return JSON.parse(replace);
|
|
159
|
+
}
|
|
93
160
|
|
|
94
|
-
|
|
95
|
-
|
|
161
|
+
return config;
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "isFieldRequired",
|
|
165
|
+
value: function isFieldRequired(id, formId) {
|
|
166
|
+
if (!Utils.isStringEmpty(formId)) {
|
|
167
|
+
var fields = Utils.getFields(formId, 'validate');
|
|
168
|
+
|
|
169
|
+
for (var i = 0; i < fields.length; i++) {
|
|
170
|
+
if (fields[i].id === id) {
|
|
171
|
+
return fields[i].required;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
96
174
|
}
|
|
97
175
|
|
|
98
|
-
return
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
key: "isStringEmpty",
|
|
180
|
+
value: function isStringEmpty(val) {
|
|
181
|
+
return typeof val === 'undefined' || val === null || val.trim().length === 0;
|
|
99
182
|
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "getFields",
|
|
185
|
+
value: function getFields(formId, className) {
|
|
186
|
+
var inputFields = [];
|
|
187
|
+
var form = document.getElementById(formId);
|
|
100
188
|
|
|
101
|
-
|
|
102
|
-
|
|
189
|
+
if (!Utils.isNull(form)) {
|
|
190
|
+
var inputDivs = form.getElementsByClassName(className);
|
|
103
191
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
let fields = Utils.getFields(formId, 'validate');
|
|
192
|
+
for (var i = 0; i < inputDivs.length; i++) {
|
|
193
|
+
var inputs = inputDivs[i].getElementsByTagName("input");
|
|
107
194
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
195
|
+
for (var j = 0; j < inputs.length; j++) {
|
|
196
|
+
inputFields.push(inputs[j]);
|
|
197
|
+
}
|
|
111
198
|
}
|
|
112
199
|
}
|
|
113
|
-
}
|
|
114
200
|
|
|
115
|
-
|
|
116
|
-
|
|
201
|
+
return inputFields;
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
key: "validateField",
|
|
205
|
+
value: function validateField(id, required, values, currentValue, validator) {
|
|
206
|
+
var message = !this.isNull(validator) ? validator.errorMessage : null;
|
|
207
|
+
var regex = !this.isNull(validator) ? validator.regex : null;
|
|
208
|
+
var result = {};
|
|
209
|
+
result.valid = true;
|
|
210
|
+
result.message = "";
|
|
211
|
+
var value;
|
|
117
212
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
213
|
+
if (!this.isNull(currentValue)) {
|
|
214
|
+
value = currentValue;
|
|
215
|
+
} else {
|
|
216
|
+
value = JSON.parse(JSON.stringify(values))[id];
|
|
217
|
+
}
|
|
121
218
|
|
|
122
|
-
|
|
123
|
-
let inputFields = [];
|
|
124
|
-
let form = document.getElementById(formId);
|
|
219
|
+
var hasErrors = false;
|
|
125
220
|
|
|
126
|
-
|
|
127
|
-
|
|
221
|
+
if (required && (Utils.isNull(value) || Utils.isStringEmpty(value.toString()))) {
|
|
222
|
+
result.message = !Utils.isNull(message) ? message : "This field is required";
|
|
223
|
+
hasErrors = true;
|
|
224
|
+
} else {
|
|
225
|
+
result.message = "";
|
|
226
|
+
}
|
|
128
227
|
|
|
129
|
-
|
|
130
|
-
|
|
228
|
+
if (!hasErrors && !Utils.isNull(regex) && !Utils.isNull(value)) {
|
|
229
|
+
hasErrors = Utils.isNull(value.toString().match(regex));
|
|
131
230
|
|
|
132
|
-
|
|
133
|
-
|
|
231
|
+
if (hasErrors) {
|
|
232
|
+
result.message = !Utils.isNull(message) ? message : "This field is invalid";
|
|
134
233
|
}
|
|
135
234
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return inputFields;
|
|
139
|
-
}
|
|
140
235
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
let regex = !this.isNull(validator) ? validator.regex : null;
|
|
144
|
-
let result = {};
|
|
145
|
-
result.valid = true;
|
|
146
|
-
result.message = "";
|
|
147
|
-
let value;
|
|
148
|
-
|
|
149
|
-
if (!this.isNull(currentValue)) {
|
|
150
|
-
value = currentValue;
|
|
151
|
-
} else {
|
|
152
|
-
value = JSON.parse(JSON.stringify(values))[id];
|
|
236
|
+
result.valid = !hasErrors;
|
|
237
|
+
return result;
|
|
153
238
|
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "getComponentAttribute",
|
|
241
|
+
value: function getComponentAttribute(field, attribute, defaultValue) {
|
|
242
|
+
if (this.isNull(field.attributes)) {
|
|
243
|
+
return defaultValue;
|
|
244
|
+
}
|
|
154
245
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (required && (Utils.isNull(value) || Utils.isStringEmpty(value.toString()))) {
|
|
158
|
-
result.message = !Utils.isNull(message) ? message : "This field is required";
|
|
159
|
-
hasErrors = true;
|
|
160
|
-
} else {
|
|
161
|
-
result.message = "";
|
|
246
|
+
return this.isNull(field.attributes[attribute]) ? defaultValue : field.attributes[attribute];
|
|
162
247
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
result.message = !Utils.isNull(message) ? message : "This field is invalid";
|
|
248
|
+
}, {
|
|
249
|
+
key: "getComponentStyleAttribute",
|
|
250
|
+
value: function getComponentStyleAttribute(field, attribute, defaultValue) {
|
|
251
|
+
if (this.isNull(field.attributes) || this.isNull(field.attributes.style)) {
|
|
252
|
+
return defaultValue;
|
|
169
253
|
}
|
|
170
|
-
}
|
|
171
254
|
|
|
172
|
-
|
|
173
|
-
return result;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
static getComponentAttribute(field, attribute, defaultValue) {
|
|
177
|
-
if (this.isNull(field.attributes)) {
|
|
178
|
-
return defaultValue;
|
|
255
|
+
return this.isNull(field.attributes.style[attribute]) ? defaultValue : field.attributes.style[attribute];
|
|
179
256
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
257
|
+
}, {
|
|
258
|
+
key: "doGetRequestJson",
|
|
259
|
+
value: function doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
|
|
260
|
+
var request = {};
|
|
261
|
+
request.pageSize = curretRowsPerPage;
|
|
262
|
+
request.currentPage = currentPage;
|
|
263
|
+
request.searchParameters = currentSearchParameters;
|
|
264
|
+
request.paged = typeof paged === 'undefined' || paged === null || paged;
|
|
265
|
+
return JSON.stringify(request);
|
|
187
266
|
}
|
|
267
|
+
}, {
|
|
268
|
+
key: "getFieldGrid",
|
|
269
|
+
value: function getFieldGrid(attributes, fields) {
|
|
270
|
+
var fieldGrid = {};
|
|
271
|
+
var maxColspan = !Utils.isNull(attributes) && !Utils.isNull(attributes.layoutColumns) ? attributes.layoutColumns : 1;
|
|
272
|
+
fieldGrid.maxColPerRow = maxColspan;
|
|
273
|
+
fieldGrid.rows = [];
|
|
274
|
+
var currRow = this.createRow();
|
|
188
275
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
static doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
|
|
193
|
-
var request = {};
|
|
194
|
-
request.pageSize = curretRowsPerPage;
|
|
195
|
-
request.currentPage = currentPage;
|
|
196
|
-
request.searchParameters = currentSearchParameters;
|
|
197
|
-
request.paged = typeof paged === 'undefined' || paged === null || paged;
|
|
198
|
-
return JSON.stringify(request);
|
|
199
|
-
}
|
|
276
|
+
for (var i = 0; i < fields.length; i++) {
|
|
277
|
+
var field = fields[i];
|
|
278
|
+
var colspan = this.getFieldColspan(field);
|
|
200
279
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
fieldGrid.rows = [];
|
|
206
|
-
let currRow = this.createRow();
|
|
280
|
+
if (!this.rowHasSpaceForNewField(currRow, colspan, maxColspan)) {
|
|
281
|
+
this.fillRowWithSpacers(currRow, maxColspan);
|
|
282
|
+
currRow = this.createRow();
|
|
283
|
+
}
|
|
207
284
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
285
|
+
if (currRow.fields.length === 0) {
|
|
286
|
+
fieldGrid.rows.push(currRow);
|
|
287
|
+
}
|
|
211
288
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
currRow = this.createRow();
|
|
289
|
+
currRow.fields.push(field);
|
|
290
|
+
currRow.usedSlots += colspan;
|
|
215
291
|
}
|
|
216
292
|
|
|
217
|
-
|
|
218
|
-
|
|
293
|
+
return fieldGrid;
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "evaluateBooleanExpression",
|
|
297
|
+
value: function evaluateBooleanExpression(expression, id, defaultValue) {
|
|
298
|
+
if (expression === "false" || expression === false) {
|
|
299
|
+
return false;
|
|
300
|
+
} else if (expression === "true" || expression === true) {
|
|
301
|
+
return true;
|
|
302
|
+
} else if (!Utils.isNull(expression)) {
|
|
303
|
+
return _DynamicJS.default.executeScript("".concat(id, "UtilsBoolEval"), expression);
|
|
219
304
|
}
|
|
220
305
|
|
|
221
|
-
|
|
222
|
-
currRow.usedSlots += colspan;
|
|
306
|
+
return !this.isNull(defaultValue) ? defaultValue : false;
|
|
223
307
|
}
|
|
308
|
+
}, {
|
|
309
|
+
key: "getEntityViewTitle",
|
|
310
|
+
value: function getEntityViewTitle(queryParameterState, viewName) {
|
|
311
|
+
if (Utils.isNull(queryParameterState) || Utils.isNull(queryParameterState.selection)) {
|
|
312
|
+
return !Utils.isNull(viewName) ? viewName + " > Add" : "Add";
|
|
313
|
+
}
|
|
224
314
|
|
|
225
|
-
|
|
226
|
-
}
|
|
315
|
+
var props = "";
|
|
227
316
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
} else if (expression === "true" || expression === true) {
|
|
232
|
-
return true;
|
|
233
|
-
} else if (!Utils.isNull(expression)) {
|
|
234
|
-
return _DynamicJS.default.executeScript("".concat(id, "UtilsBoolEval"), expression);
|
|
235
|
-
}
|
|
317
|
+
for (var _len = arguments.length, fields = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
318
|
+
fields[_key - 2] = arguments[_key];
|
|
319
|
+
}
|
|
236
320
|
|
|
237
|
-
|
|
238
|
-
|
|
321
|
+
for (var i = 0; i < fields.length; i++) {
|
|
322
|
+
if (!Utils.isNull(fields[i])) {
|
|
323
|
+
props += fields[i].trim();
|
|
324
|
+
props += " ";
|
|
325
|
+
}
|
|
326
|
+
}
|
|
239
327
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return
|
|
328
|
+
props = props.trim();
|
|
329
|
+
var prefix = Utils.isNull(viewName) ? "" : " > ";
|
|
330
|
+
return (Utils.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
|
|
243
331
|
}
|
|
332
|
+
}, {
|
|
333
|
+
key: "setLegendColor",
|
|
334
|
+
value: function setLegendColor(color) {
|
|
335
|
+
var legends = document.getElementsByClassName("legend");
|
|
244
336
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
for (let i = 0; i < fields.length; i++) {
|
|
248
|
-
if (!Utils.isNull(fields[i])) {
|
|
249
|
-
props += fields[i].trim();
|
|
250
|
-
props += " ";
|
|
337
|
+
for (var i = 0; i < legends.length; i++) {
|
|
338
|
+
legends[i].style.color = color;
|
|
251
339
|
}
|
|
252
340
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
let legends = document.getElementsByClassName("legend");
|
|
261
|
-
|
|
262
|
-
for (let i = 0; i < legends.length; i++) {
|
|
263
|
-
legends[i].style.color = color;
|
|
341
|
+
}, {
|
|
342
|
+
key: "setLegend",
|
|
343
|
+
value: function setLegend(text) {
|
|
344
|
+
if (!Utils.isNull(text)) {
|
|
345
|
+
var legend = document.getElementById("globalLegend");
|
|
346
|
+
legend.innerHTML = text;
|
|
347
|
+
}
|
|
264
348
|
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
349
|
+
}, {
|
|
350
|
+
key: "offsetDate",
|
|
351
|
+
value: function offsetDate(date, yearOffset, monthOffset, dayOffset) {
|
|
352
|
+
var year = date.getFullYear() + yearOffset;
|
|
353
|
+
var day = date.getDate() + dayOffset;
|
|
354
|
+
var month = date.getMonth() + monthOffset;
|
|
355
|
+
return new Date(year, month, day);
|
|
271
356
|
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
let day = date.getDate() + dayOffset;
|
|
285
|
-
let month = date.getMonth() + monthOffset;
|
|
286
|
-
return new Date(year, month, day);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
|
|
290
|
-
let stateDate = viewRef.state[refDateName];
|
|
291
|
-
let tempDate = stateDate;
|
|
292
|
-
|
|
293
|
-
if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
|
|
294
|
-
viewRef.setState({ ...viewRef.state,
|
|
295
|
-
[refDateName]: newDate
|
|
296
|
-
}, () => {
|
|
297
|
-
if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
|
|
298
|
-
let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
299
|
-
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
300
|
-
} else if (Utils.isNull(viewRef.state.id)) {
|
|
301
|
-
let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
302
|
-
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
303
|
-
}
|
|
357
|
+
}, {
|
|
358
|
+
key: "getArgs",
|
|
359
|
+
value: function getArgs(func) {
|
|
360
|
+
// First match everything inside the function argument parens.
|
|
361
|
+
var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1]; // Split the arguments string into an array comma delimited.
|
|
362
|
+
|
|
363
|
+
return args.split(',').map(function (arg) {
|
|
364
|
+
// Ensure no inline comments are parsed and trim the whitespace.
|
|
365
|
+
return arg.replace(/\/\*.*\*\//, '').trim();
|
|
366
|
+
}).filter(function (arg) {
|
|
367
|
+
// Ensure no undefined values are added.
|
|
368
|
+
return arg;
|
|
304
369
|
});
|
|
305
370
|
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
371
|
+
}, {
|
|
372
|
+
key: "mergeObjects",
|
|
373
|
+
value: function mergeObjects(source, target) {
|
|
374
|
+
var properties = Object.getOwnPropertyNames(source);
|
|
375
|
+
|
|
376
|
+
var _iterator = _createForOfIteratorHelper(properties),
|
|
377
|
+
_step;
|
|
378
|
+
|
|
379
|
+
try {
|
|
380
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
381
|
+
var property = _step.value;
|
|
382
|
+
target[property] = source[property];
|
|
383
|
+
}
|
|
384
|
+
} catch (err) {
|
|
385
|
+
_iterator.e(err);
|
|
386
|
+
} finally {
|
|
387
|
+
_iterator.f();
|
|
388
|
+
}
|
|
323
389
|
|
|
324
|
-
|
|
325
|
-
target[property] = source[property];
|
|
390
|
+
return target;
|
|
326
391
|
}
|
|
392
|
+
}]);
|
|
327
393
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
394
|
+
return Utils;
|
|
395
|
+
}();
|
|
332
396
|
|
|
333
397
|
exports.default = Utils;
|
|
334
398
|
|
|
335
399
|
_defineProperty(Utils, "SYSTEM_ERROR_MESSAGE", "A system error has accured. Please contact your system administrator");
|
|
336
400
|
|
|
337
|
-
_defineProperty(Utils, "capitalize", s
|
|
401
|
+
_defineProperty(Utils, "capitalize", function (s) {
|
|
338
402
|
if (typeof s !== 'string') return '';
|
|
339
403
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
340
404
|
});
|
|
341
405
|
|
|
342
|
-
_defineProperty(Utils, "getFieldColspan", field
|
|
406
|
+
_defineProperty(Utils, "getFieldColspan", function (field) {
|
|
343
407
|
return !Utils.isNull(field.attributes) && !Utils.isNull(field.attributes['colspan']) ? parseFloat(field.attributes['colspan']) : 1;
|
|
344
408
|
});
|
|
345
409
|
|
|
346
|
-
_defineProperty(Utils, "createRow", ()
|
|
347
|
-
|
|
410
|
+
_defineProperty(Utils, "createRow", function () {
|
|
411
|
+
var row = {};
|
|
348
412
|
row.fields = [];
|
|
349
413
|
row.usedSlots = 0;
|
|
350
414
|
return row;
|
|
351
415
|
});
|
|
352
416
|
|
|
353
|
-
_defineProperty(Utils, "fillRowWithSpacers", (row, max)
|
|
354
|
-
for (
|
|
355
|
-
|
|
417
|
+
_defineProperty(Utils, "fillRowWithSpacers", function (row, max) {
|
|
418
|
+
for (var i = row.usedSlots; i < max; i++) {
|
|
419
|
+
var field = {};
|
|
356
420
|
field.fieldType = 'LABEL';
|
|
357
421
|
field.id = 'system_col_span_spacer_' + i;
|
|
358
422
|
row.fields.push(field);
|
|
359
423
|
}
|
|
360
424
|
});
|
|
361
425
|
|
|
362
|
-
_defineProperty(Utils, "rowHasSpaceForNewField", (row, colspan, max)
|
|
426
|
+
_defineProperty(Utils, "rowHasSpaceForNewField", function (row, colspan, max) {
|
|
363
427
|
return colspan <= max - row.usedSlots;
|
|
364
428
|
});
|
|
365
429
|
|
|
366
|
-
_defineProperty(Utils, "getPropertyChainPath", expression
|
|
367
|
-
|
|
430
|
+
_defineProperty(Utils, "getPropertyChainPath", function (expression) {
|
|
431
|
+
var path = {};
|
|
368
432
|
|
|
369
433
|
if (!Utils.isNull(expression)) {
|
|
370
|
-
|
|
434
|
+
var tokens = expression.split('.');
|
|
371
435
|
path.property = tokens[tokens.length - 1];
|
|
372
|
-
|
|
436
|
+
var voExpression = expression.substring(0, expression.indexOf('.'));
|
|
373
437
|
path.valueObject = _DynamicJS.default.executeScript("".concat(Math.random(), "_PropertyChainUtilsEval"), voExpression);
|
|
374
438
|
|
|
375
|
-
for (
|
|
376
|
-
|
|
439
|
+
for (var i = 1; i < tokens.length - 1; i++) {
|
|
440
|
+
var token = tokens[i];
|
|
377
441
|
|
|
378
442
|
if (!Utils.isNull(path.valueObject)) {
|
|
379
|
-
|
|
443
|
+
var getter = path.valueObject[token];
|
|
380
444
|
|
|
381
445
|
if (!Utils.isNull(getter)) {
|
|
382
446
|
if (typeof getter === 'function') {
|
|
@@ -394,8 +458,8 @@ _defineProperty(Utils, "getPropertyChainPath", expression => {
|
|
|
394
458
|
return path;
|
|
395
459
|
});
|
|
396
460
|
|
|
397
|
-
_defineProperty(Utils, "mergeStyles", (defaultStyle, config)
|
|
398
|
-
|
|
461
|
+
_defineProperty(Utils, "mergeStyles", function (defaultStyle, config) {
|
|
462
|
+
var configStyle = Utils.getComponentAttribute(config, 'style', null);
|
|
399
463
|
|
|
400
464
|
if (configStyle) {
|
|
401
465
|
return Utils.mergeObjects(configStyle, defaultStyle);
|
|
@@ -404,31 +468,66 @@ _defineProperty(Utils, "mergeStyles", (defaultStyle, config) => {
|
|
|
404
468
|
return defaultStyle;
|
|
405
469
|
});
|
|
406
470
|
|
|
407
|
-
_defineProperty(Utils, "publishErrorMessage",
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
471
|
+
_defineProperty(Utils, "publishErrorMessage", /*#__PURE__*/function () {
|
|
472
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e, viewId) {
|
|
473
|
+
var component,
|
|
474
|
+
messageText,
|
|
475
|
+
data,
|
|
476
|
+
message,
|
|
477
|
+
event,
|
|
478
|
+
_args = arguments;
|
|
479
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
480
|
+
while (1) {
|
|
481
|
+
switch (_context.prev = _context.next) {
|
|
482
|
+
case 0:
|
|
483
|
+
component = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
|
|
484
|
+
|
|
485
|
+
if (!e.json) {
|
|
486
|
+
_context.next = 8;
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
_context.next = 4;
|
|
491
|
+
return e.json();
|
|
492
|
+
|
|
493
|
+
case 4:
|
|
494
|
+
data = _context.sent;
|
|
495
|
+
messageText = data.message;
|
|
496
|
+
_context.next = 9;
|
|
497
|
+
break;
|
|
498
|
+
|
|
499
|
+
case 8:
|
|
500
|
+
messageText = Utils.SYSTEM_ERROR_MESSAGE;
|
|
501
|
+
|
|
502
|
+
case 9:
|
|
503
|
+
message = {
|
|
504
|
+
messageType: 'ERROR',
|
|
505
|
+
message: messageText
|
|
506
|
+
};
|
|
507
|
+
event = new _Event.default(_ApplicationManager.default, viewId, message);
|
|
508
|
+
|
|
509
|
+
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
510
|
+
|
|
511
|
+
if (component !== null) {
|
|
512
|
+
event = new _Event.default(component, viewId, message);
|
|
513
|
+
|
|
514
|
+
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
case 13:
|
|
518
|
+
case "end":
|
|
519
|
+
return _context.stop();
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}, _callee);
|
|
523
|
+
}));
|
|
416
524
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
message: messageText
|
|
525
|
+
return function (_x, _x2) {
|
|
526
|
+
return _ref.apply(this, arguments);
|
|
420
527
|
};
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
424
|
-
|
|
425
|
-
if (component !== null) {
|
|
426
|
-
event = new _Event.default(component, viewId, message);
|
|
427
|
-
|
|
428
|
-
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
429
|
-
}
|
|
430
|
-
});
|
|
528
|
+
}());
|
|
431
529
|
|
|
432
|
-
_defineProperty(Utils, "publishSystemErrorMessage", (viewId
|
|
530
|
+
_defineProperty(Utils, "publishSystemErrorMessage", function (viewId) {
|
|
531
|
+
var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
433
532
|
Utils.publishErrorMessage('A system error has accured. Please try again later', viewId, component);
|
|
434
533
|
});
|