@reltio/components 1.4.1126 → 1.4.1130
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/cjs/components/InternalLink/InternalLink.d.ts +3 -0
- package/cjs/components/InternalLink/InternalLink.js +39 -0
- package/cjs/components/InternalLink/styles.d.ts +1 -0
- package/cjs/components/InternalLink/styles.js +10 -0
- package/cjs/components/VerticalHeadingsTable/TableCell/TableCell.js +2 -1
- package/cjs/components/VerticalHeadingsTable/TableCellWithDnd/TableCellWithDnd.js +2 -1
- package/cjs/components/VerticalHeadingsTable/TableRow/TableRow.js +1 -1
- package/cjs/components/VerticalHeadingsTable/TableRowWithDnd/TableRowWithDnd.js +1 -1
- package/cjs/components/VerticalHeadingsTable/VerticalHeadingsTable.js +4 -3
- package/cjs/components/attributes/editMode/AttributesFactory/AttributesFactory.js +1 -1
- package/cjs/components/attributes/editMode/ComplexAttribute/ComplexAttribute.d.ts +3 -1
- package/cjs/components/attributes/editMode/ComplexAttribute/ComplexAttribute.js +6 -2
- package/cjs/components/attributes/editMode/NestedAttribute/NestedAttribute.d.ts +1 -0
- package/cjs/components/attributes/editMode/ReferenceAttribute/ReferenceAttribute.d.ts +1 -0
- package/cjs/components/attributes/editMode/ReferenceAttribute/index.d.ts +1 -0
- package/cjs/components/attributes/inline/ReferenceAttribute/ReferenceAttribute.js +2 -1
- package/cjs/components/attributes/inline/ReferenceAttribute/styles.d.ts +1 -1
- package/cjs/components/attributes/inline/ReferenceAttribute/styles.js +0 -4
- package/cjs/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.d.ts +5 -1
- package/cjs/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.js +2 -2
- package/cjs/components/attributes/readMode/AttributesPager/SpecialRenderer.js +1 -1
- package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.d.ts +3 -1
- package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +25 -15
- package/cjs/components/attributes/readMode/NestedAttribute/NestedAttribute.d.ts +1 -0
- package/cjs/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.d.ts +1 -0
- package/cjs/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.js +2 -2
- package/cjs/components/attributes/readMode/ReferenceAttribute/index.d.ts +1 -0
- package/cjs/components/attributes/readMode/ReferenceAttribute/styles.d.ts +1 -1
- package/cjs/components/attributes/readMode/ReferenceAttribute/styles.js +0 -4
- package/cjs/components/attributes/readMode/SpecialAttributes/Tags/Tag.js +2 -2
- package/cjs/hooks/useAPI/API.js +3 -3
- package/cjs/hooks/useAPI/types.d.ts +3 -1
- package/cjs/hooks/useAPI/types.js +1 -0
- package/cjs/hooks/useAPI/useAPI.d.ts +2 -1
- package/cjs/hooks/useAPI/useAPI.js +27 -16
- package/esm/components/InternalLink/InternalLink.d.ts +3 -0
- package/esm/components/InternalLink/InternalLink.js +34 -0
- package/esm/components/InternalLink/styles.d.ts +1 -0
- package/esm/components/InternalLink/styles.js +7 -0
- package/esm/components/VerticalHeadingsTable/TableCell/TableCell.js +2 -1
- package/esm/components/VerticalHeadingsTable/TableCellWithDnd/TableCellWithDnd.js +2 -1
- package/esm/components/VerticalHeadingsTable/TableRow/TableRow.js +1 -1
- package/esm/components/VerticalHeadingsTable/TableRowWithDnd/TableRowWithDnd.js +1 -1
- package/esm/components/VerticalHeadingsTable/VerticalHeadingsTable.js +4 -3
- package/esm/components/attributes/editMode/AttributesFactory/AttributesFactory.js +1 -1
- package/esm/components/attributes/editMode/ComplexAttribute/ComplexAttribute.d.ts +3 -1
- package/esm/components/attributes/editMode/ComplexAttribute/ComplexAttribute.js +6 -2
- package/esm/components/attributes/editMode/NestedAttribute/NestedAttribute.d.ts +1 -0
- package/esm/components/attributes/editMode/ReferenceAttribute/ReferenceAttribute.d.ts +1 -0
- package/esm/components/attributes/editMode/ReferenceAttribute/index.d.ts +1 -0
- package/esm/components/attributes/inline/ReferenceAttribute/ReferenceAttribute.js +2 -1
- package/esm/components/attributes/inline/ReferenceAttribute/styles.d.ts +1 -1
- package/esm/components/attributes/inline/ReferenceAttribute/styles.js +0 -4
- package/esm/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.d.ts +5 -1
- package/esm/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.js +2 -2
- package/esm/components/attributes/readMode/AttributesPager/SpecialRenderer.js +1 -1
- package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.d.ts +3 -1
- package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +26 -16
- package/esm/components/attributes/readMode/NestedAttribute/NestedAttribute.d.ts +1 -0
- package/esm/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.d.ts +1 -0
- package/esm/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.js +2 -2
- package/esm/components/attributes/readMode/ReferenceAttribute/index.d.ts +1 -0
- package/esm/components/attributes/readMode/ReferenceAttribute/styles.d.ts +1 -1
- package/esm/components/attributes/readMode/ReferenceAttribute/styles.js +0 -4
- package/esm/components/attributes/readMode/SpecialAttributes/Tags/Tag.js +2 -2
- package/esm/hooks/useAPI/API.js +3 -3
- package/esm/hooks/useAPI/types.d.ts +3 -1
- package/esm/hooks/useAPI/types.js +1 -0
- package/esm/hooks/useAPI/useAPI.d.ts +2 -1
- package/esm/hooks/useAPI/useAPI.js +29 -18
- package/package.json +4 -3
|
@@ -9,23 +9,23 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { useContext, useEffect, useState } from 'react';
|
|
12
|
+
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
13
13
|
import { useDispatch, useSelector } from 'react-redux';
|
|
14
14
|
import mdmModule, { ui } from '@reltio/mdm-module';
|
|
15
|
-
import { initializeWebWorker } from '@reltio/mdm-sdk';
|
|
15
|
+
import { initializeWebWorker, isEmptyValue } from '@reltio/mdm-sdk';
|
|
16
16
|
import { useWorkflowCheckPermission } from '../../components/workflow';
|
|
17
17
|
import { SandboxAPIContext } from '../../contexts';
|
|
18
18
|
import { processRequest } from './API';
|
|
19
19
|
import { getWorkerURL } from './helpers';
|
|
20
20
|
import { CustomAction } from './types';
|
|
21
21
|
export var useAPI = function (config) {
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
22
|
+
if (config === void 0) { config = {}; }
|
|
23
|
+
var _a = useState(), html = _a[0], setHtml = _a[1];
|
|
24
|
+
var _b = useState([]), listenersToReset = _b[0], setListenersToReset = _b[1];
|
|
25
|
+
var _c = useState(true), visible = _c[0], setVisible = _c[1];
|
|
26
|
+
var _d = useState(null), tooltip = _d[0], setTooltip = _d[1];
|
|
27
|
+
var _e = useState(null), customStyles = _e[0], setCustomStyles = _e[1];
|
|
28
|
+
var _f = useState(''), message = _f[0], setMessage = _f[1];
|
|
29
29
|
var dispatch = useDispatch();
|
|
30
30
|
var metadata = useSelector(mdmModule.selectors.getMetadata) || {};
|
|
31
31
|
var entity = useSelector(mdmModule.selectors.getEntity) || {};
|
|
@@ -39,8 +39,9 @@ export var useAPI = function (config) {
|
|
|
39
39
|
var environment = useSelector(mdmModule.selectors.getWorkflowEnvironmentUrl);
|
|
40
40
|
var qxApi = useContext(SandboxAPIContext);
|
|
41
41
|
var workflowCheckPermission = useWorkflowCheckPermission();
|
|
42
|
-
var
|
|
42
|
+
var _g = useSelector(mdmModule.selectors.getSearchProviderData) || {}, typeSearch = _g.type, search = _g.data;
|
|
43
43
|
var openSearch = function (search) { return dispatch(ui.actions.openSearch(search)); };
|
|
44
|
+
var workerRef = useRef();
|
|
44
45
|
var process = function (task, worker, innerText) {
|
|
45
46
|
if (task) {
|
|
46
47
|
var handlersToReset_1 = [];
|
|
@@ -134,8 +135,7 @@ export var useAPI = function (config) {
|
|
|
134
135
|
break;
|
|
135
136
|
}
|
|
136
137
|
case CustomAction.REQUEST: {
|
|
137
|
-
processRequest(__assign({ name: task.params.name, paramObject: task, permissions: permissions,
|
|
138
|
-
worker: worker,
|
|
138
|
+
processRequest(__assign({ name: task.params.name, paramObject: task, permissions: config.action.permissions, worker: worker,
|
|
139
139
|
metadata: metadata, config: config, user: user,
|
|
140
140
|
apiPath: apiPath,
|
|
141
141
|
tenant: tenant,
|
|
@@ -150,20 +150,31 @@ export var useAPI = function (config) {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
useEffect(function () {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
if (!isEmptyValue(config.action)) {
|
|
154
|
+
workerRef.current = initializeWebWorker(workerUrl, config.action.files, process);
|
|
155
|
+
return function () {
|
|
156
|
+
workerRef.current.terminate();
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}, [config]);
|
|
158
160
|
useEffect(function () { return function () {
|
|
159
161
|
listenersToReset.forEach(function (listener) { return listener(); });
|
|
160
162
|
}; }, [listenersToReset]);
|
|
163
|
+
var onClick = useCallback(function () {
|
|
164
|
+
var _a;
|
|
165
|
+
(_a = workerRef.current) === null || _a === void 0 ? void 0 : _a.postMessage({
|
|
166
|
+
action: 'event',
|
|
167
|
+
type: 'execute',
|
|
168
|
+
data: null
|
|
169
|
+
});
|
|
170
|
+
}, [config]);
|
|
161
171
|
return {
|
|
162
172
|
html: html,
|
|
163
173
|
visible: visible,
|
|
164
174
|
tooltip: tooltip,
|
|
165
175
|
customStyles: customStyles,
|
|
166
176
|
message: message,
|
|
167
|
-
onClosePopup: function () { return setMessage(''); }
|
|
177
|
+
onClosePopup: function () { return setMessage(''); },
|
|
178
|
+
onClick: onClick
|
|
168
179
|
};
|
|
169
180
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1130",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1130",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1130",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"react-number-format": "^4.3.0",
|
|
30
30
|
"react-redux": "^7.2.3",
|
|
31
31
|
"react-resize-detector": "^4.2.0",
|
|
32
|
+
"react-router-dom": "^6.2.1",
|
|
32
33
|
"react-select": "^3.0.4",
|
|
33
34
|
"react-simple-maps": "^2.3.0",
|
|
34
35
|
"react-split-pane": "^0.1.89",
|