@agilemotion/oui-react-js 1.6.9 → 1.7.1
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 +5 -6
- package/dist/DynamicJS.js +1 -4
- package/dist/RestUtils.js +26 -26
- package/dist/Utils.js +4 -2
- package/dist/components/Button.js +4 -0
- package/dist/components/DataGrid.js +2 -6
- package/dist/components/DocumentTemplateDesigner.js +27 -0
- package/dist/components/DocumentTemplateDesignerComponent.js +9 -2
- package/dist/components/DocumentViewer.js +8 -2
- package/dist/components/FileThumb.js +11 -3
- package/dist/components/HtmlPanel.js +2 -4
- package/dist/components/Icon.js +7 -0
- package/dist/components/SocketManager.js +3 -4
- package/dist/components/TitleBar.js +0 -1
- package/dist/components/Toolbar.js +196 -22
- package/dist/components/UseIsVisible.js +15 -11
- package/dist/components/dashboard/FoldingSideTabDashboard.js +0 -1
- package/dist/components/form/FieldSet.js +288 -237
- package/dist/components/form/LookupField.js +5 -3
- package/dist/components/layout/Layout.js +184 -130
- package/dist/components/media/Toolbar.js +19 -2
- package/dist/components/media/ToolbarButton.js +6 -2
- package/dist/components/media/TrainingRoom.js +17 -3
- package/dist/components/media/VCRoom.css +12 -0
- package/dist/components/media/VCRoomWorkspace.js +3 -3
- package/dist/components/media/chat/ChatRoom.js +4 -10
- package/dist/components/media/chat/ChatRoomWrapper.js +65 -0
- package/dist/components/media/chat/ChatRooms.scss +10 -0
- package/dist/components/menu/MenuItem.js +45 -11
- package/dist/event/Observable.js +15 -25
- package/dist/event/ServiceCallActionHandler.js +2 -2
- package/dist/js/Docs.js +79 -0
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ChatRoom = _interopRequireDefault(require("./ChatRoom"));
|
|
9
|
+
var _Utils = _interopRequireDefault(require("../../../Utils"));
|
|
10
|
+
var _Observable = _interopRequireDefault(require("../../../event/Observable"));
|
|
11
|
+
var _Event = _interopRequireDefault(require("../../../event/Event"));
|
|
12
|
+
var _EventType = _interopRequireDefault(require("../../../event/EventType"));
|
|
13
|
+
var _RestUtils = require("../../../RestUtils");
|
|
14
|
+
var _ApplicationManager = _interopRequireDefault(require("../../../ApplicationManager"));
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const location = window.location.protocol + '//' + window.location.hostname;
|
|
17
|
+
const ChatRoomWrapper = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
18
|
+
const [visible, setVisible] = _react.default.useState(true);
|
|
19
|
+
const [chat, setChat] = _react.default.useState(null);
|
|
20
|
+
_react.default.useEffect(() => {
|
|
21
|
+
props.handle.api = api();
|
|
22
|
+
});
|
|
23
|
+
_react.default.useEffect(() => {
|
|
24
|
+
props.handle.api = api();
|
|
25
|
+
let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
|
|
26
|
+
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
27
|
+
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
28
|
+
let event = new _Event.default(props.handle, props.viewId, null);
|
|
29
|
+
_Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
|
|
30
|
+
}, []);
|
|
31
|
+
const api = () => {
|
|
32
|
+
return {
|
|
33
|
+
get id() {
|
|
34
|
+
return props.config.id;
|
|
35
|
+
},
|
|
36
|
+
loadData: actionConfig => {},
|
|
37
|
+
refresh() {},
|
|
38
|
+
getChildren: () => {
|
|
39
|
+
return [];
|
|
40
|
+
},
|
|
41
|
+
set visible(visible) {
|
|
42
|
+
setVisible(visible);
|
|
43
|
+
},
|
|
44
|
+
set value(value) {
|
|
45
|
+
(0, _RestUtils.sendRequest)(`${location + '/' + _ApplicationManager.default.getContextRoot()}/calendar/api/v1/chat/fetchMeetingChat/${value.id}`, response => {
|
|
46
|
+
if (response && response.id) {
|
|
47
|
+
setChat(response);
|
|
48
|
+
}
|
|
49
|
+
}, e => {
|
|
50
|
+
console.error(e);
|
|
51
|
+
}, true, false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
ref: ref,
|
|
57
|
+
style: {
|
|
58
|
+
display: visible ? 'block' : 'none'
|
|
59
|
+
}
|
|
60
|
+
}, !_Utils.default.isNull(props.config) && chat ? /*#__PURE__*/_react.default.createElement(_ChatRoom.default, {
|
|
61
|
+
selectedChat: chat,
|
|
62
|
+
readOnly: _Utils.default.getComponentAttribute(props.config, 'readOnly', false)
|
|
63
|
+
}) : null);
|
|
64
|
+
}));
|
|
65
|
+
var _default = exports.default = ChatRoomWrapper;
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
color: #525f7f !important;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.view-chat-layout {
|
|
7
|
+
width: 800px !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
.chat-time {
|
|
7
11
|
display: flex !important;
|
|
8
12
|
align-items: center !important;
|
|
@@ -569,3 +573,9 @@
|
|
|
569
573
|
}
|
|
570
574
|
}
|
|
571
575
|
|
|
576
|
+
@media screen and (max-width: 1200px) {
|
|
577
|
+
.view-chat-layout {
|
|
578
|
+
width: 100% !important;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
@@ -13,32 +13,66 @@ var _EventType = _interopRequireDefault(require("../../event/EventType"));
|
|
|
13
13
|
var _Event = _interopRequireDefault(require("../../event/Event"));
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const MenuItem = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
16
|
-
const [
|
|
17
|
-
const [
|
|
16
|
+
const [disabled, setDisabled] = _react.default.useState(false);
|
|
17
|
+
const [visible, setVisible] = _react.default.useState(true);
|
|
18
|
+
const [config, setConfig] = _react.default.useState(null);
|
|
18
19
|
_react.default.useEffect(() => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
if (config) {
|
|
21
|
+
props.handle.api = api();
|
|
22
|
+
_Observable.default.clearComponentEventListeners(props.handle);
|
|
23
|
+
let parsedConfig = _Utils.default.parseConfig(config, props.viewId);
|
|
24
|
+
_Observable.default.addSubscriptions(parsedConfig.eventHandlingConfig, props.handle, props.viewId);
|
|
25
|
+
_Observable.default.addSystemSubscriptions(props.viewId, parsedConfig);
|
|
26
|
+
props.handle.api.refresh();
|
|
24
27
|
}
|
|
28
|
+
}, [config]);
|
|
29
|
+
_react.default.useEffect(() => {
|
|
30
|
+
props.handle.api = api();
|
|
31
|
+
setConfig(props.tableRow ? {
|
|
32
|
+
...props.config,
|
|
33
|
+
id: props.config.id + '_' + props.tableRow.id?.replaceAll('-', '')
|
|
34
|
+
} : props.config);
|
|
35
|
+
return () => {
|
|
36
|
+
_Observable.default.clearComponentEventListeners(props.handle);
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
_react.default.useEffect(() => {
|
|
40
|
+
props.handle.api = api();
|
|
25
41
|
});
|
|
26
42
|
const handleClick = e => {
|
|
27
|
-
let event = new _Event.default(handle, props.viewId);
|
|
43
|
+
let event = new _Event.default(props.handle, props.viewId);
|
|
28
44
|
_Observable.default.fireEvent(_EventType.default.CLICK, event);
|
|
29
45
|
};
|
|
30
46
|
const api = () => {
|
|
31
47
|
return {
|
|
32
48
|
get id() {
|
|
33
|
-
return props.config.id;
|
|
49
|
+
return config ? config.id : props.config.id;
|
|
50
|
+
},
|
|
51
|
+
get tableRow() {
|
|
52
|
+
return props.tableRow;
|
|
53
|
+
},
|
|
54
|
+
set disabled(disabled) {
|
|
55
|
+
setDisabled(disabled);
|
|
56
|
+
},
|
|
57
|
+
set visible(visible) {
|
|
58
|
+
setVisible(visible);
|
|
59
|
+
},
|
|
60
|
+
refresh() {
|
|
61
|
+
let parsedConfig = _Utils.default.parseConfig(config ? config : props.config, props.viewId);
|
|
62
|
+
setDisabled(_Utils.default.evaluateBooleanExpression(parsedConfig.disabled, parsedConfig.id));
|
|
63
|
+
setVisible(_Utils.default.isNull(parsedConfig.visible) || _Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id));
|
|
34
64
|
}
|
|
35
65
|
};
|
|
36
66
|
};
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
67
|
+
return config && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
38
68
|
onClick: e => handleClick(e),
|
|
39
69
|
ref: ref,
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
style: {
|
|
72
|
+
display: visible ? null : 'none'
|
|
73
|
+
},
|
|
40
74
|
rightIcon: props.mode === 'cascaded' && !_Utils.default.isNull(props.menuItems) && props.menuItems.length > 0 ? /*#__PURE__*/_react.default.createElement(_chevronRight.default, null) : null,
|
|
41
75
|
menuItems: props.menuItems
|
|
42
|
-
},
|
|
76
|
+
}, config.attributes['label']);
|
|
43
77
|
});
|
|
44
78
|
var _default = exports.default = MenuItem;
|
package/dist/event/Observable.js
CHANGED
|
@@ -143,16 +143,6 @@ class Observable {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
getNextIndexToRemove(val, prop, listenerCollection) {
|
|
147
|
-
let counter = 0;
|
|
148
|
-
for (const listener of listenerCollection) {
|
|
149
|
-
if (listener[prop] === val) {
|
|
150
|
-
return counter;
|
|
151
|
-
}
|
|
152
|
-
counter++;
|
|
153
|
-
}
|
|
154
|
-
return -1;
|
|
155
|
-
}
|
|
156
146
|
|
|
157
147
|
/**
|
|
158
148
|
* Clears all event subscriptions
|
|
@@ -169,13 +159,12 @@ class Observable {
|
|
|
169
159
|
*/
|
|
170
160
|
clearEventListeners(viewId) {
|
|
171
161
|
let indexes = [];
|
|
172
|
-
let index
|
|
173
|
-
while ((index = this.
|
|
162
|
+
let index;
|
|
163
|
+
while ((index = this.subscriptions.findIndex(s => s.viewId === viewId)) !== -1) {
|
|
174
164
|
this.subscriptions.splice(index, 1);
|
|
175
165
|
}
|
|
176
166
|
if (!_Utils.default.isNull(this.systemGeneratedSubscriptions)) {
|
|
177
|
-
index = -
|
|
178
|
-
while ((index = this.getNextIndexToRemove(viewId, 'viewId', this.systemGeneratedSubscriptions)) !== -1) {
|
|
167
|
+
while ((index = this.systemGeneratedSubscriptions.findIndex(s => s.viewId === viewId)) !== -1) {
|
|
179
168
|
this.systemGeneratedSubscriptions.splice(index, 1);
|
|
180
169
|
}
|
|
181
170
|
}
|
|
@@ -183,18 +172,19 @@ class Observable {
|
|
|
183
172
|
/**
|
|
184
173
|
* Clears all event subscriptions for the specified view
|
|
185
174
|
*
|
|
186
|
-
* @param
|
|
175
|
+
* @param component the view
|
|
187
176
|
*/
|
|
188
|
-
clearComponentEventListeners(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
177
|
+
clearComponentEventListeners(component) {
|
|
178
|
+
if (component && component.api && component.api.id) {
|
|
179
|
+
let index;
|
|
180
|
+
while ((index = this.subscriptions.findIndex(s => s.subscriber === component.api.id)) !== -1) {
|
|
181
|
+
console.log(index + " : ", this.subscriptions[index]);
|
|
182
|
+
this.subscriptions.splice(index, 1);
|
|
183
|
+
}
|
|
184
|
+
if (!_Utils.default.isNull(this.systemGeneratedSubscriptions)) {
|
|
185
|
+
while ((index = this.systemGeneratedSubscriptions.findIndex(s => s.subscriber === component.api.id)) !== -1) {
|
|
186
|
+
this.systemGeneratedSubscriptions.splice(index, 1);
|
|
187
|
+
}
|
|
198
188
|
}
|
|
199
189
|
}
|
|
200
190
|
}
|
|
@@ -24,9 +24,9 @@ class ServiceCallActionHandler {
|
|
|
24
24
|
if (!_Utils.default.isNull(actionConfig.postScript)) {
|
|
25
25
|
try {
|
|
26
26
|
let valuesMap = {};
|
|
27
|
-
valuesMap.response = result
|
|
27
|
+
valuesMap.response = result;
|
|
28
28
|
_DynamicJS.default.executeScriptObject('postScript_' + currentViewId + '_' + handle.api.id, actionConfig.postScript, handle.api.id, valuesMap, {
|
|
29
|
-
data: result
|
|
29
|
+
data: result
|
|
30
30
|
});
|
|
31
31
|
} catch (e) {
|
|
32
32
|
console.error(e);
|
package/dist/js/Docs.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Docs = void 0;
|
|
7
|
+
var _reactPromiseTracker = require("react-promise-tracker");
|
|
8
|
+
var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"));
|
|
9
|
+
var _Event = _interopRequireDefault(require("../event/Event"));
|
|
10
|
+
var _Observable = _interopRequireDefault(require("../event/Observable"));
|
|
11
|
+
var _EventType = _interopRequireDefault(require("../event/EventType"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const status = response => {
|
|
14
|
+
if (response.ok) {
|
|
15
|
+
return Promise.resolve(response);
|
|
16
|
+
} else {
|
|
17
|
+
return Promise.reject({
|
|
18
|
+
code: response.status,
|
|
19
|
+
message: response.statusText
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const json = response => {
|
|
24
|
+
return response.text();
|
|
25
|
+
};
|
|
26
|
+
const location = window.location.protocol + "//" + window.location.hostname;
|
|
27
|
+
class Docs {
|
|
28
|
+
jsonFileToJSFile = async file => {
|
|
29
|
+
const res = await fetch(file.payload);
|
|
30
|
+
const blob = await res.blob();
|
|
31
|
+
return new Promise(resolve => {
|
|
32
|
+
resolve(new File([blob], file.name, {
|
|
33
|
+
type: file.type,
|
|
34
|
+
size: file.size
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
createFormData = data => {
|
|
39
|
+
let formData = new FormData();
|
|
40
|
+
Object.keys(data).forEach(key => {
|
|
41
|
+
console.log("APPENDING : " + key + " = " + data[key]);
|
|
42
|
+
formData.append(key, data[key]);
|
|
43
|
+
});
|
|
44
|
+
return formData;
|
|
45
|
+
};
|
|
46
|
+
cacheFile = async (file, correlationId) => {
|
|
47
|
+
const accessToken = sessionStorage.getItem("accessToken");
|
|
48
|
+
const idToken = sessionStorage.getItem("idToken");
|
|
49
|
+
let data = new FormData();
|
|
50
|
+
let metadata = {
|
|
51
|
+
...file,
|
|
52
|
+
payload: null
|
|
53
|
+
};
|
|
54
|
+
metadata.correlationId = correlationId;
|
|
55
|
+
data.append("metadata", JSON.stringify(metadata));
|
|
56
|
+
data.append("file", await this.jsonFileToJSFile(file));
|
|
57
|
+
let uploadUrl = _ApplicationManager.default.getContextRoot() + "/docs/api/v1/manager/upload/save";
|
|
58
|
+
let fetchConfig = {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: {
|
|
61
|
+
'ContentType': 'application/json',
|
|
62
|
+
'Authorization': 'Bearer ' + accessToken,
|
|
63
|
+
'idToken': idToken
|
|
64
|
+
},
|
|
65
|
+
body: data
|
|
66
|
+
};
|
|
67
|
+
let url = location + uploadUrl;
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
69
|
+
(0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(url), fetchConfig).then(status).then(json).then(data => {
|
|
70
|
+
resolve(data);
|
|
71
|
+
}).catch(e => {
|
|
72
|
+
reject(e);
|
|
73
|
+
}));
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
exports.Docs = Docs;
|
|
78
|
+
const instance = new Docs();
|
|
79
|
+
var _default = exports.default = instance;
|