@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
|
@@ -41,13 +41,13 @@ var API_1 = require("./API");
|
|
|
41
41
|
var helpers_1 = require("./helpers");
|
|
42
42
|
var types_1 = require("./types");
|
|
43
43
|
var useAPI = function (config) {
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
44
|
+
if (config === void 0) { config = {}; }
|
|
45
|
+
var _a = react_1.useState(), html = _a[0], setHtml = _a[1];
|
|
46
|
+
var _b = react_1.useState([]), listenersToReset = _b[0], setListenersToReset = _b[1];
|
|
47
|
+
var _c = react_1.useState(true), visible = _c[0], setVisible = _c[1];
|
|
48
|
+
var _d = react_1.useState(null), tooltip = _d[0], setTooltip = _d[1];
|
|
49
|
+
var _e = react_1.useState(null), customStyles = _e[0], setCustomStyles = _e[1];
|
|
50
|
+
var _f = react_1.useState(''), message = _f[0], setMessage = _f[1];
|
|
51
51
|
var dispatch = react_redux_1.useDispatch();
|
|
52
52
|
var metadata = react_redux_1.useSelector(mdm_module_1.default.selectors.getMetadata) || {};
|
|
53
53
|
var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity) || {};
|
|
@@ -61,8 +61,9 @@ var useAPI = function (config) {
|
|
|
61
61
|
var environment = react_redux_1.useSelector(mdm_module_1.default.selectors.getWorkflowEnvironmentUrl);
|
|
62
62
|
var qxApi = react_1.useContext(contexts_1.SandboxAPIContext);
|
|
63
63
|
var workflowCheckPermission = workflow_1.useWorkflowCheckPermission();
|
|
64
|
-
var
|
|
64
|
+
var _g = react_redux_1.useSelector(mdm_module_1.default.selectors.getSearchProviderData) || {}, typeSearch = _g.type, search = _g.data;
|
|
65
65
|
var openSearch = function (search) { return dispatch(mdm_module_1.ui.actions.openSearch(search)); };
|
|
66
|
+
var workerRef = react_1.useRef();
|
|
66
67
|
var process = function (task, worker, innerText) {
|
|
67
68
|
if (task) {
|
|
68
69
|
var handlersToReset_1 = [];
|
|
@@ -156,8 +157,7 @@ var useAPI = function (config) {
|
|
|
156
157
|
break;
|
|
157
158
|
}
|
|
158
159
|
case types_1.CustomAction.REQUEST: {
|
|
159
|
-
API_1.processRequest(__assign({ name: task.params.name, paramObject: task, permissions: permissions,
|
|
160
|
-
worker: worker,
|
|
160
|
+
API_1.processRequest(__assign({ name: task.params.name, paramObject: task, permissions: config.action.permissions, worker: worker,
|
|
161
161
|
metadata: metadata, config: config, user: user,
|
|
162
162
|
apiPath: apiPath,
|
|
163
163
|
tenant: tenant,
|
|
@@ -172,21 +172,32 @@ var useAPI = function (config) {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
react_1.useEffect(function () {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
if (!mdm_sdk_1.isEmptyValue(config.action)) {
|
|
176
|
+
workerRef.current = mdm_sdk_1.initializeWebWorker(workerUrl, config.action.files, process);
|
|
177
|
+
return function () {
|
|
178
|
+
workerRef.current.terminate();
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}, [config]);
|
|
180
182
|
react_1.useEffect(function () { return function () {
|
|
181
183
|
listenersToReset.forEach(function (listener) { return listener(); });
|
|
182
184
|
}; }, [listenersToReset]);
|
|
185
|
+
var onClick = react_1.useCallback(function () {
|
|
186
|
+
var _a;
|
|
187
|
+
(_a = workerRef.current) === null || _a === void 0 ? void 0 : _a.postMessage({
|
|
188
|
+
action: 'event',
|
|
189
|
+
type: 'execute',
|
|
190
|
+
data: null
|
|
191
|
+
});
|
|
192
|
+
}, [config]);
|
|
183
193
|
return {
|
|
184
194
|
html: html,
|
|
185
195
|
visible: visible,
|
|
186
196
|
tooltip: tooltip,
|
|
187
197
|
customStyles: customStyles,
|
|
188
198
|
message: message,
|
|
189
|
-
onClosePopup: function () { return setMessage(''); }
|
|
199
|
+
onClosePopup: function () { return setMessage(''); },
|
|
200
|
+
onClick: onClick
|
|
190
201
|
};
|
|
191
202
|
};
|
|
192
203
|
exports.useAPI = useAPI;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { useInRouterContext, Link } from 'react-router-dom';
|
|
25
|
+
import classnames from 'classnames';
|
|
26
|
+
import { useStyles } from './styles';
|
|
27
|
+
var InternalLink = function (props) {
|
|
28
|
+
var styles = useStyles();
|
|
29
|
+
var inRouterContext = useInRouterContext();
|
|
30
|
+
var href = props.href, className = props.className, otherProps = __rest(props, ["href", "className"]);
|
|
31
|
+
var linkClassName = classnames(styles.link, className);
|
|
32
|
+
return inRouterContext ? (React.createElement(Link, __assign({ to: href === null || href === void 0 ? void 0 : href.replace(window.location.origin, ''), className: linkClassName }, otherProps))) : (React.createElement("a", __assign({ href: href, className: linkClassName }, otherProps)));
|
|
33
|
+
};
|
|
34
|
+
export default InternalLink;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"link">;
|
|
@@ -3,6 +3,7 @@ import { DefaultCellRenderer } from '../helpers';
|
|
|
3
3
|
export var TableCell = function (_a) {
|
|
4
4
|
var columnValue = _a.columnValue, rowData = _a.rowData, setHoveredColumn = _a.setHoveredColumn, resetHoveredColumn = _a.resetHoveredColumn;
|
|
5
5
|
var CellRenderer = rowData.cellRenderer || DefaultCellRenderer;
|
|
6
|
-
|
|
6
|
+
var onMouseOver = setHoveredColumn ? function () { return setHoveredColumn(columnValue); } : undefined;
|
|
7
|
+
return (React.createElement("td", { onMouseOver: onMouseOver, onMouseLeave: resetHoveredColumn },
|
|
7
8
|
React.createElement(CellRenderer, { value: columnValue[rowData.id] })));
|
|
8
9
|
};
|
|
@@ -56,7 +56,8 @@ export var TableCellWithDnd = function (_a) {
|
|
|
56
56
|
drop(dropRef);
|
|
57
57
|
drag(dragRef);
|
|
58
58
|
}, []);
|
|
59
|
-
|
|
59
|
+
var onMouseOver = setHoveredColumn ? function () { return setHoveredColumn(columnValue); } : undefined;
|
|
60
|
+
return (React.createElement("td", { style: { opacity: opacity }, ref: dropRef, className: styles.tableData, "data-source-id": sourceId, "data-target-id": targetId, onMouseOver: onMouseOver, onMouseLeave: resetHoveredColumn },
|
|
60
61
|
shouldRenderDragIndicator && (React.createElement("div", { ref: dragRef, className: styles.dragIndicator },
|
|
61
62
|
React.createElement(DragIndicatorIcon, { className: styles.dragIndicatorIcon }))),
|
|
62
63
|
React.createElement(CellRenderer, { value: columnValue[rowData.id] })));
|
|
@@ -10,6 +10,6 @@ export var TableRow = function (_a) {
|
|
|
10
10
|
columnsData.map(function (columnValue, index) {
|
|
11
11
|
var isDraggableColumn = columnValue.isDraggable;
|
|
12
12
|
var shouldRenderDragIndicator = isFirstRow && isDraggableColumn;
|
|
13
|
-
return onMoveColumn ? (React.createElement(TableCellWithDnd, { key: columnValue.id, columnValue: columnValue, rowData: rowData, index: index, onMoveColumn: onMoveColumn, shouldRenderDragIndicator: shouldRenderDragIndicator, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })) : (React.createElement(TableCell, { key: columnValue.id, rowData: rowData, columnValue: columnValue, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn }));
|
|
13
|
+
return onMoveColumn ? (React.createElement(TableCellWithDnd, { key: columnValue.id || index, columnValue: columnValue, rowData: rowData, index: index, onMoveColumn: onMoveColumn, shouldRenderDragIndicator: shouldRenderDragIndicator, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })) : (React.createElement(TableCell, { key: columnValue.id || index, rowData: rowData, columnValue: columnValue, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn }));
|
|
14
14
|
})));
|
|
15
15
|
};
|
|
@@ -50,6 +50,6 @@ export var TableRowWithDnd = function (_a) {
|
|
|
50
50
|
return (React.createElement("tr", { className: rowData.rowClassName, style: { opacity: opacity }, ref: dropRef, "data-target-id": targetId, "data-source-id": sourceId },
|
|
51
51
|
React.createElement(TableHeadCell, { rowData: rowData, isDraggable: true, dragRef: dragRef }),
|
|
52
52
|
columnsData.map(function (columnValue, index) {
|
|
53
|
-
return onMoveColumn ? (React.createElement(TableCellWithDnd, { key: columnValue.id, columnValue: columnValue, rowData: rowData, index: index, onMoveColumn: onMoveColumn, shouldRenderDragIndicator: false, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })) : (React.createElement(TableCell, { key: columnValue.id, columnValue: columnValue, rowData: rowData, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn }));
|
|
53
|
+
return onMoveColumn ? (React.createElement(TableCellWithDnd, { key: columnValue.id || index, columnValue: columnValue, rowData: rowData, index: index, onMoveColumn: onMoveColumn, shouldRenderDragIndicator: false, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })) : (React.createElement(TableCell, { key: columnValue.id || index, columnValue: columnValue, rowData: rowData, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn }));
|
|
54
54
|
})));
|
|
55
55
|
};
|
|
@@ -7,12 +7,13 @@ var VerticalHeadingsTable = function (_a) {
|
|
|
7
7
|
var className = _a.className, rowsData = _a.rowsData, columnsData = _a.columnsData, _c = _a.theadRowsNumber, theadRowsNumber = _c === void 0 ? 0 : _c, onMoveRow = _a.onMoveRow, onMoveColumn = _a.onMoveColumn, setHoveredColumn = _a.setHoveredColumn, resetHoveredColumn = _a.resetHoveredColumn;
|
|
8
8
|
var tableRef = useRef(null);
|
|
9
9
|
var tableHeight = (_b = tableRef === null || tableRef === void 0 ? void 0 : tableRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight;
|
|
10
|
+
var isDNDActive = !!onMoveRow || !!onMoveColumn;
|
|
10
11
|
return (React.createElement(React.Fragment, null,
|
|
11
|
-
React.createElement(TableColumnDragLayer, { columnHeight: tableHeight }),
|
|
12
|
+
isDNDActive && React.createElement(TableColumnDragLayer, { columnHeight: tableHeight }),
|
|
12
13
|
React.createElement("table", { ref: tableRef, className: className },
|
|
13
|
-
theadRowsNumber > 0 && (React.createElement("thead", null, rowsData.slice(0, theadRowsNumber).map(function (rowData, index) { return (React.createElement(TableRow, { key: rowData.id, rowData: rowData, columnsData: columnsData, index: index, onMoveColumn: onMoveColumn, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })); }))),
|
|
14
|
+
theadRowsNumber > 0 && (React.createElement("thead", null, rowsData.slice(0, theadRowsNumber).map(function (rowData, index) { return (React.createElement(TableRow, { key: rowData.id || index, rowData: rowData, columnsData: columnsData, index: index, onMoveColumn: onMoveColumn, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })); }))),
|
|
14
15
|
React.createElement("tbody", null, rowsData.slice(theadRowsNumber).map(function (rowData, index) {
|
|
15
|
-
return onMoveRow ? (React.createElement(TableRowWithDnd, { key: rowData.id, index: index + theadRowsNumber, rowData: rowData, columnsData: columnsData, onMoveRow: onMoveRow, onMoveColumn: onMoveColumn, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })) : (React.createElement(TableRow, { key: rowData.id, index: index + theadRowsNumber, rowData: rowData, columnsData: columnsData, onMoveColumn: onMoveColumn, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn }));
|
|
16
|
+
return onMoveRow ? (React.createElement(TableRowWithDnd, { key: rowData.id || index, index: index + theadRowsNumber, rowData: rowData, columnsData: columnsData, onMoveRow: onMoveRow, onMoveColumn: onMoveColumn, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn })) : (React.createElement(TableRow, { key: rowData.id || index, index: index + theadRowsNumber, rowData: rowData, columnsData: columnsData, onMoveColumn: onMoveColumn, setHoveredColumn: setHoveredColumn, resetHoveredColumn: resetHoveredColumn }));
|
|
16
17
|
})))));
|
|
17
18
|
};
|
|
18
19
|
export default memo(VerticalHeadingsTable);
|
|
@@ -31,7 +31,7 @@ var EditModeAttributesFactory = /** @class */ (function () {
|
|
|
31
31
|
EditModeAttributesFactory.build = function (attributeType, props) {
|
|
32
32
|
if (props === void 0) { props = {}; }
|
|
33
33
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
34
|
-
var showEmptyEditors = props.showEmptyEditors, onAddAttributes = props.onAddAttributes, lazy = props.lazy, errors = props.errors, crosswalks = props.crosswalks, showNonOv = props.showNonOv, propsForSimpleAttribute = __rest(props, ["showEmptyEditors", "onAddAttributes", "lazy", "errors", "crosswalks", "showNonOv"]);
|
|
34
|
+
var showEmptyEditors = props.showEmptyEditors, onAddAttributes = props.onAddAttributes, lazy = props.lazy, errors = props.errors, crosswalks = props.crosswalks, showNonOv = props.showNonOv, expanded = props.expanded, propsForSimpleAttribute = __rest(props, ["showEmptyEditors", "onAddAttributes", "lazy", "errors", "crosswalks", "showNonOv", "expanded"]);
|
|
35
35
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
36
36
|
switch (attributeType.type) {
|
|
37
37
|
case DataTypes.TYPE_NESTED:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ComplexAttribute;
|
|
2
|
-
declare function ComplexAttribute({ label, attributeTypesList, attributeType, attributeValue, children, errors, ownError, mode, metadata, crosswalks, lazy, showEmptyEditors, onAddOneMore, onAddAttributes, onDeleteAttribute, onChangeAttribute, additionalControlsRenderer, hideDeleteButton, state, showNonOv }: {
|
|
2
|
+
declare function ComplexAttribute({ label, attributeTypesList, attributeType, attributeValue, children, errors, ownError, mode, metadata, crosswalks, lazy, showEmptyEditors, onAddOneMore, onAddAttributes, onDeleteAttribute, onChangeAttribute, additionalControlsRenderer, hideDeleteButton, state, showNonOv, expanded: expandedProp }: {
|
|
3
3
|
label: any;
|
|
4
4
|
attributeTypesList: any;
|
|
5
5
|
attributeType: any;
|
|
@@ -20,6 +20,7 @@ declare function ComplexAttribute({ label, attributeTypesList, attributeType, at
|
|
|
20
20
|
hideDeleteButton: any;
|
|
21
21
|
state: any;
|
|
22
22
|
showNonOv: any;
|
|
23
|
+
expanded?: boolean;
|
|
23
24
|
}): JSX.Element;
|
|
24
25
|
declare namespace ComplexAttribute {
|
|
25
26
|
const propTypes: {
|
|
@@ -130,6 +131,7 @@ declare namespace ComplexAttribute {
|
|
|
130
131
|
hideDeleteButton: PropTypes.Requireable<boolean>;
|
|
131
132
|
showNonOv: PropTypes.Requireable<boolean>;
|
|
132
133
|
state: PropTypes.Requireable<string>;
|
|
134
|
+
expanded: PropTypes.Requireable<boolean>;
|
|
133
135
|
label: PropTypes.Requireable<string>;
|
|
134
136
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
135
137
|
attributeTypesList: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -24,13 +24,17 @@ import AttributesList from '../AttributesList/AttributesList';
|
|
|
24
24
|
import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
|
|
25
25
|
var ComplexAttribute = function (_a) {
|
|
26
26
|
var _b;
|
|
27
|
-
var label = _a.label, attributeTypesList = _a.attributeTypesList, attributeType = _a.attributeType, attributeValue = _a.attributeValue, children = _a.children, errors = _a.errors, ownError = _a.ownError, mode = _a.mode, metadata = _a.metadata, crosswalks = _a.crosswalks, lazy = _a.lazy, showEmptyEditors = _a.showEmptyEditors, onAddOneMore = _a.onAddOneMore, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, hideDeleteButton = _a.hideDeleteButton, state = _a.state, showNonOv = _a.showNonOv;
|
|
27
|
+
var label = _a.label, attributeTypesList = _a.attributeTypesList, attributeType = _a.attributeType, attributeValue = _a.attributeValue, children = _a.children, errors = _a.errors, ownError = _a.ownError, mode = _a.mode, metadata = _a.metadata, crosswalks = _a.crosswalks, lazy = _a.lazy, showEmptyEditors = _a.showEmptyEditors, onAddOneMore = _a.onAddOneMore, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, hideDeleteButton = _a.hideDeleteButton, state = _a.state, showNonOv = _a.showNonOv, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c;
|
|
28
28
|
var styles = useStyles();
|
|
29
29
|
var deleted = state === 'deleted';
|
|
30
30
|
var edited = state === 'edited';
|
|
31
31
|
var uri = attributeValue.uri;
|
|
32
32
|
var isNew = isTempUri(uri);
|
|
33
|
-
var
|
|
33
|
+
var defaultExpand = isNew || expandedProp;
|
|
34
|
+
var _d = useState(defaultExpand), expanded = _d[0], setExpanded = _d[1];
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
setExpanded(defaultExpand);
|
|
37
|
+
}, [defaultExpand]);
|
|
34
38
|
var canDelete = useMemo(function () {
|
|
35
39
|
return checkCanDeleteAttribute({
|
|
36
40
|
attributeType: attributeType,
|
|
@@ -108,6 +108,7 @@ declare var _default: React.MemoExoticComponent<{
|
|
|
108
108
|
hideDeleteButton: import("prop-types").Requireable<boolean>;
|
|
109
109
|
showNonOv: import("prop-types").Requireable<boolean>;
|
|
110
110
|
state: import("prop-types").Requireable<string>;
|
|
111
|
+
expanded: import("prop-types").Requireable<boolean>;
|
|
111
112
|
attributeValue: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
112
113
|
value: import("prop-types").Requireable<object>;
|
|
113
114
|
ov: import("prop-types").Requireable<boolean>;
|
|
@@ -116,6 +116,7 @@ declare var _default: React.MemoExoticComponent<{
|
|
|
116
116
|
hideDeleteButton: PropTypes.Requireable<boolean>;
|
|
117
117
|
showNonOv: PropTypes.Requireable<boolean>;
|
|
118
118
|
state: PropTypes.Requireable<string>;
|
|
119
|
+
expanded: PropTypes.Requireable<boolean>;
|
|
119
120
|
attributeValue: PropTypes.Requireable<PropTypes.InferProps<{
|
|
120
121
|
refEntity: PropTypes.Requireable<object>;
|
|
121
122
|
refRelation: PropTypes.Requireable<object>;
|
|
@@ -117,6 +117,7 @@ declare var _default: import("react-redux").ConnectedComponent<import("react").M
|
|
|
117
117
|
hideDeleteButton: import("prop-types").Requireable<boolean>;
|
|
118
118
|
showNonOv: import("prop-types").Requireable<boolean>;
|
|
119
119
|
state: import("prop-types").Requireable<string>;
|
|
120
|
+
expanded: import("prop-types").Requireable<boolean>;
|
|
120
121
|
attributeValue: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
121
122
|
refEntity: import("prop-types").Requireable<object>;
|
|
122
123
|
refRelation: import("prop-types").Requireable<object>;
|
|
@@ -27,6 +27,7 @@ import { findAttributeTypeByUri, getEntityLink, getLabel, getReferencedEntityUri
|
|
|
27
27
|
import ComplexAttribute from '../ComplexAttribute/ComplexAttribute';
|
|
28
28
|
import { isNil, map, pipe, reject } from 'ramda';
|
|
29
29
|
import { ComplexAttributeLabel } from '../common/ComplexAttributeLabel';
|
|
30
|
+
import InternalLink from '../../../InternalLink/InternalLink';
|
|
30
31
|
import { useStyles } from './styles';
|
|
31
32
|
var ReferenceAttribute = function (_a) {
|
|
32
33
|
var attributeValue = _a.attributeValue, attributeType = _a.attributeType, other = __rest(_a, ["attributeValue", "attributeType"]);
|
|
@@ -34,7 +35,7 @@ var ReferenceAttribute = function (_a) {
|
|
|
34
35
|
var metadata = useSelector(mdmModule.selectors.getMetadata);
|
|
35
36
|
var uiPath = useSelector(mdmModule.selectors.getUIPath);
|
|
36
37
|
var entityLabel = (React.createElement(ComplexAttributeLabel, null,
|
|
37
|
-
React.createElement(
|
|
38
|
+
React.createElement(InternalLink, { href: getEntityLink({ uiPath: uiPath, uri: getReferencedEntityUriFromAttrValue(attributeValue) }) },
|
|
38
39
|
getLabel(attributeValue.label),
|
|
39
40
|
attributeValue.relationshipLabel && (React.createElement("span", { className: styles.relationshipLabel }, attributeValue.relationshipLabel)))));
|
|
40
41
|
var attributeTypesList = pipe(getReferencedRelationAttrTypesUris, map(function (attrTypeUri) { return findAttributeTypeByUri(metadata, attrTypeUri); }), reject(isNil))(attributeType);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"relationshipLabel">;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core/styles';
|
|
2
2
|
export var useStyles = makeStyles(function (theme) { return ({
|
|
3
|
-
label: {
|
|
4
|
-
color: theme.palette.primary.main,
|
|
5
|
-
textDecoration: 'none'
|
|
6
|
-
},
|
|
7
3
|
relationshipLabel: {
|
|
8
4
|
marginLeft: '4px',
|
|
9
5
|
color: theme.palette.text.primary
|
|
@@ -5,6 +5,10 @@ declare type Props = {
|
|
|
5
5
|
attributeType: AttributeType;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
valueContainerClassName?: string;
|
|
8
|
+
LabelRenderer?: ({ attributeType: AttributeType, attributeValue: AttributeValue }: {
|
|
9
|
+
attributeType: any;
|
|
10
|
+
attributeValue: any;
|
|
11
|
+
}) => JSX.Element;
|
|
8
12
|
};
|
|
9
|
-
declare const _default: React.MemoExoticComponent<({ expanded, ...props }: Props) => JSX.Element>;
|
|
13
|
+
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, ...props }: Props) => JSX.Element>;
|
|
10
14
|
export default _default;
|
|
@@ -30,12 +30,12 @@ var renderAttributesList = function (_a) {
|
|
|
30
30
|
React.createElement(ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))); })));
|
|
31
31
|
};
|
|
32
32
|
var AttributeValuesBlock = function (_a) {
|
|
33
|
-
var expanded = _a.expanded, props = __rest(_a, ["expanded"]);
|
|
33
|
+
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, props = __rest(_a, ["expanded", "LabelRenderer"]);
|
|
34
34
|
var attributeType = props.attributeType, values = props.values, valueContainerClassName = props.valueContainerClassName;
|
|
35
35
|
switch (attributeType.type) {
|
|
36
36
|
case DataTypes.TYPE_NESTED:
|
|
37
37
|
case DataTypes.TYPE_REFERENCE: {
|
|
38
|
-
return renderAttributesList(__assign({ expanded: expanded }, props));
|
|
38
|
+
return renderAttributesList(__assign({ expanded: expanded, LabelRenderer: LabelRenderer }, props));
|
|
39
39
|
}
|
|
40
40
|
case DataTypes.TYPE_IMAGE: {
|
|
41
41
|
return (React.createElement("div", { className: valueContainerClassName },
|
|
@@ -22,7 +22,7 @@ var SpecialRenderer = function (_a) {
|
|
|
22
22
|
return React.createElement(Roles, { className: className, values: values });
|
|
23
23
|
}
|
|
24
24
|
default: {
|
|
25
|
-
//startDate, endDate
|
|
25
|
+
//startDate, endDate, "crosswalk" fake nested subattibutes
|
|
26
26
|
return (React.createElement(Attribute, { className: className, attributeValue: { value: values[0] }, attributeType: attributeType, inlined: true }));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ComplexAttribute;
|
|
2
|
-
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType }: {
|
|
2
|
+
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType, LabelRenderer }: {
|
|
3
3
|
attributeTypesList: any;
|
|
4
4
|
attributeValue: any;
|
|
5
5
|
label: any;
|
|
@@ -7,6 +7,7 @@ declare function ComplexAttribute({ attributeTypesList, attributeValue, label, e
|
|
|
7
7
|
children: any;
|
|
8
8
|
showNonOv: any;
|
|
9
9
|
attributeType: any;
|
|
10
|
+
LabelRenderer: any;
|
|
10
11
|
}): JSX.Element;
|
|
11
12
|
declare namespace ComplexAttribute {
|
|
12
13
|
namespace propTypes {
|
|
@@ -36,6 +37,7 @@ declare namespace ComplexAttribute {
|
|
|
36
37
|
export const expanded: PropTypes.Requireable<boolean>;
|
|
37
38
|
export const showNonOv: PropTypes.Requireable<boolean>;
|
|
38
39
|
export { AttributeTypeType as attributeType };
|
|
40
|
+
export const LabelRenderer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
import PropTypes from "prop-types";
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
2
13
|
import PropTypes from 'prop-types';
|
|
3
14
|
import classnames from 'classnames';
|
|
4
|
-
import { AttributeTypeType, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType,
|
|
15
|
+
import { AttributeTypeType, areOneHierarchyUris, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType, isSpecialAttribute } from '@reltio/mdm-sdk';
|
|
5
16
|
import Typography from '@material-ui/core/Typography';
|
|
6
17
|
import AttributesList from '../AttributesList/AttributesList';
|
|
7
18
|
import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
|
|
@@ -11,7 +22,7 @@ import { useStyles } from './styles';
|
|
|
11
22
|
import { HighlightedValuesContext } from '../../../../contexts';
|
|
12
23
|
var ComplexAttribute = function (_a) {
|
|
13
24
|
var _b;
|
|
14
|
-
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType;
|
|
25
|
+
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType, LabelRenderer = _a.LabelRenderer;
|
|
15
26
|
var styles = useStyles();
|
|
16
27
|
var uri = attributeValue.uri;
|
|
17
28
|
var _d = useState(false), expanded = _d[0], setExpanded = _d[1];
|
|
@@ -20,25 +31,23 @@ var ComplexAttribute = function (_a) {
|
|
|
20
31
|
setExpanded(expandedProp);
|
|
21
32
|
}, [expandedProp]);
|
|
22
33
|
var hasAnalyticValue = (attributeTypesList || []).some(function (attributeType) { return isAnalyticAttribute(attributeType); });
|
|
23
|
-
var attributeListEntity = useMemo(function () { return ({
|
|
24
|
-
attributes: hasAnalyticValue ? null : attributeValue.value,
|
|
25
|
-
analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
|
|
26
|
-
}); }, [attributeValue, hasAnalyticValue]);
|
|
34
|
+
var attributeListEntity = useMemo(function () { return (__assign({ attributes: hasAnalyticValue ? null : attributeValue.value, analyticsAttributes: hasAnalyticValue ? attributeValue.value : null }, (isSpecialAttribute(attributeType) ? attributeValue.value : {}))); }, [attributeValue, hasAnalyticValue, attributeType]);
|
|
27
35
|
var objectType = isRelationAttrType(attributeType)
|
|
28
36
|
? CollaborationObjectTypes.RELATION_ATTRIBUTE
|
|
29
37
|
: CollaborationObjectTypes.ENTITY_ATTRIBUTE;
|
|
30
38
|
return (React.createElement("div", { className: styles.complexContainer },
|
|
31
39
|
React.createElement("div", { className: classnames(styles.labelContainer, COMMENTS_CONTAINER_VISIBILITY_AREA) },
|
|
32
40
|
React.createElement(ArrowExpandButton, { onClick: function () { return setExpanded(function (value) { return !value; }); }, expanded: expanded }),
|
|
33
|
-
React.createElement(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
LabelRenderer ? (React.createElement(LabelRenderer, { attributeType: attributeType, attributeValue: attributeValue })) : (React.createElement(React.Fragment, null,
|
|
42
|
+
React.createElement(Typography, { component: "span", variant: "body2", classes: { body2: styles.label }, className: classnames((_b = {},
|
|
43
|
+
_b[highlightedClassName] = highlightedValuesUris.some(function (uri) {
|
|
44
|
+
return areOneHierarchyUris(uri, attributeValue.uri);
|
|
45
|
+
}),
|
|
46
|
+
_b)), "data-reltio-id": "reltio-attribute-complex-label" }, label),
|
|
47
|
+
React.createElement("div", { className: styles.spacer }),
|
|
48
|
+
React.createElement(CommentsContainer, { uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
49
|
+
uri: attributeValue.uri
|
|
50
|
+
}), objectType: objectType })))),
|
|
42
51
|
expanded && (React.createElement(AttributesList, { attrTypes: attributeTypesList, entity: attributeListEntity, drawLines: true, parentUri: uri, showNonOv: showNonOv }, children))));
|
|
43
52
|
};
|
|
44
53
|
ComplexAttribute.propTypes = {
|
|
@@ -48,6 +57,7 @@ ComplexAttribute.propTypes = {
|
|
|
48
57
|
attributeValue: PropTypes.oneOfType([NestedAttributeValueType, ReferenceAttributeValueType]),
|
|
49
58
|
expanded: PropTypes.bool,
|
|
50
59
|
showNonOv: PropTypes.bool,
|
|
51
|
-
attributeType: AttributeTypeType
|
|
60
|
+
attributeType: AttributeTypeType,
|
|
61
|
+
LabelRenderer: PropTypes.func
|
|
52
62
|
};
|
|
53
63
|
export default ComplexAttribute;
|
|
@@ -112,6 +112,7 @@ declare var _default: React.MemoExoticComponent<{
|
|
|
112
112
|
hideDeleteButton: import("prop-types").Requireable<boolean>;
|
|
113
113
|
showNonOv: import("prop-types").Requireable<boolean>;
|
|
114
114
|
state: import("prop-types").Requireable<string>;
|
|
115
|
+
expanded: import("prop-types").Requireable<boolean>;
|
|
115
116
|
attributeValue: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
116
117
|
value: import("prop-types").Requireable<object>;
|
|
117
118
|
ov: import("prop-types").Requireable<boolean>;
|
|
@@ -114,6 +114,7 @@ declare var _default: React.MemoExoticComponent<{
|
|
|
114
114
|
hideDeleteButton: import("prop-types").Requireable<boolean>;
|
|
115
115
|
showNonOv: import("prop-types").Requireable<boolean>;
|
|
116
116
|
state: import("prop-types").Requireable<string>;
|
|
117
|
+
expanded: import("prop-types").Requireable<boolean>;
|
|
117
118
|
attributeValue: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
118
119
|
refEntity: import("prop-types").Requireable<object>;
|
|
119
120
|
refRelation: import("prop-types").Requireable<object>;
|
|
@@ -21,11 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React, { memo, useContext, useMemo } from 'react';
|
|
24
|
-
import classnames from 'classnames';
|
|
25
24
|
import { getAttributeTypeSubAttributes, getEntityLink, getLabel, getReferencedEntityUriFromAttrValue, isEmptyValue, ReferenceAttributeType } from '@reltio/mdm-sdk';
|
|
26
25
|
import { HistoryDiffContext } from '../../../../contexts';
|
|
27
26
|
import ComplexAttribute from '../ComplexAttribute/ComplexAttribute';
|
|
28
27
|
import { getHistoryAppearanceByUri, getHistoryAttributeClassName } from '../helpers/historyAppearance';
|
|
28
|
+
import InternalLink from '../../../InternalLink/InternalLink';
|
|
29
29
|
import useStyles from './styles';
|
|
30
30
|
var ReferenceAttribute = function (_a) {
|
|
31
31
|
var attributeValue = _a.attributeValue, metadata = _a.metadata, attributeType = _a.attributeType, uiPath = _a.uiPath, otherProps = __rest(_a, ["attributeValue", "metadata", "attributeType", "uiPath"]);
|
|
@@ -39,7 +39,7 @@ var ReferenceAttribute = function (_a) {
|
|
|
39
39
|
var entityLabel = useMemo(function () {
|
|
40
40
|
var attributeAppearance = getHistoryAppearanceByUri(attributeValue.uri, appearance);
|
|
41
41
|
var historyAttributesClassName = getHistoryAttributeClassName(attributeAppearance);
|
|
42
|
-
return (React.createElement(
|
|
42
|
+
return (React.createElement(InternalLink, { href: isEmptyValue(appearance) ? getEntityLink({ uiPath: uiPath, uri: refEntityURI }) : undefined, className: styles[historyAttributesClassName] },
|
|
43
43
|
getLabel(attributeValue.label),
|
|
44
44
|
attributeValue.relationshipLabel && (React.createElement("span", { className: styles.relationshipLabel }, attributeValue.relationshipLabel))));
|
|
45
45
|
}, [
|
|
@@ -115,6 +115,7 @@ declare var _default: import("react-redux").ConnectedComponent<import("react").M
|
|
|
115
115
|
hideDeleteButton: import("prop-types").Requireable<boolean>;
|
|
116
116
|
showNonOv: import("prop-types").Requireable<boolean>;
|
|
117
117
|
state: import("prop-types").Requireable<string>;
|
|
118
|
+
expanded: import("prop-types").Requireable<boolean>;
|
|
118
119
|
attributeValue: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
119
120
|
refEntity: import("prop-types").Requireable<object>;
|
|
120
121
|
refRelation: import("prop-types").Requireable<object>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default styles;
|
|
2
|
-
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"
|
|
2
|
+
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"relationshipLabel" | "updateAttribute" | "insertAttribute" | "deleteAttribute">;
|
|
@@ -12,10 +12,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { makeStyles } from '@material-ui/core/styles';
|
|
13
13
|
import { HistoryOperations, historyPalettes } from '../helpers/historyAppearance';
|
|
14
14
|
var styles = makeStyles(function (theme) { return ({
|
|
15
|
-
label: {
|
|
16
|
-
color: theme.palette.primary.main,
|
|
17
|
-
textDecoration: 'none'
|
|
18
|
-
},
|
|
19
15
|
relationshipLabel: {
|
|
20
16
|
marginLeft: '4px',
|
|
21
17
|
color: theme.palette.text.primary
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import InternalLink from '../../../../InternalLink/InternalLink';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
4
|
import mdmModule from '@reltio/mdm-module';
|
|
5
5
|
import { getDataTenantEntityUri, getTagLink } from '@reltio/mdm-sdk';
|
|
@@ -16,7 +16,7 @@ var Tag = function (_a) {
|
|
|
16
16
|
var attributeAppearance = getHistoryAppearanceBySpecialAttributeValue('tags', value, appearance);
|
|
17
17
|
var historyClassName = getHistoryAttributeClassName(attributeAppearance);
|
|
18
18
|
var entity = ownEntity || currentEntity;
|
|
19
|
-
return (React.createElement(
|
|
19
|
+
return (React.createElement(InternalLink, { className: styles[historyClassName], href: getTagLink({
|
|
20
20
|
uiPath: uiPath,
|
|
21
21
|
tag: value,
|
|
22
22
|
entityUri: entity.dataTenant ? getDataTenantEntityUri(entity) : entity.uri
|
package/esm/hooks/useAPI/API.js
CHANGED
|
@@ -178,15 +178,15 @@ export var processRequest = function (_a) {
|
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
180
|
case RequestAction.ALERT: {
|
|
181
|
-
window.alert(paramObject.params.text);
|
|
181
|
+
worker.postMessage(__assign({ action: 'response', result: window.alert(paramObject.params.text) }, paramObject.params));
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
case RequestAction.CONFIRM: {
|
|
185
|
-
window.confirm(paramObject.params.text);
|
|
185
|
+
worker.postMessage(__assign({ action: 'response', result: window.confirm(paramObject.params.text) }, paramObject.params));
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
188
|
case RequestAction.PROMPT: {
|
|
189
|
-
window.prompt(paramObject.params.text, paramObject.params.defaultText || '');
|
|
189
|
+
worker.postMessage(__assign({ action: 'response', result: window.prompt(paramObject.params.text, paramObject.params.defaultText || '') }, paramObject.params));
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case RequestAction.OPEN_WINDOW: {
|
|
@@ -41,6 +41,7 @@ export declare type Params = {
|
|
|
41
41
|
defaultText?: string;
|
|
42
42
|
text?: string;
|
|
43
43
|
html?: string;
|
|
44
|
+
type?: string;
|
|
44
45
|
};
|
|
45
46
|
export declare type ProcessRequestParams = {
|
|
46
47
|
name: RequestAction;
|
|
@@ -79,7 +80,8 @@ export declare enum CustomAction {
|
|
|
79
80
|
SET_WIDTH = "setWidth",
|
|
80
81
|
RETURN_PROCESSED_API_RESPONSE = "returnProcessedApiResponse",
|
|
81
82
|
RETURN_PROCESSED_API_REQUEST = "returnProcessedApiRequest",
|
|
82
|
-
REQUEST = "request"
|
|
83
|
+
REQUEST = "request",
|
|
84
|
+
EVENT = "event"
|
|
83
85
|
}
|
|
84
86
|
export declare type CustomActionTask = {
|
|
85
87
|
action: CustomAction;
|
|
@@ -36,4 +36,5 @@ export var CustomAction;
|
|
|
36
36
|
CustomAction["RETURN_PROCESSED_API_RESPONSE"] = "returnProcessedApiResponse";
|
|
37
37
|
CustomAction["RETURN_PROCESSED_API_REQUEST"] = "returnProcessedApiRequest";
|
|
38
38
|
CustomAction["REQUEST"] = "request";
|
|
39
|
+
CustomAction["EVENT"] = "event";
|
|
39
40
|
})(CustomAction || (CustomAction = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomViewConfig } from '@reltio/mdm-sdk';
|
|
2
|
-
export declare const useAPI: (config
|
|
2
|
+
export declare const useAPI: (config?: CustomViewConfig) => {
|
|
3
3
|
html: HTMLElement;
|
|
4
4
|
visible: boolean;
|
|
5
5
|
tooltip: string;
|
|
@@ -10,4 +10,5 @@ export declare const useAPI: (config: CustomViewConfig) => {
|
|
|
10
10
|
};
|
|
11
11
|
message: string;
|
|
12
12
|
onClosePopup: () => void;
|
|
13
|
+
onClick: () => void;
|
|
13
14
|
};
|