@agilemotion/oui-react-js 1.6.3 → 1.6.5
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 +675 -1044
- package/dist/BasicApp.js +7 -27
- package/dist/BasicAppHome.js +27 -101
- package/dist/DynamicJS.js +109 -197
- package/dist/InteractionPortalApp.js +7 -27
- package/dist/InteractionPortalAppHome.js +21 -87
- package/dist/InteractionPortalApp_old.js +60 -122
- package/dist/RestUtils.js +269 -410
- package/dist/TypedValue.js +20 -26
- package/dist/Utils.js +295 -481
- package/dist/WithRouter.js +9 -17
- package/dist/assets/jss/components/authNavbarStyle.js +168 -171
- package/dist/assets/jss/components/buttonStyle.js +2 -5
- package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
- package/dist/assets/jss/components/cardBodyStyle.js +2 -5
- package/dist/assets/jss/components/cardFooterStyle.js +2 -5
- package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
- package/dist/assets/jss/components/cardIconStyle.js +2 -5
- package/dist/assets/jss/components/cardStyle.js +2 -5
- package/dist/assets/jss/components/cardTextStyle.js +2 -5
- package/dist/assets/jss/components/customDropdownStyle.js +171 -173
- package/dist/assets/jss/components/customInputStyle.js +5 -13
- package/dist/assets/jss/components/dropdownStyle.js +71 -74
- package/dist/assets/jss/components/footerStyle.js +14 -23
- package/dist/assets/jss/components/headerLinksStyle.js +52 -53
- package/dist/assets/jss/components/headerStyle.js +68 -73
- package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
- package/dist/assets/jss/components/navbarStyle.js +79 -84
- package/dist/assets/jss/components/sidebarStyle.js +438 -441
- package/dist/assets/jss/components/typographyStyle.js +5 -13
- package/dist/assets/jss/rootStyle.js +85 -151
- package/dist/assets/jss/views/layoutStyle.js +45 -51
- package/dist/assets/jss/views/loginBasicStyle.js +2 -5
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
- package/dist/assets/jss/views/loginStyle.js +80 -87
- package/dist/components/AlertBar.js +20 -75
- package/dist/components/AlertItem.js +13 -49
- package/dist/components/AlertTemplate.js +12 -18
- package/dist/components/Button.js +41 -112
- package/dist/components/Calendar.js +99 -208
- package/dist/components/ConfirmationDialog.js +13 -54
- package/dist/components/DataGrid.js +271 -695
- package/dist/components/DataGridColumn.js +24 -74
- package/dist/components/DataGridFilter.js +107 -245
- package/dist/components/DataGridHeading.js +34 -78
- package/dist/components/Dialog.js +37 -130
- package/dist/components/DocumentTemplateDesigner.js +16 -57
- package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
- package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
- package/dist/components/DocumentViewer.js +25 -65
- package/dist/components/DocumentViewerComponent.js +13 -44
- package/dist/components/ElementResizeHandler.js +148 -200
- package/dist/components/FileThumb.js +15 -56
- package/dist/components/Graph.js +98 -203
- package/dist/components/GraphNode.js +20 -61
- package/dist/components/HtmlPanel.js +38 -105
- package/dist/components/Icon.js +174 -253
- package/dist/components/LoadingIndicator.js +4 -11
- package/dist/components/LottieIcon.js +63 -60
- package/dist/components/PopupView.js +21 -60
- package/dist/components/Portlet.js +18 -60
- package/dist/components/RegularButton.js +34 -42
- package/dist/components/SignaturePanel.js +19 -67
- package/dist/components/SocketManager.js +133 -228
- package/dist/components/StepperTitleBar.js +48 -99
- package/dist/components/TabPage.js +30 -47
- package/dist/components/TabPanel.js +35 -122
- package/dist/components/TableCellContent.js +34 -98
- package/dist/components/TemplateDesigner.js +115 -230
- package/dist/components/TemplateItemEventHandler.js +298 -481
- package/dist/components/TemplateTable.js +117 -218
- package/dist/components/TitleBar.js +15 -53
- package/dist/components/Toolbar.js +44 -110
- package/dist/components/Tooltip.js +37 -56
- package/dist/components/Tree.js +50 -143
- package/dist/components/UseIsVisible.js +5 -25
- package/dist/components/card/Card.js +35 -39
- package/dist/components/card/CardAvatar.js +21 -32
- package/dist/components/card/CardBody.js +29 -36
- package/dist/components/card/CardFooter.js +26 -35
- package/dist/components/card/CardHeader.js +29 -36
- package/dist/components/card/CardIcon.js +15 -29
- package/dist/components/card/CardText.js +15 -29
- package/dist/components/customInput/CustomInput.js +38 -40
- package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
- package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
- package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
- package/dist/components/dashboard/components/Header.js +15 -52
- package/dist/components/dashboard/components/LeftDrawer.js +9 -23
- package/dist/components/dashboard/components/UserIdentity.js +4 -12
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
- package/dist/components/dashboard/components/portal/Timeline.js +3 -8
- package/dist/components/dashboard/components/portal/Workspace.js +4 -13
- package/dist/components/footer/Footer.js +23 -45
- package/dist/components/footer/HomeFooter.js +38 -78
- package/dist/components/form/AddressSearch.js +26 -76
- package/dist/components/form/AutoComplete.js +54 -168
- package/dist/components/form/BaseField.js +59 -189
- package/dist/components/form/Checkbox.js +11 -24
- package/dist/components/form/DatePicker.js +28 -82
- package/dist/components/form/FieldSet.js +84 -300
- package/dist/components/form/Form.js +206 -501
- package/dist/components/form/GridField.js +83 -243
- package/dist/components/form/IconField.js +10 -21
- package/dist/components/form/ImageEditor.js +98 -208
- package/dist/components/form/LabelField.js +13 -28
- package/dist/components/form/LookupField.js +36 -102
- package/dist/components/form/MultiFileUploadField.js +67 -134
- package/dist/components/form/RadioGroup.js +20 -57
- package/dist/components/form/Section.js +33 -118
- package/dist/components/form/SelectItem.js +36 -83
- package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
- package/dist/components/form/Switch.js +11 -24
- package/dist/components/form/TextField.js +19 -55
- package/dist/components/form/TimePicker.js +18 -43
- package/dist/components/form/TransferList.js +76 -200
- package/dist/components/form/UploadField.js +134 -256
- package/dist/components/grid/GridContainer.js +10 -23
- package/dist/components/grid/GridItem.js +10 -23
- package/dist/components/layout/CollapsiblePanel.js +20 -59
- package/dist/components/layout/Layout.js +40 -149
- package/dist/components/layout/View.js +65 -195
- package/dist/components/layout/ViewContainer.js +13 -33
- package/dist/components/layout/ViewPort.js +14 -48
- package/dist/components/layout/Window.js +62 -135
- package/dist/components/layout/WindowViewPort.js +18 -63
- package/dist/components/media/ClosablePanel.js +9 -18
- package/dist/components/media/LobbyWaitingList.js +11 -17
- package/dist/components/media/MediaSoupHelper.js +173 -401
- package/dist/components/media/SideBarContent.js +17 -34
- package/dist/components/media/SocketRequest.js +7 -18
- package/dist/components/media/SocketResponse.js +5 -14
- package/dist/components/media/Timer.js +18 -54
- package/dist/components/media/Toolbar.js +97 -254
- package/dist/components/media/ToolbarButton.js +34 -95
- package/dist/components/media/Toolbar_bck.js +70 -186
- package/dist/components/media/Tracks.js +19 -33
- package/dist/components/media/TrainingRoom.js +121 -374
- package/dist/components/media/Transports.js +17 -29
- package/dist/components/media/VCEventManager.js +45 -116
- package/dist/components/media/VCEventType.js +82 -168
- package/dist/components/media/VCParticipantList.js +16 -51
- package/dist/components/media/VCParticipantListItem.js +44 -141
- package/dist/components/media/VCRoom.js +14 -58
- package/dist/components/media/VCRoomParticipant.js +235 -556
- package/dist/components/media/VCRoomRecorder.js +106 -204
- package/dist/components/media/VCRoomWorkspace.js +248 -584
- package/dist/components/media/Video.js +27 -112
- package/dist/components/media/VideoPlayer.js +23 -91
- package/dist/components/media/chat/ChatRoom.js +143 -361
- package/dist/components/media/chat/ChatRoomItem.js +17 -58
- package/dist/components/media/chat/ChatRoomList.js +15 -60
- package/dist/components/menu/CollapsibleMenu.js +22 -52
- package/dist/components/menu/MenuBars.js +50 -116
- package/dist/components/menu/MenuButton.js +53 -130
- package/dist/components/menu/MenuItem.js +11 -51
- package/dist/components/menu/MenuLink.js +13 -41
- package/dist/components/menu/PopupMenu.js +13 -25
- package/dist/components/navbars/AuthNavbar.js +21 -56
- package/dist/components/navbars/HomeNavbar.js +213 -290
- package/dist/components/navbars/PortalNavbar.js +26 -81
- package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
- package/dist/components/signatures/AlertItem.js +14 -50
- package/dist/components/signatures/Card.js +6 -16
- package/dist/components/signatures/DocumentContainer.js +57 -165
- package/dist/components/signatures/ImageSignatureInput.js +64 -124
- package/dist/components/signatures/MenuButton.js +28 -63
- package/dist/components/signatures/Prompt.js +6 -41
- package/dist/components/signatures/ResponsiveTable.js +181 -370
- package/dist/components/signatures/SearchView.js +34 -112
- package/dist/components/signatures/SignatorySearch.js +11 -44
- package/dist/components/signatures/SignatorySearchForm.js +19 -50
- package/dist/components/signatures/SignatureInput.js +28 -91
- package/dist/components/signatures/SignatureInputProps.js +49 -144
- package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
- package/dist/components/signatures/Toolbar.js +99 -173
- package/dist/components/signatures/ViewUtils.js +207 -313
- package/dist/components/typography/Danger.js +6 -11
- package/dist/components/typography/Info.js +7 -11
- package/dist/components/typography/Link.js +6 -12
- package/dist/event/ActionHandlers.js +48 -87
- package/dist/event/Event.js +21 -25
- package/dist/event/EventListener.js +54 -48
- package/dist/event/EventType.js +18 -40
- package/dist/event/LoadDataActionHandler.js +10 -31
- package/dist/event/Observable.js +204 -396
- package/dist/event/RouteActionHandler.js +119 -171
- package/dist/event/ScriptActionHandler.js +10 -32
- package/dist/event/ServiceCallActionHandler.js +37 -64
- package/dist/event/SignalGraphActionHandler.js +9 -31
- package/dist/js/Addresses.js +23 -42
- package/dist/js/Calendar.js +41 -89
- package/dist/js/DynamicLib.js +11 -23
- package/dist/js/Media.js +80 -174
- package/dist/js/Validators.js +6 -12
- package/dist/js/Windows.js +22 -40
- package/dist/redux/store/ConfigureStore.js +12 -29
- package/dist/redux/store/DashboardStore.js +47 -120
- package/dist/redux/store/History.js +2 -5
- package/dist/redux/store/SecurityStore.js +22 -65
- package/dist/security/TokenManager.js +29 -53
- package/dist/theme-default.js +3 -8
- package/dist/view/Dashboard.js +140 -308
- package/dist/view/PortalDashboard.js +6 -13
- package/dist/view/Settings.js +3 -11
- package/dist/view/Views.js +15 -35
- package/dist/view/security/ChangePasswordBasic.js +41 -147
- package/dist/view/security/ForgotPassword.js +26 -106
- package/dist/view/security/ForgotPasswordBasic.js +22 -96
- package/dist/view/security/Login.js +29 -117
- package/dist/view/security/LoginBasic.js +28 -108
- package/dist/view/security/LoginInteractionPortal.js +28 -106
- package/dist/view/security/ResetPassword.js +25 -110
- package/dist/view/security/ResetPasswordBasic.js +39 -142
- package/dist/view/security/Security.js +14 -26
- package/package.json +26 -21
package/dist/event/Observable.js
CHANGED
|
@@ -1,444 +1,252 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _ActionHandlers = _interopRequireDefault(require("./ActionHandlers"));
|
|
11
|
-
|
|
12
8
|
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
13
|
-
|
|
14
9
|
var _EventListener = _interopRequireDefault(require("./EventListener"));
|
|
15
|
-
|
|
16
10
|
var _ApplicationManager = _interopRequireWildcard(require("../ApplicationManager"));
|
|
17
|
-
|
|
18
11
|
var _DynamicJS = require("../DynamicJS");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
/**
|
|
16
|
+
* Class for objects that register subscriptions and fire events.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
class Observable {
|
|
20
|
+
constructor() {
|
|
21
|
+
if (!Observable.instance) {
|
|
22
|
+
this.subscriptions = [];
|
|
23
|
+
this.applicationContextSubscription = [];
|
|
24
|
+
this.systemGeneratedSubscriptions = [];
|
|
25
|
+
Observable.instance = this;
|
|
26
|
+
}
|
|
27
|
+
return Observable.instance;
|
|
28
|
+
}
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
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); } }
|
|
27
|
-
|
|
28
|
-
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); }); }; }
|
|
29
|
-
|
|
30
|
-
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; } } }; }
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
-
|
|
38
|
-
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); } }
|
|
39
|
-
|
|
40
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
var Observable = /*#__PURE__*/function () {
|
|
45
|
-
function Observable() {
|
|
46
|
-
var _this = this;
|
|
47
|
-
|
|
48
|
-
_classCallCheck(this, Observable);
|
|
49
|
-
|
|
50
|
-
_defineProperty(this, "addSubscription", function (subscription) {
|
|
51
|
-
return _this.subscriptions.push(subscription);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
_defineProperty(this, "addApplicationContextSubscription", function (subscription) {
|
|
55
|
-
return _this.applicationContextSubscription.push(subscription);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
_defineProperty(this, "addSubscriptions", function (eventHandlingConfig, componentHandle, viewId) {
|
|
59
|
-
if (!_Utils.default.isNull(eventHandlingConfig)) {
|
|
60
|
-
var subscriptions = eventHandlingConfig.subscriptions;
|
|
61
|
-
|
|
62
|
-
var _iterator = _createForOfIteratorHelper(subscriptions),
|
|
63
|
-
_step;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a subscription bound by the given event type.
|
|
32
|
+
*
|
|
33
|
+
* @param subscription the subscription to be added
|
|
34
|
+
*/
|
|
35
|
+
addSubscription = subscription => this.subscriptions.push(subscription);
|
|
64
36
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Adds a subscription bound by the given event type.
|
|
39
|
+
*
|
|
40
|
+
* @param subscription the subscription to be added
|
|
41
|
+
*/
|
|
42
|
+
addApplicationContextSubscription = subscription => this.applicationContextSubscription.push(subscription);
|
|
68
43
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Adds a listener bound by the given event type.
|
|
46
|
+
*
|
|
47
|
+
* @param eventHandlingConfig the listener config from back-end
|
|
48
|
+
* @param componentHandle reference to the component owning the event
|
|
49
|
+
* @param viewId the id of the view where the component is rendered
|
|
50
|
+
*/
|
|
51
|
+
addSubscriptions = (eventHandlingConfig, componentHandle, viewId) => {
|
|
52
|
+
if (!_Utils.default.isNull(eventHandlingConfig)) {
|
|
53
|
+
let subscriptions = eventHandlingConfig.subscriptions;
|
|
54
|
+
for (const subscription of subscriptions) {
|
|
55
|
+
this.addSubscription(new _EventListener.default(componentHandle, viewId, !_Utils.default.isNull(subscription.publisher) ? subscription.publisher : componentHandle.api.id, subscription.eventType, subscription.actions));
|
|
76
56
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_defineProperty(this, "addSystemSubscriptions", function (viewId, config) {
|
|
80
|
-
if (!_Utils.default.isNull(config.disabled) && typeof config.disabled === 'string') {
|
|
81
|
-
var matches = config.disabled.match(_DynamicJS.TEMPLATE_REGEX);
|
|
82
|
-
|
|
83
|
-
if (!_Utils.default.isNull(matches)) {
|
|
84
|
-
var _iterator2 = _createForOfIteratorHelper(matches),
|
|
85
|
-
_step2;
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
89
|
-
var match = _step2.value;
|
|
90
|
-
var component = match.replace('@#{', '').replace('}', '');
|
|
57
|
+
}
|
|
58
|
+
};
|
|
91
59
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Adds system generated component subscriptions, such as the ones to re-run disabled and required scriplets after events are fired
|
|
62
|
+
*
|
|
63
|
+
* @param viewId the component viewId
|
|
64
|
+
* @param config the component config
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
addSystemSubscriptions = (viewId, config) => {
|
|
68
|
+
if (!_Utils.default.isNull(config.disabled) && typeof config.disabled === 'string') {
|
|
69
|
+
let matches = config.disabled.match(_DynamicJS.TEMPLATE_REGEX);
|
|
70
|
+
if (!_Utils.default.isNull(matches)) {
|
|
71
|
+
for (const match of matches) {
|
|
72
|
+
let component = match.replace('@#{', '').replace('}', '');
|
|
73
|
+
this.addSystemGeneratedSubscription(viewId, component, config.id);
|
|
99
74
|
}
|
|
100
75
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
try {
|
|
110
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
111
|
-
var _match = _step3.value;
|
|
112
|
-
|
|
113
|
-
var _component = _match.replace('@#{', '').replace('}', '');
|
|
114
|
-
|
|
115
|
-
_this.addSystemGeneratedSubscription(viewId, _component, config.id);
|
|
116
|
-
}
|
|
117
|
-
} catch (err) {
|
|
118
|
-
_iterator3.e(err);
|
|
119
|
-
} finally {
|
|
120
|
-
_iterator3.f();
|
|
121
|
-
}
|
|
76
|
+
}
|
|
77
|
+
if (!_Utils.default.isNull(config.visible) && typeof config.visible === 'string') {
|
|
78
|
+
let matches = config.visible.match(_DynamicJS.TEMPLATE_REGEX);
|
|
79
|
+
if (!_Utils.default.isNull(matches)) {
|
|
80
|
+
for (const match of matches) {
|
|
81
|
+
let component = match.replace('@#{', '').replace('}', '');
|
|
82
|
+
this.addSystemGeneratedSubscription(viewId, component, config.id);
|
|
122
83
|
}
|
|
123
84
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
134
|
-
var _match2 = _step4.value;
|
|
135
|
-
|
|
136
|
-
var _component2 = _match2.replace('@#{', '').replace('}', '');
|
|
137
|
-
|
|
138
|
-
_this.addSystemGeneratedSubscription(viewId, _component2, config.id);
|
|
139
|
-
}
|
|
140
|
-
} catch (err) {
|
|
141
|
-
_iterator4.e(err);
|
|
142
|
-
} finally {
|
|
143
|
-
_iterator4.f();
|
|
144
|
-
}
|
|
85
|
+
}
|
|
86
|
+
if (!_Utils.default.isNull(config.validator) && !_Utils.default.isNull(config.validator.nullable)) {
|
|
87
|
+
let matches = config.validator.nullable.match(_DynamicJS.TEMPLATE_REGEX);
|
|
88
|
+
if (!_Utils.default.isNull(matches)) {
|
|
89
|
+
for (const match of matches) {
|
|
90
|
+
let component = match.replace('@#{', '').replace('}', '');
|
|
91
|
+
this.addSystemGeneratedSubscription(viewId, component, config.id);
|
|
145
92
|
}
|
|
146
93
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
removeApplicationContextSubscriptions = id => {
|
|
97
|
+
let index = this.applicationContextSubscription.findIndex(sub => sub.handler.id === id);
|
|
98
|
+
if (index >= 0) {
|
|
99
|
+
this.applicationContextSubscription.splice(index, 1);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
async emitContextChangeEvent(context, newValues) {
|
|
103
|
+
for (const applicationContextSubscription of this.applicationContextSubscription) {
|
|
104
|
+
if (applicationContextSubscription.handler.api) {
|
|
105
|
+
applicationContextSubscription.handler.api.onContextChange(context, newValues);
|
|
106
|
+
} else {
|
|
107
|
+
applicationContextSubscription.handler.onContextChange(context, newValues);
|
|
156
108
|
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
_defineProperty(this, "processSystemGeneratedSubscriptions", function (componentId) {
|
|
160
|
-
var component = _ApplicationManager.default.resolveComponentApi(componentId);
|
|
161
|
-
|
|
162
|
-
if (!_Utils.default.isNull(component)) {
|
|
163
|
-
var _iterator5 = _createForOfIteratorHelper(_this.systemGeneratedSubscriptions),
|
|
164
|
-
_step5;
|
|
165
|
-
|
|
166
|
-
try {
|
|
167
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
168
|
-
var subscription = _step5.value;
|
|
169
|
-
|
|
170
|
-
if (subscription.publisher === componentId) {
|
|
171
|
-
var _component3 = _ApplicationManager.default.resolveComponentApi(subscription.subscriber);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
172
111
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Fires an event.
|
|
114
|
+
*
|
|
115
|
+
* @param eventType eventType the event type
|
|
116
|
+
* @param be the base event
|
|
117
|
+
* @return false if any subscriptions cancel the event.
|
|
118
|
+
*/
|
|
119
|
+
async fireEvent(eventType, be) {
|
|
120
|
+
// Components could be unloading on the cases where screens are busy closing,
|
|
121
|
+
// meaning the "current" object may be nullified, so we need the null check
|
|
122
|
+
// This happens on async events such as RPC_CALL. If there is no view masking,
|
|
123
|
+
// the REST call may return while the component has been destroyed, and the source's current could be null
|
|
124
|
+
// Proper masking when doing REST CALL should prevent this from happening. The null check provides the sort of defence
|
|
125
|
+
|
|
126
|
+
if (!_Utils.default.isNull(be.getSource()) && !_Utils.default.isNull(be.getSource().api)) {
|
|
127
|
+
let sourceId = be.getSource().api.id;
|
|
128
|
+
let viewId = be.viewId;
|
|
129
|
+
if (!_Utils.default.isNull(sourceId)) {
|
|
130
|
+
for (const subscription of this.subscriptions) {
|
|
131
|
+
if ((subscription.getViewId() === viewId || _ApplicationManager.SYSTEM_EVENT === viewId) && subscription.getPublisher() === sourceId && subscription.getEventType() === eventType) {
|
|
132
|
+
if (!_Utils.default.isNull(subscription.getActions())) {
|
|
133
|
+
for (let j = 0; j < subscription.getActions().length; j++) {
|
|
134
|
+
let action = subscription.getActions()[j];
|
|
135
|
+
_ActionHandlers.default.invoke(action, be, subscription);
|
|
179
136
|
}
|
|
137
|
+
} else if (!_Utils.default.isNull(subscription.getCallback())) {
|
|
138
|
+
subscription.getCallback()(be);
|
|
180
139
|
}
|
|
181
140
|
}
|
|
182
|
-
} catch (err) {
|
|
183
|
-
_iterator5.e(err);
|
|
184
|
-
} finally {
|
|
185
|
-
_iterator5.f();
|
|
186
141
|
}
|
|
142
|
+
this.processSystemGeneratedSubscriptions(sourceId);
|
|
187
143
|
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
var _iterator6 = _createForOfIteratorHelper(_this.systemGeneratedSubscriptions),
|
|
196
|
-
_step6;
|
|
197
|
-
|
|
198
|
-
try {
|
|
199
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
200
|
-
var systemGeneratedSubscription = _step6.value;
|
|
201
|
-
|
|
202
|
-
if (publisher === systemGeneratedSubscription.publisher && subscriber === systemGeneratedSubscription.subscriber && currentViewId === systemGeneratedSubscription.viewId) {
|
|
203
|
-
found = true;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
} catch (err) {
|
|
207
|
-
_iterator6.e(err);
|
|
208
|
-
} finally {
|
|
209
|
-
_iterator6.f();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
getNextIndexToRemove(val, prop, listenerCollection) {
|
|
147
|
+
let counter = 0;
|
|
148
|
+
for (const listener of listenerCollection) {
|
|
149
|
+
if (listener[prop] === val) {
|
|
150
|
+
return counter;
|
|
210
151
|
}
|
|
152
|
+
counter++;
|
|
153
|
+
}
|
|
154
|
+
return -1;
|
|
155
|
+
}
|
|
211
156
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Clears all event subscriptions
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
clearAllEventListeners() {
|
|
162
|
+
this.subscriptions.splice(0, this.subscriptions.length);
|
|
163
|
+
this.systemGeneratedSubscriptions.splice(0, this.systemGeneratedSubscriptions.length);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Clears all event subscriptions for the specified view
|
|
167
|
+
*
|
|
168
|
+
* @param viewId the view
|
|
169
|
+
*/
|
|
170
|
+
clearEventListeners(viewId) {
|
|
171
|
+
let indexes = [];
|
|
172
|
+
let index = -2;
|
|
173
|
+
while ((index = this.getNextIndexToRemove(viewId, 'viewId', this.subscriptions)) !== -1) {
|
|
174
|
+
this.subscriptions.splice(index, 1);
|
|
175
|
+
}
|
|
176
|
+
if (!_Utils.default.isNull(this.systemGeneratedSubscriptions)) {
|
|
177
|
+
index = -2;
|
|
178
|
+
while ((index = this.getNextIndexToRemove(viewId, 'viewId', this.systemGeneratedSubscriptions)) !== -1) {
|
|
179
|
+
this.systemGeneratedSubscriptions.splice(index, 1);
|
|
220
180
|
}
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
if (!Observable.instance) {
|
|
224
|
-
this.subscriptions = [];
|
|
225
|
-
this.applicationContextSubscription = [];
|
|
226
|
-
this.systemGeneratedSubscriptions = [];
|
|
227
|
-
Observable.instance = this;
|
|
228
181
|
}
|
|
229
|
-
|
|
230
|
-
return Observable.instance;
|
|
231
182
|
}
|
|
232
183
|
/**
|
|
233
|
-
*
|
|
184
|
+
* Clears all event subscriptions for the specified view
|
|
234
185
|
*
|
|
235
|
-
* @param
|
|
186
|
+
* @param componentId the view
|
|
236
187
|
*/
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
switch (_context.prev = _context.next) {
|
|
248
|
-
case 0:
|
|
249
|
-
_iterator7 = _createForOfIteratorHelper(this.applicationContextSubscription);
|
|
250
|
-
|
|
251
|
-
try {
|
|
252
|
-
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
253
|
-
applicationContextSubscription = _step7.value;
|
|
254
|
-
|
|
255
|
-
if (applicationContextSubscription.handler.api) {
|
|
256
|
-
applicationContextSubscription.handler.api.onContextChange(context, newValues);
|
|
257
|
-
} else {
|
|
258
|
-
applicationContextSubscription.handler.onContextChange(context, newValues);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
} catch (err) {
|
|
262
|
-
_iterator7.e(err);
|
|
263
|
-
} finally {
|
|
264
|
-
_iterator7.f();
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
case 2:
|
|
268
|
-
case "end":
|
|
269
|
-
return _context.stop();
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}, _callee, this);
|
|
273
|
-
}));
|
|
274
|
-
|
|
275
|
-
function emitContextChangeEvent(_x, _x2) {
|
|
276
|
-
return _emitContextChangeEvent.apply(this, arguments);
|
|
188
|
+
clearComponentEventListeners(componentId) {
|
|
189
|
+
let indexes = [];
|
|
190
|
+
let index = -2;
|
|
191
|
+
while ((index = this.getNextIndexToRemove(componentId, 'subscriber', this.subscriptions)) !== -1) {
|
|
192
|
+
this.subscriptions.splice(index, 1);
|
|
193
|
+
}
|
|
194
|
+
if (!_Utils.default.isNull(this.systemGeneratedSubscriptions)) {
|
|
195
|
+
index = -2;
|
|
196
|
+
while ((index = this.getNextIndexToRemove(componentId, 'subscriber', this.systemGeneratedSubscriptions)) !== -1) {
|
|
197
|
+
this.systemGeneratedSubscriptions.splice(index, 1);
|
|
277
198
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
while (1) {
|
|
297
|
-
switch (_context2.prev = _context2.next) {
|
|
298
|
-
case 0:
|
|
299
|
-
// Components could be unloading on the cases where screens are busy closing,
|
|
300
|
-
// meaning the "current" object may be nullified, so we need the null check
|
|
301
|
-
// This happens on async events such as RPC_CALL. If there is no view masking,
|
|
302
|
-
// the REST call may return while the component has been destroyed, and the source's current could be null
|
|
303
|
-
// Proper masking when doing REST CALL should prevent this from happening. The null check provides the sort of defence
|
|
304
|
-
if (!_Utils.default.isNull(be.getSource()) && !_Utils.default.isNull(be.getSource().api)) {
|
|
305
|
-
sourceId = be.getSource().api.id;
|
|
306
|
-
viewId = be.viewId;
|
|
307
|
-
|
|
308
|
-
if (!_Utils.default.isNull(sourceId)) {
|
|
309
|
-
_iterator8 = _createForOfIteratorHelper(this.subscriptions);
|
|
310
|
-
|
|
311
|
-
try {
|
|
312
|
-
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
313
|
-
subscription = _step8.value;
|
|
314
|
-
|
|
315
|
-
if ((subscription.getViewId() === viewId || _ApplicationManager.SYSTEM_EVENT === viewId) && subscription.getPublisher() === sourceId && subscription.getEventType() === eventType) {
|
|
316
|
-
if (!_Utils.default.isNull(subscription.getActions())) {
|
|
317
|
-
for (j = 0; j < subscription.getActions().length; j++) {
|
|
318
|
-
action = subscription.getActions()[j];
|
|
319
|
-
|
|
320
|
-
_ActionHandlers.default.invoke(action, be, subscription);
|
|
321
|
-
}
|
|
322
|
-
} else if (!_Utils.default.isNull(subscription.getCallback())) {
|
|
323
|
-
subscription.getCallback()(be);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
} catch (err) {
|
|
328
|
-
_iterator8.e(err);
|
|
329
|
-
} finally {
|
|
330
|
-
_iterator8.f();
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
this.processSystemGeneratedSubscriptions(sourceId);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
case 1:
|
|
338
|
-
case "end":
|
|
339
|
-
return _context2.stop();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
*
|
|
203
|
+
* @param componentId
|
|
204
|
+
*
|
|
205
|
+
*/
|
|
206
|
+
processSystemGeneratedSubscriptions = componentId => {
|
|
207
|
+
let component = _ApplicationManager.default.resolveComponentApi(componentId);
|
|
208
|
+
if (!_Utils.default.isNull(component)) {
|
|
209
|
+
for (const subscription of this.systemGeneratedSubscriptions) {
|
|
210
|
+
if (subscription.publisher === componentId) {
|
|
211
|
+
let component = _ApplicationManager.default.resolveComponentApi(subscription.subscriber);
|
|
212
|
+
if (!_Utils.default.isNull(component)) {
|
|
213
|
+
if (!_Utils.default.isNull(subscription.callback)) {
|
|
214
|
+
subscription.callback();
|
|
215
|
+
} else if (!_Utils.default.isNull(component.refresh)) {
|
|
216
|
+
component.refresh();
|
|
340
217
|
}
|
|
341
218
|
}
|
|
342
|
-
}, _callee2, this);
|
|
343
|
-
}));
|
|
344
|
-
|
|
345
|
-
function fireEvent(_x3, _x4) {
|
|
346
|
-
return _fireEvent.apply(this, arguments);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return fireEvent;
|
|
350
|
-
}()
|
|
351
|
-
}, {
|
|
352
|
-
key: "getNextIndexToRemove",
|
|
353
|
-
value: function getNextIndexToRemove(val, prop, listenerCollection) {
|
|
354
|
-
var counter = 0;
|
|
355
|
-
|
|
356
|
-
var _iterator9 = _createForOfIteratorHelper(listenerCollection),
|
|
357
|
-
_step9;
|
|
358
|
-
|
|
359
|
-
try {
|
|
360
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
361
|
-
var listener = _step9.value;
|
|
362
|
-
|
|
363
|
-
if (listener[prop] === val) {
|
|
364
|
-
return counter;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
counter++;
|
|
368
219
|
}
|
|
369
|
-
} catch (err) {
|
|
370
|
-
_iterator9.e(err);
|
|
371
|
-
} finally {
|
|
372
|
-
_iterator9.f();
|
|
373
220
|
}
|
|
374
|
-
|
|
375
|
-
return -1;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Clears all event subscriptions
|
|
379
|
-
*
|
|
380
|
-
*/
|
|
381
|
-
|
|
382
|
-
}, {
|
|
383
|
-
key: "clearAllEventListeners",
|
|
384
|
-
value: function clearAllEventListeners() {
|
|
385
|
-
this.subscriptions.splice(0, this.subscriptions.length);
|
|
386
|
-
this.systemGeneratedSubscriptions.splice(0, this.systemGeneratedSubscriptions.length);
|
|
387
221
|
}
|
|
388
|
-
}
|
|
389
|
-
key: "clearEventListeners",
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Clears all event subscriptions for the specified view
|
|
393
|
-
*
|
|
394
|
-
* @param viewId the view
|
|
395
|
-
*/
|
|
396
|
-
value: function clearEventListeners(viewId) {
|
|
397
|
-
var indexes = [];
|
|
398
|
-
var index = -2;
|
|
399
|
-
|
|
400
|
-
while ((index = this.getNextIndexToRemove(viewId, 'viewId', this.subscriptions)) !== -1) {
|
|
401
|
-
this.subscriptions.splice(index, 1);
|
|
402
|
-
}
|
|
222
|
+
};
|
|
403
223
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* @param viewId
|
|
227
|
+
* @param publisher
|
|
228
|
+
* @param subscriber
|
|
229
|
+
* @param callback
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
232
|
+
addSystemGeneratedSubscription = (viewId, publisher, subscriber, callback) => {
|
|
233
|
+
let found = false;
|
|
234
|
+
let currentViewId = _ApplicationManager.default.getView(viewId).config.id;
|
|
235
|
+
for (const systemGeneratedSubscription of this.systemGeneratedSubscriptions) {
|
|
236
|
+
if (publisher === systemGeneratedSubscription.publisher && subscriber === systemGeneratedSubscription.subscriber && currentViewId === systemGeneratedSubscription.viewId) {
|
|
237
|
+
found = true;
|
|
410
238
|
}
|
|
411
239
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
*/
|
|
420
|
-
value: function clearComponentEventListeners(componentId) {
|
|
421
|
-
var indexes = [];
|
|
422
|
-
var index = -2;
|
|
423
|
-
|
|
424
|
-
while ((index = this.getNextIndexToRemove(componentId, 'subscriber', this.subscriptions)) !== -1) {
|
|
425
|
-
this.subscriptions.splice(index, 1);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
if (!_Utils.default.isNull(this.systemGeneratedSubscriptions)) {
|
|
429
|
-
index = -2;
|
|
430
|
-
|
|
431
|
-
while ((index = this.getNextIndexToRemove(componentId, 'subscriber', this.systemGeneratedSubscriptions)) !== -1) {
|
|
432
|
-
this.systemGeneratedSubscriptions.splice(index, 1);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
240
|
+
if (!found) {
|
|
241
|
+
let subscription = {};
|
|
242
|
+
subscription.publisher = publisher;
|
|
243
|
+
subscription.subscriber = subscriber;
|
|
244
|
+
subscription.callback = callback;
|
|
245
|
+
subscription.viewId = currentViewId;
|
|
246
|
+
this.systemGeneratedSubscriptions.push(subscription);
|
|
435
247
|
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}();
|
|
440
|
-
|
|
441
|
-
var instance = new Observable();
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
const instance = new Observable();
|
|
442
251
|
Object.freeze(instance);
|
|
443
|
-
var _default = instance;
|
|
444
|
-
exports.default = _default;
|
|
252
|
+
var _default = exports.default = instance;
|