@agilemotion/oui-react-js 1.3.0 → 1.3.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/ApplicationContext.js +151 -38
- package/dist/BasicApp.js +16 -9
- package/dist/BasicAppHome.js +6 -4
- package/dist/BusinessPortalApp.css +37 -0
- package/dist/BusinessPortalApp.js +115 -0
- package/dist/BusinessPortalAppHome.js +167 -0
- package/dist/RestUtils.js +12 -9
- package/dist/assets/css/black-dashboard-react.css +1 -2
- package/dist/assets/jss/components/footerStyle.js +7 -4
- package/dist/assets/jss/views/loginBasicStyle.js +0 -1
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +76 -0
- package/dist/assets/scss/black-dashboard-react/bootstrap/_reboot.scss +0 -1
- package/dist/components/DocumentView.css +4 -0
- package/dist/components/DocumentViewer.js +93 -37
- package/dist/components/DocumentViewerComponent.js +93 -0
- package/dist/components/ElementResizeHandler.js +232 -0
- package/dist/components/Graph.js +120 -16
- package/dist/components/GraphNode.js +0 -2
- package/dist/components/HtmlPanel.js +45 -4
- package/dist/components/Icon.js +8 -0
- package/dist/components/SignaturePanel.js +118 -0
- package/dist/components/StepperTitleBar.css +85 -0
- package/dist/components/StepperTitleBar.js +190 -0
- package/dist/components/TitleBar.js +1 -1
- package/dist/components/Toolbar.js +6 -3
- package/dist/components/dashboard/{BasicBusinessApp.js → BasicBusinessAppDashboard.js} +17 -16
- package/dist/components/dashboard/BusinessPortalAppDashboard.css +5 -0
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +191 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +23 -12
- package/dist/components/dashboard/components/portal/Timeline.js +17 -0
- package/dist/components/dashboard/components/portal/Workspace.css +25 -0
- package/dist/components/dashboard/components/portal/Workspace.js +48 -0
- package/dist/components/dashboard/components/portal/portal-dashboard.css +25 -0
- package/dist/components/footer/Footer.js +43 -10
- package/dist/components/form/BaseField.js +11 -2
- package/dist/components/form/DatePicker.js +62 -1
- package/dist/components/form/FieldSet.js +1 -1
- package/dist/components/form/Form.js +28 -8
- package/dist/components/form/SelectItem.js +10 -3
- package/dist/components/form/UploadField.js +122 -44
- package/dist/components/layout/Layout.js +30 -15
- package/dist/components/layout/ViewPort.js +3 -2
- package/dist/components/menu/MenuLink.js +7 -0
- package/dist/components/navbars/HomeNavbar.js +0 -10
- package/dist/components/navbars/PortalNavbar.css +75 -0
- package/dist/components/navbars/PortalNavbar.js +138 -0
- package/dist/components/signatures/AlertItem.js +71 -0
- package/dist/components/signatures/Card.js +39 -0
- package/dist/components/signatures/MenuButton.js +108 -0
- package/dist/components/signatures/Prompt.js +78 -0
- package/dist/components/signatures/ResponsiveTable.css +91 -0
- package/dist/components/signatures/ResponsiveTable.js +568 -0
- package/dist/components/signatures/SearchView.js +236 -0
- package/dist/components/signatures/SignatorySearch.js +115 -0
- package/dist/components/signatures/SignatorySearchForm.js +77 -0
- package/dist/components/signatures/SignatureInputProps.js +336 -0
- package/dist/components/signatures/SignatureTemplateDesigner.js +890 -0
- package/dist/components/signatures/Toolbar.js +208 -0
- package/dist/components/signatures/ViewUtils.js +309 -0
- package/dist/components/signatures/widgets.css +126 -0
- package/dist/event/RouteActionHandler.js +1 -1
- package/dist/view/Dashboard.js +17 -13
- package/dist/view/PortalDashboard.js +33 -0
- package/dist/view/security/ChangePasswordBasic.js +1 -0
- package/dist/view/security/ForgotPasswordBasic.js +1 -0
- package/dist/view/security/LoginBasic.js +6 -1
- package/dist/view/security/LoginBusinessPortal.js +267 -0
- package/dist/view/security/ResetPasswordBasic.js +1 -0
- package/package.json +26 -24
- package/dist/assets/img/flogo.png +0 -0
- package/dist/components/SignatureTemplateDesigner.js +0 -168
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
.stepDot,
|
|
2
|
+
.stepDotActive,
|
|
3
|
+
.stepDotVisited,
|
|
4
|
+
.stepDotBox,
|
|
5
|
+
.stepDotBoxActive {
|
|
6
|
+
border-radius: 100px;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
text-align: center;
|
|
9
|
+
font-size: 18px;
|
|
10
|
+
color: #888888;
|
|
11
|
+
border: 1px solid #888888;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.stepDotBox,
|
|
15
|
+
.stepDotBoxActive {
|
|
16
|
+
border: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.stepDotVisited,
|
|
20
|
+
.stepDotActive {
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
border: 1px solid #ffffff;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.stepDotVisited {
|
|
27
|
+
border: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.stepTitle{
|
|
31
|
+
color: #ffffff;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
height: 30px;
|
|
34
|
+
float: right;
|
|
35
|
+
border-top-right-radius: 100px;
|
|
36
|
+
border-bottom-right-radius: 100px;
|
|
37
|
+
padding: 2px 8px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media screen and (min-width:3480px) {
|
|
42
|
+
.stepTitle {
|
|
43
|
+
padding: 2px 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.stepDot,
|
|
48
|
+
.stepDotVisited,
|
|
49
|
+
.stepDotActive {
|
|
50
|
+
float: left;
|
|
51
|
+
width: 30px;
|
|
52
|
+
height: 30px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.stepperLine {
|
|
56
|
+
width: calc(100% - 30px);
|
|
57
|
+
float: left;
|
|
58
|
+
border-top: 1px solid #888888;
|
|
59
|
+
margin: 14px 0 0 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media screen and (min-width:732px) {
|
|
64
|
+
.stepperLine {
|
|
65
|
+
width: calc(100% - 30.3px);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media screen and (min-width:1176px) {
|
|
70
|
+
.stepperLine {
|
|
71
|
+
width: calc(100% - 30.4px);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media screen and (min-width:2200px) {
|
|
76
|
+
.stepperLine {
|
|
77
|
+
width: calc(100% - 30.7px);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media screen and (min-width:7320px) {
|
|
82
|
+
.stepperLine {
|
|
83
|
+
width: calc(100% - 32px);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _Utils = _interopRequireDefault(require("../Utils"));
|
|
11
|
+
|
|
12
|
+
var _ApplicationContext = _interopRequireDefault(require("../ApplicationContext"));
|
|
13
|
+
|
|
14
|
+
var _Observable = _interopRequireDefault(require("../event/Observable"));
|
|
15
|
+
|
|
16
|
+
var _EventType = _interopRequireDefault(require("../event/EventType"));
|
|
17
|
+
|
|
18
|
+
var _core = require("@material-ui/core");
|
|
19
|
+
|
|
20
|
+
require("./StepperTitleBar.css");
|
|
21
|
+
|
|
22
|
+
var _jquery = _interopRequireDefault(require("jquery"));
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
const useStyles = (0, _core.makeStyles)(theme => ({
|
|
39
|
+
theme: {
|
|
40
|
+
backgroundColor: theme.palette.secondary.main
|
|
41
|
+
},
|
|
42
|
+
themeBorder: {
|
|
43
|
+
borderColor: theme.palette.secondary.main
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
const StepperTitleBar = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
48
|
+
const _React$useState = _react.default.useState(null),
|
|
49
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
+
steps = _React$useState2[0],
|
|
51
|
+
setSteps = _React$useState2[1];
|
|
52
|
+
|
|
53
|
+
const _React$useState3 = _react.default.useState(true),
|
|
54
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
55
|
+
initializing = _React$useState4[0],
|
|
56
|
+
setInitializing = _React$useState4[1];
|
|
57
|
+
|
|
58
|
+
const _React$useState5 = _react.default.useState(null),
|
|
59
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
60
|
+
segmentPercentage = _React$useState6[0],
|
|
61
|
+
setSegmentPercentage = _React$useState6[1];
|
|
62
|
+
|
|
63
|
+
const _React$useState7 = _react.default.useState(null),
|
|
64
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
65
|
+
currentIndex = _React$useState8[0],
|
|
66
|
+
setCurrentIndex = _React$useState8[1];
|
|
67
|
+
|
|
68
|
+
let counter = -1;
|
|
69
|
+
let graphicsCounter = -1;
|
|
70
|
+
const classes = useStyles();
|
|
71
|
+
|
|
72
|
+
_react.default.useEffect(() => {
|
|
73
|
+
if (initializing) {
|
|
74
|
+
props.handle.api = api();
|
|
75
|
+
|
|
76
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
77
|
+
|
|
78
|
+
let eventHandlingConfig = _Utils.default.isNull(parsedConfig.eventHandlingConfig) ? {} : parsedConfig.eventHandlingConfig;
|
|
79
|
+
eventHandlingConfig.subscriptions = _Utils.default.isNull(eventHandlingConfig.subscriptions) ? [] : eventHandlingConfig.subscriptions;
|
|
80
|
+
let subscription = {
|
|
81
|
+
publisher: "applicationContext",
|
|
82
|
+
eventType: _EventType.default.APPLICATION_CONTEXT_CHANGE,
|
|
83
|
+
actions: [{
|
|
84
|
+
actionType: "script",
|
|
85
|
+
script: {
|
|
86
|
+
lines: ["if($event.data.name === 'stepperTitle'){", " @#{".concat(props.config.id, "}.show()"), "}"]
|
|
87
|
+
}
|
|
88
|
+
}]
|
|
89
|
+
};
|
|
90
|
+
eventHandlingConfig.subscriptions.push(subscription);
|
|
91
|
+
|
|
92
|
+
_Observable.default.addSubscriptions(eventHandlingConfig, props.handle, props.viewId);
|
|
93
|
+
|
|
94
|
+
props.loadCompleteHandler(props.config.id);
|
|
95
|
+
setInitializing(false);
|
|
96
|
+
(0, _jquery.default)(document).ready(function () {
|
|
97
|
+
recalcLinePosition();
|
|
98
|
+
});
|
|
99
|
+
(0, _jquery.default)(window).resize(function () {
|
|
100
|
+
recalcLinePosition();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
recalcLinePosition();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const recalcLinePosition = () => {
|
|
108
|
+
(0, _jquery.default)("#selectedLineDiv").css({
|
|
109
|
+
'width': (0, _jquery.default)("#step-container-0").width() - ((0, _jquery.default)("#titleDiv").width() + 40) + 'px',
|
|
110
|
+
'position': 'absolute'
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const api = () => {
|
|
115
|
+
return {
|
|
116
|
+
get id() {
|
|
117
|
+
return props.config.id;
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
getChildren: () => {
|
|
121
|
+
return [];
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
show() {
|
|
125
|
+
let steps = _ApplicationContext.default.graphs[0].getTitleStack();
|
|
126
|
+
|
|
127
|
+
setSteps(steps);
|
|
128
|
+
setCurrentIndex(_ApplicationContext.default.graphs[0].getCurrentNodeIndex());
|
|
129
|
+
setSegmentPercentage(100 / steps.length);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
function renderStep(step) {
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ++graphicsCounter > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
137
|
+
className: graphicsCounter === currentIndex ? "".concat(classes.themeBorder, " stepperLine") : 'stepperLine',
|
|
138
|
+
id: graphicsCounter === currentIndex ? 'selectedLineDiv' : 'lineDiv'
|
|
139
|
+
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
+
className: graphicsCounter === currentIndex ? "".concat(classes.theme, " stepDotBoxActive") : 'stepDotBox',
|
|
141
|
+
style: {
|
|
142
|
+
display: "table-cell"
|
|
143
|
+
}
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
+
className: graphicsCounter < currentIndex ? "".concat(classes.theme, " stepDotVisited") : graphicsCounter === currentIndex ? "".concat(classes.theme, " stepDotActive") : 'stepDot'
|
|
146
|
+
}, step.index + 1), graphicsCounter === currentIndex ? /*#__PURE__*/_react.default.createElement("div", {
|
|
147
|
+
className: "stepTitle",
|
|
148
|
+
id: "titleDiv"
|
|
149
|
+
}, step.title) : null));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function render() {
|
|
153
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
+
className: "w-100",
|
|
155
|
+
style: {
|
|
156
|
+
width: "100%"
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement("table", {
|
|
159
|
+
cellPadding: "0",
|
|
160
|
+
border: "0",
|
|
161
|
+
width: "100%",
|
|
162
|
+
style: {
|
|
163
|
+
borderCollapse: "collapse"
|
|
164
|
+
}
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, steps.map(step => /*#__PURE__*/_react.default.createElement("td", {
|
|
166
|
+
width: segmentPercentage + '%',
|
|
167
|
+
align: "right",
|
|
168
|
+
style: {
|
|
169
|
+
whiteSpace: "nowrap",
|
|
170
|
+
paddingTop: '8px',
|
|
171
|
+
maxHeight: '8px'
|
|
172
|
+
},
|
|
173
|
+
id: 'step-container-' + counter++
|
|
174
|
+
}, renderStep(step)))))));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
178
|
+
ref: ref
|
|
179
|
+
}, !_Utils.default.isNull(props.config) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
+
style: {
|
|
181
|
+
fontSize: '24px',
|
|
182
|
+
color: '#202124',
|
|
183
|
+
padding: "16px 0",
|
|
184
|
+
width: "70%"
|
|
185
|
+
}
|
|
186
|
+
}, !_Utils.default.isNull(steps) && !_Utils.default.isNull(segmentPercentage) && !_Utils.default.isNull(currentIndex) ? render() : null) : null);
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
var _default = StepperTitleBar;
|
|
190
|
+
exports.default = _default;
|
|
@@ -56,7 +56,7 @@ const TitleBar = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
56
56
|
actions: [{
|
|
57
57
|
actionType: "script",
|
|
58
58
|
script: {
|
|
59
|
-
lines: ["@#{".concat(props.config.id, "}.title = $event.data.value")]
|
|
59
|
+
lines: ["if($event.data.name === 'title'){", " @#{".concat(props.config.id, "}.title = $event.data.value"), "}"]
|
|
60
60
|
}
|
|
61
61
|
}]
|
|
62
62
|
};
|
|
@@ -270,7 +270,10 @@ const Toolbar = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
270
270
|
className: "row",
|
|
271
271
|
ref: ref,
|
|
272
272
|
style: {
|
|
273
|
-
padding: '0 0 8px 0'
|
|
273
|
+
padding: '0 0 8px 0',
|
|
274
|
+
width: '100%',
|
|
275
|
+
textAlign: _Utils.default.getComponentAttribute(toolbar, 'align', null),
|
|
276
|
+
display: "inline-block"
|
|
274
277
|
}
|
|
275
278
|
}, toolbar.sections.map(section => {
|
|
276
279
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -293,9 +296,9 @@ const Toolbar = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
293
296
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
294
297
|
ref: ref,
|
|
295
298
|
style: {
|
|
296
|
-
padding: _Utils.default.getComponentAttribute(props.config, 'padding',
|
|
299
|
+
padding: _Utils.default.getComponentAttribute(props.config, 'padding', null),
|
|
297
300
|
borderBottom: getBorderBottom(),
|
|
298
|
-
margin: _Utils.default.getComponentAttribute(props.config, 'margin',
|
|
301
|
+
margin: _Utils.default.getComponentAttribute(props.config, 'margin', '0px 32px 0px 32px')
|
|
299
302
|
}
|
|
300
303
|
}, render(props.config));
|
|
301
304
|
});
|
|
@@ -47,7 +47,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
47
47
|
|
|
48
48
|
let ps;
|
|
49
49
|
|
|
50
|
-
const
|
|
50
|
+
const BasicBusinessAppDashboard = props => {
|
|
51
51
|
const _React$useState = _react.default.useState(true),
|
|
52
52
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
53
53
|
navDrawerOpen = _React$useState2[0],
|
|
@@ -193,31 +193,31 @@ const BasicBusinessApp = props => {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
let
|
|
196
|
+
let newRoutes = [];
|
|
197
197
|
let newRoute = {};
|
|
198
198
|
newRoute.name = "Dashboard";
|
|
199
199
|
newRoute.icon = "fa fa-pie-chart";
|
|
200
200
|
newRoute.layout = "/admin";
|
|
201
201
|
newRoute.level = 0;
|
|
202
202
|
newRoute.isParent = true;
|
|
203
|
-
|
|
203
|
+
newRoutes.push(newRoute);
|
|
204
204
|
|
|
205
205
|
if (!_Utils.default.isNull(props.settings.systemProfileDto.modules)) {
|
|
206
206
|
for (let i = 0; i < props.settings.systemProfileDto.modules.length; i++) {
|
|
207
207
|
let module = props.settings.systemProfileDto.modules[i];
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
let route = {};
|
|
209
|
+
route.name = module.label;
|
|
210
|
+
route.icon = module.icon;
|
|
211
|
+
route.layout = "/admin";
|
|
212
|
+
route.level = 0;
|
|
213
213
|
|
|
214
214
|
if (module.menuBar && module.menuBar.menus.length > 0) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
route.collapse = true;
|
|
216
|
+
route.state = module.name + "Collapse";
|
|
217
|
+
route.views = getViews(module.menuBar.menus, 1);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
newRoutes.push(route);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -230,8 +230,8 @@ const BasicBusinessApp = props => {
|
|
|
230
230
|
newRoute.level = 0;
|
|
231
231
|
newRoute.state = "settingsMenuCollapse";
|
|
232
232
|
newRoute.views = getViews(props.settings.settingsMenu.menus, 1);
|
|
233
|
-
|
|
234
|
-
setRoutes(
|
|
233
|
+
newRoutes.push(newRoute);
|
|
234
|
+
setRoutes(newRoutes);
|
|
235
235
|
props.settings.dashboardMenu = createNewMenu.items.length > 0 ? dashboardMenu : null;
|
|
236
236
|
setLoading(false);
|
|
237
237
|
}
|
|
@@ -395,6 +395,7 @@ const BasicBusinessApp = props => {
|
|
|
395
395
|
activeColor: "agility",
|
|
396
396
|
secondaryThemeColor: secondaryThemeColor,
|
|
397
397
|
activeRouteMenu: 'Dashboard',
|
|
398
|
+
className: "sidebar",
|
|
398
399
|
dashboardLauncher: () => {
|
|
399
400
|
launcDashboard();
|
|
400
401
|
},
|
|
@@ -425,9 +426,9 @@ const BasicBusinessApp = props => {
|
|
|
425
426
|
}))), " "));
|
|
426
427
|
};
|
|
427
428
|
|
|
428
|
-
|
|
429
|
+
BasicBusinessAppDashboard.propTypes = {
|
|
429
430
|
children: _propTypes.default.element,
|
|
430
431
|
width: _propTypes.default.number
|
|
431
432
|
};
|
|
432
|
-
var _default =
|
|
433
|
+
var _default = BasicBusinessAppDashboard;
|
|
433
434
|
exports.default = _default;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Utils = _interopRequireDefault(require("../../Utils"));
|
|
13
|
+
|
|
14
|
+
var _PortalNavbar = _interopRequireDefault(require("../navbars/PortalNavbar"));
|
|
15
|
+
|
|
16
|
+
require("./BusinessPortalAppDashboard.css");
|
|
17
|
+
|
|
18
|
+
var _Workspace = _interopRequireDefault(require("./components/portal/Workspace"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
23
|
+
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
+
|
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
33
|
+
|
|
34
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
+
|
|
36
|
+
let ps;
|
|
37
|
+
|
|
38
|
+
const BusinessPortalAppDashboard = props => {
|
|
39
|
+
const _React$useState = _react.default.useState(true),
|
|
40
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
|
+
loading = _React$useState2[0],
|
|
42
|
+
setLoading = _React$useState2[1];
|
|
43
|
+
|
|
44
|
+
const _React$useState3 = _react.default.useState([]),
|
|
45
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
46
|
+
routes = _React$useState4[0],
|
|
47
|
+
setRoutes = _React$useState4[1];
|
|
48
|
+
|
|
49
|
+
const _React$useState5 = _react.default.useState("data:image/png;base64," + props.logo),
|
|
50
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
51
|
+
logo = _React$useState6[0],
|
|
52
|
+
setLogo = _React$useState6[1];
|
|
53
|
+
|
|
54
|
+
const getItems = (items, level) => {
|
|
55
|
+
let newItems = [];
|
|
56
|
+
|
|
57
|
+
for (let i = 0; i < items.length; i++) {
|
|
58
|
+
let createItem = {};
|
|
59
|
+
createItem.name = items[i].attributes.label;
|
|
60
|
+
createItem.mini = "SS";
|
|
61
|
+
createItem.layout = "/admin";
|
|
62
|
+
createItem.item = items[i];
|
|
63
|
+
createItem.level = level;
|
|
64
|
+
|
|
65
|
+
if (!_Utils.default.isNull(items[i].subMenu)) {
|
|
66
|
+
createItem.collapse = true;
|
|
67
|
+
createItem.state = items[i].id + "SubMenuCollapse";
|
|
68
|
+
createItem.views = getItems(items[i].subMenu.items, level + 1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
newItems.push(createItem);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return newItems;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const getViews = (menus, level) => {
|
|
78
|
+
let newViews = [];
|
|
79
|
+
|
|
80
|
+
for (let i = 0; i < menus.length; i++) {
|
|
81
|
+
let createView = {};
|
|
82
|
+
createView.name = menus[i].attributes.label;
|
|
83
|
+
createView.mini = "SS";
|
|
84
|
+
createView.layout = "/admin";
|
|
85
|
+
createView.level = level;
|
|
86
|
+
createView.item = menus[i];
|
|
87
|
+
|
|
88
|
+
if (menus[i].items && menus[i].items.length > 0) {
|
|
89
|
+
createView.collapse = true;
|
|
90
|
+
createView.state = menus[i].id + "Collapse";
|
|
91
|
+
createView.views = getItems(menus[i].items, level + 1);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
newViews.push(createView);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return newViews;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
_react.default.useEffect(() => {
|
|
101
|
+
document.body.classList.add("white-content");
|
|
102
|
+
|
|
103
|
+
if (navigator.platform.indexOf("Win") > -1) {
|
|
104
|
+
ps.destroy();
|
|
105
|
+
document.documentElement.className.add("perfect-scrollbar-off");
|
|
106
|
+
document.documentElement.classList.remove("perfect-scrollbar-on");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
window.removeEventListener("scroll", showNavbarButton); //dispatch(actionCreators.setSecondaryThemeColor(props.settings.systemProfileDto.secondCorporateBrandColor));
|
|
110
|
+
|
|
111
|
+
if (!_Utils.default.isNull(props.settings)) {
|
|
112
|
+
//alert(JSON.stringify(props.settings.menu));
|
|
113
|
+
let newRoutes = [];
|
|
114
|
+
|
|
115
|
+
var _iterator = _createForOfIteratorHelper(props.settings.menu.menus),
|
|
116
|
+
_step;
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
120
|
+
const menu = _step.value;
|
|
121
|
+
let newRoute = {};
|
|
122
|
+
newRoute.name = menu.attributes.label;
|
|
123
|
+
|
|
124
|
+
if (!_Utils.default.isNull(menu.icon)) {
|
|
125
|
+
newRoute.icon = menu.icon;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
newRoute.layout = "/admin";
|
|
129
|
+
newRoute.level = 0;
|
|
130
|
+
newRoute.isParent = true;
|
|
131
|
+
newRoute.item = menu;
|
|
132
|
+
newRoutes.push(newRoute);
|
|
133
|
+
|
|
134
|
+
if (!_Utils.default.isNull(menu.items) && menu.items.length > 0) {
|
|
135
|
+
newRoute.collapse = true;
|
|
136
|
+
newRoute.state = menu.name + "Collapse";
|
|
137
|
+
newRoute.views = getViews(menu.items, 1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
} catch (err) {
|
|
141
|
+
_iterator.e(err);
|
|
142
|
+
} finally {
|
|
143
|
+
_iterator.f();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
setRoutes(newRoutes);
|
|
147
|
+
setLoading(false);
|
|
148
|
+
}
|
|
149
|
+
}, [props.settings]);
|
|
150
|
+
|
|
151
|
+
const handleMiniClick = () => {};
|
|
152
|
+
|
|
153
|
+
const showNavbarButton = () => {
|
|
154
|
+
if (document.documentElement.scrollTop > 50 || document.scrollingElement.scrollTop > 50) {//setOpacity(1);
|
|
155
|
+
} else if (document.documentElement.scrollTop <= 50 || document.scrollingElement.scrollTop <= 50) {//setOpacity(0);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
return loading ? /*#__PURE__*/_react.default.createElement("div", null, "Loading...") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
className: "wrapper",
|
|
161
|
+
style: {
|
|
162
|
+
height: '100%',
|
|
163
|
+
overflow: 'hidden'
|
|
164
|
+
}
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: "row-*-*"
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement(_PortalNavbar.default, {
|
|
168
|
+
logoutCallBack: props.logoutCallBack,
|
|
169
|
+
appLogoPath: props.appLogoPath,
|
|
170
|
+
avatar: props.avatar,
|
|
171
|
+
logo: {
|
|
172
|
+
outterLink: "",
|
|
173
|
+
text: "",
|
|
174
|
+
imgSrc: logo
|
|
175
|
+
}
|
|
176
|
+
}), " "), /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
className: "portal-dashboard-content"
|
|
178
|
+
}, /*#__PURE__*/_react.default.createElement(_Workspace.default, {
|
|
179
|
+
routes: routes,
|
|
180
|
+
heading: "Welcome, " + props.settings.userFirstName,
|
|
181
|
+
activeRouteMenu: 'My Work Items',
|
|
182
|
+
secondaryColor: props.settings.secondaryColor
|
|
183
|
+
}))));
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
BusinessPortalAppDashboard.propTypes = {
|
|
187
|
+
children: _propTypes.default.element,
|
|
188
|
+
width: _propTypes.default.number
|
|
189
|
+
};
|
|
190
|
+
var _default = BusinessPortalAppDashboard;
|
|
191
|
+
exports.default = _default;
|