@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.
- package/dist/ApplicationContext.js +244 -250
- package/dist/BasicApp.js +53 -97
- package/dist/BasicAppHome.js +86 -122
- package/dist/DynamicJS.js +65 -88
- package/dist/RestUtils.js +284 -315
- package/dist/TypedValue.js +15 -18
- package/dist/Utils.js +224 -262
- package/dist/assets/jss/components/authNavbarStyle.js +162 -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 +1 -1
- 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 +192 -194
- package/dist/assets/jss/components/customInputStyle.js +1 -1
- package/dist/assets/jss/components/dropdownStyle.js +107 -109
- package/dist/assets/jss/components/footerStyle.js +1 -1
- package/dist/assets/jss/components/headerLinksStyle.js +95 -97
- package/dist/assets/jss/components/headerStyle.js +60 -62
- package/dist/assets/jss/components/navbarLinksStyle.js +137 -139
- package/dist/assets/jss/components/navbarStyle.js +71 -73
- package/dist/assets/jss/components/sidebarStyle.js +453 -455
- package/dist/assets/jss/components/typographyStyle.js +1 -1
- package/dist/assets/jss/rootStyle.js +57 -57
- package/dist/assets/jss/views/layoutStyle.js +42 -44
- package/dist/assets/jss/views/loginBasicStyle.js +1 -1
- package/dist/assets/jss/views/loginStyle.js +87 -89
- package/dist/components/AlertBar.js +21 -23
- package/dist/components/AlertItem.js +23 -25
- package/dist/components/AlertTemplate.js +29 -30
- package/dist/components/Button.js +35 -37
- package/dist/components/ConfirmationDialog.js +3 -3
- package/dist/components/DataGrid.js +250 -276
- package/dist/components/DataGridColumn.js +34 -36
- package/dist/components/DataGridFilter.js +92 -94
- package/dist/components/DataGridHeading.js +32 -38
- package/dist/components/DocumentViewer.js +12 -11
- package/dist/components/Graph.js +34 -50
- package/dist/components/GraphNode.js +53 -56
- package/dist/components/HtmlPanel.js +6 -8
- package/dist/components/Icon.js +28 -58
- package/dist/components/LoadingIndicator.js +2 -2
- package/dist/components/PopupView.js +15 -17
- package/dist/components/RegularButton.js +20 -20
- package/dist/components/TabPage.js +23 -25
- package/dist/components/TabPanel.js +34 -34
- package/dist/components/TableCellContent.js +34 -34
- package/dist/components/TitleBar.js +16 -16
- package/dist/components/Toolbar.js +112 -118
- package/dist/components/Tooltip.js +35 -43
- package/dist/components/Tree.js +54 -60
- package/dist/components/card/Card.js +17 -17
- package/dist/components/card/CardAvatar.js +10 -10
- package/dist/components/card/CardBody.js +14 -14
- package/dist/components/card/CardFooter.js +13 -13
- package/dist/components/card/CardHeader.js +14 -14
- package/dist/components/card/CardIcon.js +7 -7
- package/dist/components/card/CardText.js +7 -7
- package/dist/components/customInput/CustomInput.js +17 -17
- package/dist/components/dashboard/BasicApp.js +25 -25
- package/dist/components/dashboard/BasicBusinessApp.js +116 -119
- package/dist/components/dashboard/components/Header.js +11 -11
- package/dist/components/dashboard/components/LeftDrawer.js +3 -3
- package/dist/components/dashboard/components/UserIdentity.js +2 -2
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +85 -127
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +151 -191
- package/dist/components/footer/Footer.js +8 -8
- package/dist/components/footer/HomeFooter.js +34 -66
- package/dist/components/form/BaseField.js +78 -78
- package/dist/components/form/Checkbox.js +8 -10
- package/dist/components/form/DatePicker.js +15 -19
- package/dist/components/form/FieldSet.js +62 -88
- package/dist/components/form/Form.js +317 -318
- package/dist/components/form/GridField.js +81 -86
- package/dist/components/form/LabelField.js +10 -12
- package/dist/components/form/LookupField.js +40 -42
- package/dist/components/form/Section.js +37 -39
- package/dist/components/form/SelectItem.js +35 -39
- package/dist/components/form/TextField.js +18 -22
- package/dist/components/form/TimePicker.js +15 -19
- package/dist/components/form/TransferList.js +83 -91
- package/dist/components/form/UploadField.js +135 -145
- package/dist/components/grid/GridContainer.js +6 -6
- package/dist/components/grid/GridItem.js +6 -6
- package/dist/components/layout/CollapsiblePanel.js +18 -20
- package/dist/components/layout/Layout.js +70 -72
- package/dist/components/layout/View.js +134 -136
- package/dist/components/layout/ViewPort.js +56 -98
- package/dist/components/menu/CollapsibleMenu.js +26 -28
- package/dist/components/menu/MenuBars.js +53 -59
- package/dist/components/menu/MenuButton.js +70 -77
- package/dist/components/menu/MenuItem.js +15 -17
- package/dist/components/menu/MenuLink.js +9 -11
- package/dist/components/menu/PopupMenu.js +12 -16
- package/dist/components/navbars/AuthNavbar.js +12 -12
- package/dist/components/navbars/HomeNavbar.js +175 -222
- package/dist/components/navbars/NavbarLinks.js +45 -46
- package/dist/components/typography/Danger.js +3 -3
- package/dist/components/typography/Info.js +3 -3
- package/dist/components/typography/Link.js +3 -3
- package/dist/event/ActionHandlers.js +43 -57
- package/dist/event/Event.js +13 -16
- package/dist/event/EventListener.js +36 -39
- package/dist/event/EventType.js +1 -5
- package/dist/event/LoadDataActionHandler.js +8 -20
- package/dist/event/Observable.js +162 -198
- package/dist/event/RouteActionHandler.js +76 -88
- package/dist/event/ScriptActionHandler.js +8 -20
- package/dist/event/ServiceCallActionHandler.js +28 -40
- package/dist/event/SignalGraphActionHandler.js +7 -19
- package/dist/js/Addresses.js +15 -27
- package/dist/js/DynamicLib.js +11 -14
- package/dist/js/Validators.js +5 -6
- package/dist/redux/store/ConfigureStore.js +6 -6
- package/dist/redux/store/DashboardStore.js +83 -95
- package/dist/redux/store/History.js +1 -1
- package/dist/redux/store/SecurityStore.js +41 -45
- package/dist/security/TokenManager.js +30 -44
- package/dist/theme-default.js +1 -1
- package/dist/view/Dashboard.js +108 -114
- package/dist/view/Settings.js +2 -4
- package/dist/view/security/ChangePasswordBasic.js +96 -100
- package/dist/view/security/ForgotPassword.js +52 -56
- package/dist/view/security/ForgotPasswordBasic.js +48 -54
- package/dist/view/security/Login.js +58 -62
- package/dist/view/security/LoginBasic.js +50 -54
- package/dist/view/security/ResetPassword.js +58 -62
- package/dist/view/security/ResetPasswordBasic.js +89 -93
- package/dist/view/security/Security.js +12 -12
- package/package.json +1 -1
package/dist/BasicApp.js
CHANGED
|
@@ -33,28 +33,8 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
33
33
|
|
|
34
34
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
|
|
36
|
-
|
|
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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
43
|
-
|
|
44
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
46
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
47
|
-
|
|
48
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
49
|
-
|
|
50
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
-
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
56
|
-
var location = window.location.protocol + "//" + window.location.hostname;
|
|
57
|
-
var agilityTheme = (0, _core.createMuiTheme)({
|
|
36
|
+
const location = window.location.protocol + "//" + window.location.hostname;
|
|
37
|
+
const agilityTheme = (0, _core.createMuiTheme)({
|
|
58
38
|
palette: {
|
|
59
39
|
primary: {
|
|
60
40
|
main: '#015588'
|
|
@@ -68,83 +48,59 @@ var agilityTheme = (0, _core.createMuiTheme)({
|
|
|
68
48
|
}
|
|
69
49
|
});
|
|
70
50
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
51
|
+
class BasicApp extends _react.Component {
|
|
52
|
+
render() {
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, {
|
|
54
|
+
basename: "/"
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_MuiThemeProvider.default, {
|
|
56
|
+
muiTheme: _themeDefault.default
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_ThemeProvider.default, {
|
|
58
|
+
theme: agilityTheme
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Switch, null, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
60
|
+
path: "/",
|
|
61
|
+
exact: true,
|
|
62
|
+
component: this.props.home
|
|
63
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
64
|
+
path: "/home",
|
|
65
|
+
component: this.props.home
|
|
66
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
67
|
+
path: "/login",
|
|
68
|
+
render: props => /*#__PURE__*/_react.default.createElement(_LoginBasic.default, {
|
|
69
|
+
url: location + this.props.authUrl + "/login",
|
|
70
|
+
background: 'rgba(0, 0, 0, 0.65)',
|
|
71
|
+
title: 'Business Agility',
|
|
72
|
+
logo: this.props.logoUrl
|
|
73
|
+
})
|
|
74
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
75
|
+
path: "/forgot-password",
|
|
76
|
+
render: () => /*#__PURE__*/_react.default.createElement(_ForgotPasswordBasic.default, {
|
|
77
|
+
url: location + this.props.authUrl + "/password/forgot",
|
|
78
|
+
background: 'rgba(0, 0, 0, 0.65)',
|
|
79
|
+
title: 'Business Agility',
|
|
80
|
+
logo: this.props.logoUrl
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
83
|
+
path: "/reset-password",
|
|
84
|
+
render: () => /*#__PURE__*/_react.default.createElement(_ResetPasswordBasic.default, {
|
|
85
|
+
url: location + this.props.authUrl + "/password/confirmForgot",
|
|
86
|
+
background: 'rgba(0, 0, 0, 0.65)',
|
|
87
|
+
title: 'Business Agility',
|
|
88
|
+
logo: this.props.logoUrl
|
|
89
|
+
})
|
|
90
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
91
|
+
path: "/change-password",
|
|
92
|
+
render: () => /*#__PURE__*/_react.default.createElement(_ChangePasswordBasic.default, {
|
|
93
|
+
url: location + this.props.authUrl + "/password/challenge",
|
|
94
|
+
background: 'rgba(0, 0, 0, 0.65)',
|
|
95
|
+
title: 'Business Agility',
|
|
96
|
+
logo: this.props.logoUrl
|
|
97
|
+
})
|
|
98
|
+
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
99
|
+
to: "/home"
|
|
100
|
+
})))));
|
|
80
101
|
}
|
|
81
102
|
|
|
82
|
-
|
|
83
|
-
key: "render",
|
|
84
|
-
value: function render() {
|
|
85
|
-
var _this = this;
|
|
86
|
-
|
|
87
|
-
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, {
|
|
88
|
-
basename: "/"
|
|
89
|
-
}, /*#__PURE__*/_react.default.createElement(_MuiThemeProvider.default, {
|
|
90
|
-
muiTheme: _themeDefault.default
|
|
91
|
-
}, /*#__PURE__*/_react.default.createElement(_ThemeProvider.default, {
|
|
92
|
-
theme: agilityTheme
|
|
93
|
-
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Switch, null, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
94
|
-
path: "/",
|
|
95
|
-
exact: true,
|
|
96
|
-
component: this.props.home
|
|
97
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
98
|
-
path: "/home",
|
|
99
|
-
component: this.props.home
|
|
100
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
101
|
-
path: "/login",
|
|
102
|
-
render: function render(props) {
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement(_LoginBasic.default, {
|
|
104
|
-
url: location + _this.props.authUrl + "/login",
|
|
105
|
-
background: 'rgba(0, 0, 0, 0.65)',
|
|
106
|
-
title: 'Business Agility',
|
|
107
|
-
logo: _this.props.logoUrl
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
111
|
-
path: "/forgot-password",
|
|
112
|
-
render: function render() {
|
|
113
|
-
return /*#__PURE__*/_react.default.createElement(_ForgotPasswordBasic.default, {
|
|
114
|
-
url: location + _this.props.authUrl + "/password/forgot",
|
|
115
|
-
background: 'rgba(0, 0, 0, 0.65)',
|
|
116
|
-
title: 'Business Agility',
|
|
117
|
-
logo: _this.props.logoUrl
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
121
|
-
path: "/reset-password",
|
|
122
|
-
render: function render() {
|
|
123
|
-
return /*#__PURE__*/_react.default.createElement(_ResetPasswordBasic.default, {
|
|
124
|
-
url: location + _this.props.authUrl + "/password/confirmForgot",
|
|
125
|
-
background: 'rgba(0, 0, 0, 0.65)',
|
|
126
|
-
title: 'Business Agility',
|
|
127
|
-
logo: _this.props.logoUrl
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
131
|
-
path: "/change-password",
|
|
132
|
-
render: function render() {
|
|
133
|
-
return /*#__PURE__*/_react.default.createElement(_ChangePasswordBasic.default, {
|
|
134
|
-
url: location + _this.props.authUrl + "/password/challenge",
|
|
135
|
-
background: 'rgba(0, 0, 0, 0.65)',
|
|
136
|
-
title: 'Business Agility',
|
|
137
|
-
logo: _this.props.logoUrl
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
141
|
-
to: "/home"
|
|
142
|
-
})))));
|
|
143
|
-
}
|
|
144
|
-
}]);
|
|
145
|
-
|
|
146
|
-
return BasicApp;
|
|
147
|
-
}(_react.Component);
|
|
103
|
+
}
|
|
148
104
|
|
|
149
105
|
var _default = (0, _reactRouterDom.withRouter)(BasicApp);
|
|
150
106
|
|
package/dist/BasicAppHome.js
CHANGED
|
@@ -35,31 +35,11 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
35
35
|
|
|
36
36
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
const location = window.location.protocol + "//" + window.location.hostname;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
45
|
-
|
|
46
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
47
|
-
|
|
48
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
49
|
-
|
|
50
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
51
|
-
|
|
52
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
53
|
-
|
|
54
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
55
|
-
|
|
56
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
57
|
-
|
|
58
|
-
var location = window.location.protocol + "//" + window.location.hostname;
|
|
59
|
-
|
|
60
|
-
var propHandler = function propHandler(state) {
|
|
61
|
-
var isLoading = state.dashboard.isLoading;
|
|
62
|
-
var dashboardSettings = state.dashboard.dashboardSettings;
|
|
40
|
+
const propHandler = state => {
|
|
41
|
+
let isLoading = state.dashboard.isLoading;
|
|
42
|
+
let dashboardSettings = state.dashboard.dashboardSettings;
|
|
63
43
|
return {
|
|
64
44
|
isLoading: isLoading,
|
|
65
45
|
error: state.error,
|
|
@@ -67,133 +47,117 @@ var propHandler = function propHandler(state) {
|
|
|
67
47
|
};
|
|
68
48
|
};
|
|
69
49
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
function BasicAppHome(props) {
|
|
76
|
-
var _this;
|
|
77
|
-
|
|
78
|
-
_classCallCheck(this, BasicAppHome);
|
|
79
|
-
|
|
80
|
-
_this = _super.call(this, props);
|
|
81
|
-
_this.state = {
|
|
50
|
+
class BasicAppHome extends _react.Component {
|
|
51
|
+
constructor(props) {
|
|
52
|
+
super(props);
|
|
53
|
+
this.state = {
|
|
82
54
|
dashboardSettings: null,
|
|
83
55
|
message: "",
|
|
84
56
|
open: false,
|
|
85
57
|
avatarUrl: null,
|
|
86
58
|
tokenRefreshMonitorStarted: false
|
|
87
59
|
};
|
|
88
|
-
return _this;
|
|
89
60
|
}
|
|
90
61
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
value: function componentDidMount() {
|
|
94
|
-
_ApplicationContext.default.setApplicationHistory(this.props.history);
|
|
62
|
+
componentDidMount() {
|
|
63
|
+
_ApplicationContext.default.setApplicationHistory(this.props.history);
|
|
95
64
|
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
key: "componentDidUpdate",
|
|
100
|
-
value: function componentDidUpdate(prevProps) {
|
|
101
|
-
var _this2 = this;
|
|
65
|
+
_ApplicationContext.default.setServiceApiPath(this.props.serviceApiPath);
|
|
102
66
|
|
|
103
|
-
|
|
104
|
-
this.setState({
|
|
105
|
-
dashboardSettings: this.props.dashboardSettings
|
|
106
|
-
});
|
|
67
|
+
_ApplicationContext.default.setUIConfigPath(this.props.uiConfigPath);
|
|
107
68
|
|
|
108
|
-
|
|
109
|
-
_TokenManager.default.startTokenRefreshMonitor(location + this.props.authUrl + "/refresh", this.props.dashboardSettings.userName);
|
|
69
|
+
_ApplicationContext.default.setBaseApiUrl(this.props.baseApiUrl);
|
|
110
70
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
71
|
+
this.props.getDashboardSettings(location + this.props.baseApiUrl + "/ui/setup");
|
|
72
|
+
}
|
|
114
73
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
74
|
+
componentDidUpdate(prevProps) {
|
|
75
|
+
if (JSON.stringify(prevProps.dashboardSettings) !== JSON.stringify(this.props.dashboardSettings) && !this.props.error) {
|
|
76
|
+
this.setState({
|
|
77
|
+
dashboardSettings: this.props.dashboardSettings
|
|
78
|
+
});
|
|
120
79
|
|
|
121
|
-
|
|
122
|
-
|
|
80
|
+
if (!this.state.tokenRefreshMonitorStarted && !_Utils.default.isNull(this.props.dashboardSettings)) {
|
|
81
|
+
_TokenManager.default.startTokenRefreshMonitor(location + this.props.authUrl + "/refresh", this.props.dashboardSettings.userName);
|
|
123
82
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
};
|
|
83
|
+
this.setState({
|
|
84
|
+
tokenRefreshMonitorStarted: true
|
|
85
|
+
});
|
|
129
86
|
|
|
130
|
-
|
|
87
|
+
if (!_Utils.default.isNull(this.props.dashboardSettings.userAvatar)) {
|
|
88
|
+
this.setState({
|
|
89
|
+
avatarUrl: this.props.dashboardSettings.userAvatar.url
|
|
90
|
+
});
|
|
91
|
+
}
|
|
131
92
|
|
|
132
|
-
|
|
93
|
+
let avatarListener = {};
|
|
94
|
+
avatarListener.type = _ApplicationContext.AVATAR_LISTENER_TYPE;
|
|
133
95
|
|
|
96
|
+
avatarListener.handler = avatar => {
|
|
134
97
|
this.setState({
|
|
135
|
-
|
|
98
|
+
avatarUrl: avatar.url
|
|
136
99
|
});
|
|
137
|
-
}
|
|
138
|
-
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
_ApplicationContext.default.addApplicationListener(avatarListener);
|
|
103
|
+
|
|
104
|
+
_ApplicationContext.default.setApplicationThemeColors(this.props.dashboardSettings.systemProfileDto.firstCorporateBrandColor, this.props.dashboardSettings.systemProfileDto.secondCorporateBrandColor);
|
|
139
105
|
|
|
140
|
-
if (prevProps.error !== this.props.error && this.props.error) {
|
|
141
106
|
this.setState({
|
|
142
|
-
|
|
107
|
+
loadingColor: this.props.dashboardSettings.systemProfileDto.firstCorporateBrandColor
|
|
143
108
|
});
|
|
144
109
|
}
|
|
145
110
|
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "logout",
|
|
148
|
-
value: function logout() {
|
|
149
|
-
sessionStorage.removeItem("accessToken");
|
|
150
|
-
sessionStorage.removeItem("refreshToken");
|
|
151
|
-
sessionStorage.removeItem("idToken");
|
|
152
|
-
sessionStorage.removeItem("lastLogin");
|
|
153
111
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
112
|
+
if (prevProps.error !== this.props.error && this.props.error) {
|
|
113
|
+
this.setState({
|
|
114
|
+
message: "A system error has accured"
|
|
115
|
+
});
|
|
157
116
|
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
logout() {
|
|
120
|
+
sessionStorage.removeItem("accessToken");
|
|
121
|
+
sessionStorage.removeItem("refreshToken");
|
|
122
|
+
sessionStorage.removeItem("idToken");
|
|
123
|
+
sessionStorage.removeItem("lastLogin");
|
|
124
|
+
|
|
125
|
+
_ApplicationContext.default.clear();
|
|
126
|
+
|
|
127
|
+
this.props.history.push('/login');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
render() {
|
|
131
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
132
|
+
className: "main w-100 h-100 d-inline-block"
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
+
className: "w-100 h-100"
|
|
135
|
+
}, this.state.dashboardSettings !== null ? /*#__PURE__*/_react.default.createElement(_ThemeProvider.default, {
|
|
136
|
+
theme: (0, _core.createMuiTheme)({
|
|
137
|
+
palette: {
|
|
138
|
+
primary: {
|
|
139
|
+
main: this.state.dashboardSettings.systemProfileDto.firstCorporateBrandColor
|
|
140
|
+
},
|
|
141
|
+
secondary: {
|
|
142
|
+
main: this.state.dashboardSettings.systemProfileDto.secondCorporateBrandColor
|
|
176
143
|
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
}
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_BasicBusinessApp.default, {
|
|
147
|
+
logoutCallBack: () => {
|
|
148
|
+
this.logout();
|
|
149
|
+
},
|
|
150
|
+
settings: this.state.dashboardSettings,
|
|
151
|
+
avatar: !_Utils.default.isNull(this.state.avatarUrl) ? this.state.avatarUrl : null,
|
|
152
|
+
logo: this.state.dashboardSettings.logo,
|
|
153
|
+
appLogoPath: this.props.appLogoPath
|
|
154
|
+
})) : null), /*#__PURE__*/_react.default.createElement(_LoadingIndicator.default, {
|
|
155
|
+
color: this.state.loadingColor
|
|
156
|
+
})));
|
|
157
|
+
}
|
|
191
158
|
|
|
192
|
-
|
|
193
|
-
}(_react.Component);
|
|
159
|
+
}
|
|
194
160
|
|
|
195
|
-
var _default = (0, _reactRouterDom.withRouter)((0, _reactRedux.connect)(propHandler,
|
|
196
|
-
return (0, _redux.bindActionCreators)(_DashboardStore.actionCreators, dispatch);
|
|
197
|
-
})(BasicAppHome));
|
|
161
|
+
var _default = (0, _reactRouterDom.withRouter)((0, _reactRedux.connect)(propHandler, dispatch => (0, _redux.bindActionCreators)(_DashboardStore.actionCreators, dispatch))(BasicAppHome));
|
|
198
162
|
|
|
199
163
|
exports.default = _default;
|
package/dist/DynamicJS.js
CHANGED
|
@@ -19,42 +19,32 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symb
|
|
|
19
19
|
|
|
20
20
|
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); }
|
|
21
21
|
|
|
22
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
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; }
|
|
22
|
+
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
23
|
|
|
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
|
-
|
|
26
|
+
const TEMPLATE_REGEX = new RegExp('[@]{1}([#@]{1}{)(([a-zA-Z0-9_.[\\]]*)+){1}}((\\(([^)]*)\\))*)', 'g');
|
|
33
27
|
exports.TEMPLATE_REGEX = TEMPLATE_REGEX;
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
_classCallCheck(this, DynamicJS);
|
|
40
|
-
|
|
41
|
-
_defineProperty(this, "evaluateExpression", function (expression) {
|
|
29
|
+
class DynamicJS {
|
|
30
|
+
constructor() {
|
|
31
|
+
_defineProperty(this, "evaluateExpression", expression => {
|
|
42
32
|
return _ApplicationContext.default.resolveExpressionValue(expression);
|
|
43
33
|
});
|
|
44
34
|
|
|
45
|
-
_defineProperty(this, "parseScript",
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
_defineProperty(this, "parseScript", (script, componentId, isScriptlet) => {
|
|
36
|
+
let parsedScript = script.replace(/#this/g, '#' + componentId).replace(/isNull/g, 'this.isNull').replace(/\$application/g, _ApplicationContext.APP_VARIABLE).replace(/isEmpty/g, 'this.isEmpty');
|
|
37
|
+
let matches = parsedScript.match(TEMPLATE_REGEX);
|
|
48
38
|
|
|
49
39
|
if (!_Utils.default.isNull(matches)) {
|
|
50
|
-
|
|
40
|
+
let expressions = [];
|
|
51
41
|
|
|
52
42
|
var _iterator = _createForOfIteratorHelper(matches),
|
|
53
43
|
_step;
|
|
54
44
|
|
|
55
45
|
try {
|
|
56
46
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
57
|
-
|
|
47
|
+
const match = _step.value;
|
|
58
48
|
|
|
59
49
|
if (!expressions.includes(match.trim())) {
|
|
60
50
|
expressions.push(match.trim());
|
|
@@ -67,7 +57,7 @@ var DynamicJS = /*#__PURE__*/function () {
|
|
|
67
57
|
}
|
|
68
58
|
|
|
69
59
|
for (var _i = 0, _expressions = expressions; _i < _expressions.length; _i++) {
|
|
70
|
-
|
|
60
|
+
const expression = _expressions[_i];
|
|
71
61
|
var replaceRegex = new RegExp("".concat(expression), 'g');
|
|
72
62
|
parsedScript = parsedScript.replace(replaceRegex, "this.evaluateExpression(\"".concat(expression, "\")"));
|
|
73
63
|
}
|
|
@@ -76,13 +66,9 @@ var DynamicJS = /*#__PURE__*/function () {
|
|
|
76
66
|
return _Utils.default.isNull(isScriptlet) || isScriptlet === true && !parsedScript.trim().startsWith('return') ? "return ".concat(parsedScript) : parsedScript;
|
|
77
67
|
});
|
|
78
68
|
|
|
79
|
-
_defineProperty(this, "executeScript",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var parsedScript = _this.parseScript(scriptCode, componentId, isScriplet);
|
|
84
|
-
|
|
85
|
-
var eventParam = null;
|
|
69
|
+
_defineProperty(this, "executeScript", (name, scriptCode, componentId, isScriplet = true, event) => {
|
|
70
|
+
let parsedScript = this.parseScript(scriptCode, componentId, isScriplet);
|
|
71
|
+
let eventParam = null;
|
|
86
72
|
|
|
87
73
|
if (!_Utils.default.isNull(event)) {
|
|
88
74
|
eventParam = {};
|
|
@@ -90,11 +76,11 @@ var DynamicJS = /*#__PURE__*/function () {
|
|
|
90
76
|
}
|
|
91
77
|
|
|
92
78
|
try {
|
|
93
|
-
|
|
79
|
+
let func = new Function(parsedScript.replace(/\$event/g, JSON.stringify(eventParam)));
|
|
94
80
|
|
|
95
81
|
if (!_Utils.default.isNull(name)) {
|
|
96
82
|
DynamicJS.prototype[name] = func;
|
|
97
|
-
|
|
83
|
+
let result = instance[name]({});
|
|
98
84
|
delete DynamicJS.prototype[name];
|
|
99
85
|
return result;
|
|
100
86
|
}
|
|
@@ -107,19 +93,16 @@ var DynamicJS = /*#__PURE__*/function () {
|
|
|
107
93
|
return null;
|
|
108
94
|
});
|
|
109
95
|
|
|
110
|
-
_defineProperty(this, "executeScriptObject",
|
|
111
|
-
|
|
112
|
-
var valuesMap = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
113
|
-
var event = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
114
|
-
var scriptBody = '';
|
|
96
|
+
_defineProperty(this, "executeScriptObject", (name, script, componentId = null, valuesMap = {}, event = null) => {
|
|
97
|
+
let scriptBody = '';
|
|
115
98
|
|
|
116
99
|
var _iterator2 = _createForOfIteratorHelper(script.lines),
|
|
117
100
|
_step2;
|
|
118
101
|
|
|
119
102
|
try {
|
|
120
103
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
121
|
-
|
|
122
|
-
scriptBody +=
|
|
104
|
+
const line = _step2.value;
|
|
105
|
+
scriptBody += this.parseScriptLine(line, valuesMap);
|
|
123
106
|
}
|
|
124
107
|
} catch (err) {
|
|
125
108
|
_iterator2.e(err);
|
|
@@ -127,7 +110,7 @@ var DynamicJS = /*#__PURE__*/function () {
|
|
|
127
110
|
_iterator2.f();
|
|
128
111
|
}
|
|
129
112
|
|
|
130
|
-
return
|
|
113
|
+
return this.executeScript(name, scriptBody, componentId, false, event);
|
|
131
114
|
});
|
|
132
115
|
|
|
133
116
|
if (!DynamicJS.instance) {
|
|
@@ -137,63 +120,57 @@ var DynamicJS = /*#__PURE__*/function () {
|
|
|
137
120
|
return DynamicJS.instance;
|
|
138
121
|
}
|
|
139
122
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return _Utils.default.isNull(value);
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
key: "isEmpty",
|
|
147
|
-
value: function isEmpty(value) {
|
|
148
|
-
return _Utils.default.isNull(value) || value.toString().trim().length === 0;
|
|
149
|
-
}
|
|
150
|
-
}, {
|
|
151
|
-
key: "parseScriptLine",
|
|
152
|
-
value: function parseScriptLine(line, valuesMap) {
|
|
153
|
-
var parsedLine = line;
|
|
123
|
+
isNull(value) {
|
|
124
|
+
return _Utils.default.isNull(value);
|
|
125
|
+
}
|
|
154
126
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
127
|
+
isEmpty(value) {
|
|
128
|
+
return _Utils.default.isNull(value) || value.toString().trim().length === 0;
|
|
129
|
+
}
|
|
158
130
|
|
|
159
|
-
|
|
160
|
-
|
|
131
|
+
parseScriptLine(line, valuesMap) {
|
|
132
|
+
let parsedLine = line;
|
|
161
133
|
|
|
162
|
-
|
|
163
|
-
|
|
134
|
+
if (!parsedLine.endsWith(";") && !parsedLine.endsWith(":") && !parsedLine.endsWith("{") && !parsedLine.endsWith("}")) {
|
|
135
|
+
parsedLine += ";";
|
|
136
|
+
}
|
|
164
137
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
138
|
+
if (!_Utils.default.isNull(valuesMap)) {
|
|
139
|
+
const properties = Object.getOwnPropertyNames(valuesMap);
|
|
140
|
+
|
|
141
|
+
var _iterator3 = _createForOfIteratorHelper(properties),
|
|
142
|
+
_step3;
|
|
143
|
+
|
|
144
|
+
try {
|
|
145
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
146
|
+
const property = _step3.value;
|
|
147
|
+
var replaceRegex = new RegExp("@{".concat(property, "}"), 'g');
|
|
148
|
+
let propertyValue = valuesMap[property];
|
|
149
|
+
parsedLine = parsedLine.replace(replaceRegex, propertyValue);
|
|
176
150
|
}
|
|
151
|
+
} catch (err) {
|
|
152
|
+
_iterator3.e(err);
|
|
153
|
+
} finally {
|
|
154
|
+
_iterator3.f();
|
|
177
155
|
}
|
|
178
|
-
|
|
179
|
-
return parsedLine;
|
|
180
156
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
157
|
+
|
|
158
|
+
return parsedLine;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* inject and executes a script
|
|
162
|
+
*
|
|
163
|
+
* @param name
|
|
164
|
+
* @param script
|
|
165
|
+
* @param componentId
|
|
166
|
+
* @param valuesMap
|
|
167
|
+
* @param event
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const instance = new DynamicJS();
|
|
197
174
|
Object.freeze(instance);
|
|
198
175
|
var _default = instance;
|
|
199
176
|
exports.default = _default;
|