@reltio/components 1.4.1721 → 1.4.1723
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/AttributesErrorsPanel/ErrorsPanel/Error.js +7 -1
- package/cjs/components/AttributesErrorsPanel/ErrorsPanel/ErrorsPanel.js +1 -2
- package/cjs/components/AttributesErrorsPanel/styles.d.ts +1 -1
- package/cjs/components/AttributesErrorsPanel/styles.js +27 -11
- package/cjs/components/AttributesErrorsPanel/useCachedErrors.d.ts +2 -1
- package/cjs/components/AttributesErrorsPanel/useCachedErrors.js +11 -4
- package/cjs/components/EntityUriLink/EntityUriLink.js +5 -2
- package/cjs/components/Link/Link.js +2 -1
- package/cjs/components/PivotingUriLink/PivotingUriLink.js +7 -3
- package/cjs/components/attributes/editMode/EntitySelector/components/SingleValue.d.ts +14 -9
- package/cjs/components/attributes/editMode/EntitySelector/components/SingleValue.js +12 -10
- package/cjs/core/utils.d.ts +9 -8
- package/cjs/core/utils.js +3 -1
- package/cjs/icons/ReadOnlyError.d.ts +3 -0
- package/cjs/icons/ReadOnlyError.js +22 -0
- package/cjs/icons/index.d.ts +4 -3
- package/cjs/icons/index.js +10 -8
- package/esm/components/AttributesErrorsPanel/ErrorsPanel/Error.js +7 -1
- package/esm/components/AttributesErrorsPanel/ErrorsPanel/ErrorsPanel.js +1 -2
- package/esm/components/AttributesErrorsPanel/styles.d.ts +1 -1
- package/esm/components/AttributesErrorsPanel/styles.js +27 -11
- package/esm/components/AttributesErrorsPanel/useCachedErrors.d.ts +2 -1
- package/esm/components/AttributesErrorsPanel/useCachedErrors.js +12 -5
- package/esm/components/EntityUriLink/EntityUriLink.js +5 -2
- package/esm/components/Link/Link.js +2 -1
- package/esm/components/PivotingUriLink/PivotingUriLink.js +8 -4
- package/esm/components/attributes/editMode/EntitySelector/components/SingleValue.d.ts +14 -9
- package/esm/components/attributes/editMode/EntitySelector/components/SingleValue.js +12 -10
- package/esm/core/utils.d.ts +9 -8
- package/esm/core/utils.js +2 -1
- package/esm/icons/ReadOnlyError.d.ts +3 -0
- package/esm/icons/ReadOnlyError.js +17 -0
- package/esm/icons/index.d.ts +4 -3
- package/esm/icons/index.js +4 -3
- package/package.json +2 -2
|
@@ -29,10 +29,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.Error = void 0;
|
|
30
30
|
var react_1 = __importStar(require("react"));
|
|
31
31
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
32
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
33
|
+
var Tooltip_1 = __importDefault(require("@mui/material/Tooltip"));
|
|
32
34
|
var Hyperlink_1 = __importDefault(require("../../../icons/Hyperlink"));
|
|
33
35
|
var SmallIconButton_1 = require("../../SmallIconButton");
|
|
34
36
|
var contexts_1 = require("../../../contexts");
|
|
35
37
|
var helpers_1 = require("./helpers");
|
|
38
|
+
var icons_1 = require("../../../icons");
|
|
36
39
|
var styles_1 = __importDefault(require("../styles"));
|
|
37
40
|
exports.Error = (0, react_1.memo)(function (_a) {
|
|
38
41
|
var error = _a.error;
|
|
@@ -44,7 +47,10 @@ exports.Error = (0, react_1.memo)(function (_a) {
|
|
|
44
47
|
var displayedAttributeTypesPath = (0, helpers_1.getDisplayedAttributeTypesPath)(error);
|
|
45
48
|
var highlightError = (0, react_1.useContext)(contexts_1.ScrollToElementContext).highlightError;
|
|
46
49
|
var showLink = error.uri || (error.parentUri && error.attributeTypeUri);
|
|
47
|
-
return (react_1.default.createElement("
|
|
50
|
+
return (react_1.default.createElement("div", { className: styles.errorListItem },
|
|
51
|
+
react_1.default.createElement("div", { className: styles.listItemMarker }, error.type === mdm_sdk_1.ErrorType.rdmIssueInReference ? (react_1.default.createElement(Tooltip_1.default, { title: ui_i18n_1.default.text('This error is visible only in view mode') },
|
|
52
|
+
react_1.default.createElement("span", null,
|
|
53
|
+
react_1.default.createElement(icons_1.ReadOnlyError, { className: styles.errorIcon })))) : (react_1.default.createElement("div", { className: styles.discIcon }))),
|
|
48
54
|
react_1.default.createElement("div", { className: styles.errorWrapper },
|
|
49
55
|
displayedAttributeTypesPath && (react_1.default.createElement("span", { className: styles.attributeTypesPath }, displayedAttributeTypesPath)),
|
|
50
56
|
react_1.default.createElement("span", { className: styles.errorTitle },
|
|
@@ -48,8 +48,7 @@ exports.ErrorsPanel = (0, react_1.memo)(function (_a) {
|
|
|
48
48
|
}, expandIcon: react_1.default.createElement(ExpandMore_1.default, null) },
|
|
49
49
|
icon,
|
|
50
50
|
react_1.default.createElement(Typography_1.default, { className: styles.accordionSummaryHeading }, title)),
|
|
51
|
-
react_1.default.createElement(AccordionDetails_1.default, { className: (0, classnames_1.default)(styles.accordionDetails, accordionDetailsClassName) },
|
|
52
|
-
react_1.default.createElement("ul", null, items.map(function (error, i) { return (react_1.default.createElement(ErrorComponent, { key: i, error: error })); })))));
|
|
51
|
+
react_1.default.createElement(AccordionDetails_1.default, { className: (0, classnames_1.default)(styles.accordionDetails, accordionDetailsClassName) }, items.map(function (error, i) { return (react_1.default.createElement(ErrorComponent, { key: i, error: error })); }))));
|
|
53
52
|
}))) : null;
|
|
54
53
|
});
|
|
55
54
|
exports.ErrorsPanel.displayName = 'ErrorsPanel';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon" | "parents" | "errorWrapper" | "accordion" | "accordionExpanded" | "accordionSummary" | "accordionSummaryHeading" | "accordionSummaryExpanded" | "accordionSummaryContent" | "accordionDetails" | "errorTitle" | "attributeTypesPath" | "goToIcon" | "errorsAccordion" | "errorsAccordionDetails" | "warningsAccordion" | "warningsAccordionDetails" | "errorIcon" | "warningIcon">;
|
|
1
|
+
declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon" | "parents" | "errorWrapper" | "accordion" | "accordionExpanded" | "accordionSummary" | "accordionSummaryHeading" | "accordionSummaryExpanded" | "accordionSummaryContent" | "accordionDetails" | "errorTitle" | "attributeTypesPath" | "goToIcon" | "errorsAccordion" | "errorsAccordionDetails" | "warningsAccordion" | "warningsAccordionDetails" | "errorIcon" | "warningIcon" | "errorListItem" | "listItemMarker" | "discIcon">;
|
|
2
2
|
export default useStyles;
|
|
@@ -43,24 +43,19 @@ var useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
|
|
|
43
43
|
accordionDetails: {
|
|
44
44
|
maxHeight: '21vh',
|
|
45
45
|
overflow: 'auto',
|
|
46
|
-
paddingTop:
|
|
47
|
-
paddingBottom:
|
|
48
|
-
'& ul': {
|
|
49
|
-
paddingLeft: '23px',
|
|
50
|
-
marginTop: '3px'
|
|
51
|
-
},
|
|
52
|
-
'& li': {
|
|
53
|
-
paddingLeft: '9px',
|
|
54
|
-
paddingBottom: '8px'
|
|
55
|
-
}
|
|
46
|
+
paddingTop: '3px',
|
|
47
|
+
paddingBottom: '8px'
|
|
56
48
|
},
|
|
57
49
|
parents: {
|
|
58
50
|
color: theme.palette.text.primary
|
|
59
51
|
},
|
|
60
52
|
errorWrapper: {
|
|
53
|
+
flex: 1,
|
|
61
54
|
lineHeight: '18px',
|
|
62
55
|
display: 'flex',
|
|
63
|
-
flexDirection: 'column'
|
|
56
|
+
flexDirection: 'column',
|
|
57
|
+
paddingLeft: '8px',
|
|
58
|
+
paddingBottom: '8px'
|
|
64
59
|
},
|
|
65
60
|
errorTitle: {
|
|
66
61
|
display: 'flex',
|
|
@@ -94,6 +89,27 @@ var useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
|
|
|
94
89
|
},
|
|
95
90
|
warningIcon: {
|
|
96
91
|
fill: '#F9A825'
|
|
92
|
+
},
|
|
93
|
+
errorListItem: {
|
|
94
|
+
display: 'flex',
|
|
95
|
+
alignItems: 'flex-start',
|
|
96
|
+
'& svg': {
|
|
97
|
+
fill: 'currentColor'
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
listItemMarker: {
|
|
101
|
+
flexShrink: 0,
|
|
102
|
+
width: '24px',
|
|
103
|
+
marginTop: '3px',
|
|
104
|
+
display: 'flex',
|
|
105
|
+
justifyContent: 'center'
|
|
106
|
+
},
|
|
107
|
+
discIcon: {
|
|
108
|
+
height: '4px',
|
|
109
|
+
width: '4px',
|
|
110
|
+
backgroundColor: 'currentColor',
|
|
111
|
+
borderRadius: '50%',
|
|
112
|
+
marginTop: '4px'
|
|
97
113
|
}
|
|
98
114
|
}); });
|
|
99
115
|
exports.default = useStyles;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { AttributeError } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const useCachedErrors: (allErrors: AttributeError[]) => AttributeError[];
|
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCachedErrors = void 0;
|
|
4
4
|
var react_1 = require("react");
|
|
5
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
6
|
+
var contexts_1 = require("../../contexts");
|
|
5
7
|
var helpers_1 = require("./ErrorsPanel/helpers");
|
|
6
8
|
var useCachedErrors = function (allErrors) {
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
+
var mode = (0, contexts_1.useMdmMode)();
|
|
10
|
+
var filteredErrors = (0, react_1.useMemo)(function () { return ((0, mdm_sdk_1.isViewMode)(mode) ? allErrors : allErrors.filter(function (_a) {
|
|
11
|
+
var type = _a.type;
|
|
12
|
+
return type !== mdm_sdk_1.ErrorType.rdmIssueInReference;
|
|
13
|
+
})); }, [mode, allErrors]);
|
|
14
|
+
var cacheForFilteredErrors = (0, react_1.useRef)(filteredErrors);
|
|
15
|
+
var areEqualErrors = (0, helpers_1.areErrorsEqual)(filteredErrors, cacheForFilteredErrors.current);
|
|
9
16
|
if (!areEqualErrors) {
|
|
10
|
-
|
|
17
|
+
cacheForFilteredErrors.current = filteredErrors;
|
|
11
18
|
}
|
|
12
|
-
return
|
|
19
|
+
return cacheForFilteredErrors.current;
|
|
13
20
|
};
|
|
14
21
|
exports.useCachedErrors = useCachedErrors;
|
|
@@ -47,6 +47,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
var react_1 = __importStar(require("react"));
|
|
49
49
|
var contexts_1 = require("../../contexts");
|
|
50
|
+
var core_1 = require("../../core");
|
|
50
51
|
var EntityUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
51
52
|
var value = _a.value, children = _a.children, screen = _a.screen, className = _a.className, _b = _a.shouldOpenInNewTab, shouldOpenInNewTab = _b === void 0 ? false : _b, otherProps = __rest(_a, ["value", "children", "screen", "className", "shouldOpenInNewTab"]);
|
|
52
53
|
var viewId = (0, react_1.useContext)(contexts_1.ViewIdContext);
|
|
@@ -55,9 +56,11 @@ var EntityUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
55
56
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
56
57
|
var generateEntityUrlByUri = function (uri) { return generateEntityUrl({ uiPath: uiPath, uri: uri, screen: screen }); };
|
|
57
58
|
var handleClick = (0, react_1.useCallback)(function (e) {
|
|
58
|
-
|
|
59
|
+
if (!(0, core_1.isControlOrCommandPressed)(e)) {
|
|
60
|
+
openEntity({ uri: value, viewId: viewId, screen: screen });
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
}
|
|
59
63
|
e.stopPropagation();
|
|
60
|
-
e.preventDefault();
|
|
61
64
|
}, [openEntity, screen, value, viewId]);
|
|
62
65
|
return (react_1.default.createElement("a", __assign({ ref: ref, href: generateEntityUrlByUri(value), onClick: shouldOpenInNewTab ? undefined : handleClick, target: shouldOpenInNewTab ? '_blank' : '_self', className: className }, otherProps), children));
|
|
63
66
|
});
|
|
@@ -5,11 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var styles_1 = require("./styles");
|
|
8
|
+
var core_1 = require("../../core");
|
|
8
9
|
var Link = function (_a) {
|
|
9
10
|
var to = _a.to, children = _a.children, onClick = _a.onClick;
|
|
10
11
|
var styles = (0, styles_1.useStyles)();
|
|
11
12
|
return (react_1.default.createElement("a", { href: to, onClick: function (e) {
|
|
12
|
-
if (onClick) {
|
|
13
|
+
if ((!(0, core_1.isControlOrCommandPressed)(e) || !to) && onClick) {
|
|
13
14
|
onClick();
|
|
14
15
|
e.stopPropagation();
|
|
15
16
|
e.preventDefault();
|
|
@@ -30,17 +30,21 @@ var react_1 = __importStar(require("react"));
|
|
|
30
30
|
var classnames_1 = __importDefault(require("classnames"));
|
|
31
31
|
var contexts_1 = require("../../contexts");
|
|
32
32
|
var styles_1 = require("./styles");
|
|
33
|
+
var core_1 = require("../../core");
|
|
33
34
|
var PivotingUriLink = (0, react_1.forwardRef)(function (_a, ref) {
|
|
34
35
|
var value = _a.value, attributeType = _a.attributeType, children = _a.children, className = _a.className, onClick = _a.onClick;
|
|
35
36
|
var styles = (0, styles_1.useStyles)();
|
|
36
37
|
var generatePivotingUrl = (0, react_1.useContext)(contexts_1.UrlGeneratorsContext).generatePivotingUrl;
|
|
37
38
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
38
39
|
var url = generatePivotingUrl({ uiPath: uiPath, uri: attributeType.uri, value: JSON.stringify(value) });
|
|
39
|
-
|
|
40
|
+
var handleClick = (0, react_1.useCallback)(function (e) {
|
|
41
|
+
if (!(0, core_1.isControlOrCommandPressed)(e)) {
|
|
40
42
|
onClick();
|
|
41
|
-
e.stopPropagation();
|
|
42
43
|
e.preventDefault();
|
|
43
|
-
}
|
|
44
|
+
}
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
}, [onClick]);
|
|
47
|
+
return (react_1.default.createElement("a", { ref: ref, href: url, onClick: handleClick, className: (0, classnames_1.default)(styles.link, className) }, children));
|
|
44
48
|
});
|
|
45
49
|
PivotingUriLink.displayName = 'PivotingUriLink';
|
|
46
50
|
exports.default = PivotingUriLink;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TEntityType } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
selectProps: {
|
|
5
|
+
currentEntityType: TEntityType;
|
|
6
|
+
menuIsOpen: boolean;
|
|
7
|
+
disableLinkClick: boolean;
|
|
8
|
+
};
|
|
9
|
+
children: string;
|
|
10
|
+
data: {
|
|
11
|
+
entityUri: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare const SingleValue: ({ selectProps: { currentEntityType, menuIsOpen, disableLinkClick }, children, data }: Props) => JSX.Element;
|
|
1
15
|
export default SingleValue;
|
|
2
|
-
declare function SingleValue(props: any): JSX.Element;
|
|
3
|
-
declare namespace SingleValue {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
const children: PropTypes.Requireable<string>;
|
|
6
|
-
const data: PropTypes.Validator<object>;
|
|
7
|
-
const selectProps: PropTypes.Validator<object>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
@@ -38,15 +38,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
var react_1 = __importStar(require("react"));
|
|
41
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
42
41
|
var classnames_1 = __importDefault(require("classnames"));
|
|
43
42
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
44
43
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
45
44
|
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
46
45
|
var contexts_1 = require("../../../../../contexts");
|
|
47
46
|
var styles_1 = require("./styles");
|
|
48
|
-
var
|
|
49
|
-
|
|
47
|
+
var core_1 = require("../../../../../core");
|
|
48
|
+
var SingleValue = function (_a) {
|
|
49
|
+
var _b = _a.selectProps, currentEntityType = _b.currentEntityType, menuIsOpen = _b.menuIsOpen, disableLinkClick = _b.disableLinkClick, children = _a.children, data = _a.data;
|
|
50
50
|
var styles = (0, styles_1.useSingleValueStyles)();
|
|
51
51
|
var openEntity = (0, contexts_1.useMdmAction)('openEntity');
|
|
52
52
|
var uiPath = (0, contexts_1.useMdmUiPath)();
|
|
@@ -54,8 +54,15 @@ var SingleValue = function (props) {
|
|
|
54
54
|
var generateEntityUrl = (0, react_1.useContext)(contexts_1.UrlGeneratorsContext).generateEntityUrl;
|
|
55
55
|
var handleOnMouseDown = function (event) {
|
|
56
56
|
event.stopPropagation();
|
|
57
|
-
|
|
57
|
+
};
|
|
58
|
+
var handleClick = function (event) {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
if (disableLinkClick) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
}
|
|
63
|
+
else if (!(0, core_1.isControlOrCommandPressed)(event)) {
|
|
58
64
|
openEntity({ uri: data.entityUri, viewId: viewId });
|
|
65
|
+
event.preventDefault();
|
|
59
66
|
}
|
|
60
67
|
};
|
|
61
68
|
var valueProps = (0, mdm_sdk_1.isTempUri)(data.entityUri)
|
|
@@ -66,7 +73,7 @@ var SingleValue = function (props) {
|
|
|
66
73
|
: {
|
|
67
74
|
className: (0, classnames_1.default)(styles.singleValue, styles.linkValue),
|
|
68
75
|
onMouseDown: handleOnMouseDown,
|
|
69
|
-
onClick:
|
|
76
|
+
onClick: handleClick,
|
|
70
77
|
href: generateEntityUrl({ uiPath: uiPath, uri: data.entityUri }),
|
|
71
78
|
component: 'a'
|
|
72
79
|
};
|
|
@@ -74,9 +81,4 @@ var SingleValue = function (props) {
|
|
|
74
81
|
? ui_i18n_1.default.text("New ".concat(currentEntityType.label, " will be created"))
|
|
75
82
|
: (0, mdm_sdk_1.getLabel)(children))));
|
|
76
83
|
};
|
|
77
|
-
SingleValue.propTypes = {
|
|
78
|
-
children: prop_types_1.default.string,
|
|
79
|
-
data: prop_types_1.default.object.isRequired,
|
|
80
|
-
selectProps: prop_types_1.default.object.isRequired
|
|
81
|
-
};
|
|
82
84
|
exports.default = SingleValue;
|
package/cjs/core/utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export function getValue(e: any): any;
|
|
2
|
-
export function getChecked(e: any): any;
|
|
3
|
-
export function stopPropagation(e: any): any;
|
|
4
|
-
export function noop(): void;
|
|
5
|
-
export function EmptyStub(): any;
|
|
6
|
-
export function mergeClasses(classes: any, other: any): any;
|
|
7
|
-
export function isIE(): any;
|
|
8
1
|
export function createStandardAction(type: any): (payload: any) => {
|
|
9
2
|
type: any;
|
|
10
3
|
payload: any;
|
|
11
4
|
};
|
|
12
|
-
export function
|
|
5
|
+
export function EmptyStub(): any;
|
|
6
|
+
export function getChecked(e: any): any;
|
|
7
|
+
export function isControlOrCommandPressed(e: any): any;
|
|
8
|
+
export function getValue(e: any): any;
|
|
9
|
+
export function isIE(): any;
|
|
10
|
+
export function mergeClasses(classes: any, other: any): any;
|
|
11
|
+
export function noop(): void;
|
|
13
12
|
export function parseJSON(value: any): any;
|
|
13
|
+
export function stopPropagation(e: any): any;
|
|
14
|
+
export function toggleSortOrder(order: any): "asc" | "desc";
|
package/cjs/core/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.toggleSortOrder = exports.stopPropagation = exports.parseJSON = exports.noop = exports.mergeClasses = exports.isIE = exports.getValue = exports.isControlOrCommandPressed = exports.getChecked = exports.EmptyStub = exports.createStandardAction = void 0;
|
|
18
18
|
var ramda_1 = require("ramda");
|
|
19
19
|
var classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
var getValue = function (e) { return e.target.value; };
|
|
@@ -23,6 +23,8 @@ var getChecked = function (e) { return e.target.checked; };
|
|
|
23
23
|
exports.getChecked = getChecked;
|
|
24
24
|
var stopPropagation = function (e) { return e.stopPropagation(); };
|
|
25
25
|
exports.stopPropagation = stopPropagation;
|
|
26
|
+
var isControlOrCommandPressed = function (e) { return e.ctrlKey || e.metaKey; };
|
|
27
|
+
exports.isControlOrCommandPressed = isControlOrCommandPressed;
|
|
26
28
|
var noop = function () { };
|
|
27
29
|
exports.noop = noop;
|
|
28
30
|
var EmptyStub = function () { return null; };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var SvgReadOnlyError = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ width: 12, height: 12, viewBox: "0 0 12 12", fill: "#DD2C00", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
20
|
+
react_1.default.createElement("path", { d: "M6 11.848a1.15 1.15 0 01-.445-.088 1.309 1.309 0 01-.386-.248L.487 6.832a1.31 1.31 0 01-.247-.387 1.207 1.207 0 010-.897c.058-.146.14-.272.247-.38L5.17.489c.116-.117.245-.202.386-.256a1.303 1.303 0 01.897 0 .953.953 0 01.38.256l4.68 4.68a.954.954 0 01.256.38 1.303 1.303 0 010 .897c-.054.14-.139.27-.256.386l-4.68 4.681a1.205 1.205 0 01-.831.335zm0-1.167L10.681 6 6 1.319 1.319 6 6 10.681zm-.583-4.098h1.166v-3.5H5.417v3.5zM6 8.333a.564.564 0 00.416-.167.564.564 0 00.167-.416.564.564 0 00-.167-.416A.564.564 0 006 7.167a.564.564 0 00-.416.167.564.564 0 00-.167.416c0 .165.056.304.167.416.112.111.25.167.416.167z" })));
|
|
21
|
+
};
|
|
22
|
+
exports.default = SvgReadOnlyError;
|
package/cjs/icons/index.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export { default as Ignored } from './Ignored';
|
|
|
24
24
|
export { default as IgnoredOutlined } from './IgnoredOutlined';
|
|
25
25
|
export { default as LogIn } from './LogIn';
|
|
26
26
|
export { default as LogOut } from './LogOut';
|
|
27
|
-
export { default as MlMatch } from './MlMatch';
|
|
28
27
|
export { default as Merge } from './Merge';
|
|
29
28
|
export { default as MergeDark } from './MergeDark';
|
|
29
|
+
export { default as MlMatch } from './MlMatch';
|
|
30
30
|
export { default as NegativeRuleIcon } from './NegativeRuleIcon';
|
|
31
31
|
export { default as NegativeRuleTooltipIcon } from './NegativeRuleTooltipIcon';
|
|
32
32
|
export { default as NestedAttribute } from './NestedAttribute';
|
|
@@ -35,15 +35,16 @@ export { default as NoDataSearch } from './NoDataSearch';
|
|
|
35
35
|
export { default as NoMatches } from './NoMatches';
|
|
36
36
|
export { default as NotMatchDark } from './NotMatchDark';
|
|
37
37
|
export { default as NotMatchRule } from './NotMatchRule';
|
|
38
|
-
export { default as PmIcon } from './PmIcon';
|
|
39
|
-
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
40
38
|
export { default as Pin } from './Pin';
|
|
41
39
|
export { default as PinOutlined } from './PinOutlined';
|
|
42
40
|
export { default as PivotingIcon } from './PivotingIcon';
|
|
41
|
+
export { default as PmIcon } from './PmIcon';
|
|
42
|
+
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
43
43
|
export { default as Polygon } from './Polygon';
|
|
44
44
|
export { default as PotentialMatch } from './PotentialMatch';
|
|
45
45
|
export { default as Profile } from './Profile';
|
|
46
46
|
export { default as Radius } from './Radius';
|
|
47
|
+
export { default as ReadOnlyError } from './ReadOnlyError';
|
|
47
48
|
export { default as Reassign } from './Reassign';
|
|
48
49
|
export { default as Recommended } from './Recommended';
|
|
49
50
|
export { default as ReferenceAttribute } from './ReferenceAttribute';
|
package/cjs/icons/index.js
CHANGED
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.UploadIcon = exports.UnMerge = exports.Tenant = exports.Table = exports.SimpleAttribute = exports.SelectAttributes = exports.Search = exports.ResizeIconInline = void 0;
|
|
6
|
+
exports.ReferenceAttribute = exports.Recommended = exports.Reassign = exports.ReadOnlyError = exports.Radius = exports.Profile = exports.PotentialMatch = exports.Polygon = exports.PmTaskIcon = exports.PmIcon = exports.PivotingIcon = exports.PinOutlined = exports.Pin = exports.NotMatchRule = exports.NotMatchDark = exports.NoMatches = exports.NoDataSearch = exports.NoData = exports.NestedAttribute = exports.NegativeRuleTooltipIcon = exports.NegativeRuleIcon = exports.MlMatch = exports.MergeDark = exports.Merge = exports.LogOut = exports.LogIn = exports.IgnoredOutlined = exports.Ignored = exports.Hyperlink = exports.Filter = exports.Error = exports.EmptySearchResults = exports.Duplicate = exports.Draw = exports.Download = exports.Details = exports.Description = exports.DeleteRequestTaskIcon = exports.DefaultTaskIcon = exports.DefaultImage = exports.DcrTaskIcon = exports.Create = exports.Copy = exports.CommentBubble = exports.Comment = exports.CollaborationIcon = exports.Calendar = exports.AttributesList = exports.AddComment = exports.Add = void 0;
|
|
7
|
+
exports.UploadIcon = exports.UnMerge = exports.Tenant = exports.Table = exports.SimpleAttribute = exports.SelectAttributes = exports.Search = exports.ResizeIconInline = exports.Remove = void 0;
|
|
8
8
|
var Add_1 = require("./Add");
|
|
9
9
|
Object.defineProperty(exports, "Add", { enumerable: true, get: function () { return __importDefault(Add_1).default; } });
|
|
10
10
|
var AddComment_1 = require("./AddComment");
|
|
@@ -57,12 +57,12 @@ var LogIn_1 = require("./LogIn");
|
|
|
57
57
|
Object.defineProperty(exports, "LogIn", { enumerable: true, get: function () { return __importDefault(LogIn_1).default; } });
|
|
58
58
|
var LogOut_1 = require("./LogOut");
|
|
59
59
|
Object.defineProperty(exports, "LogOut", { enumerable: true, get: function () { return __importDefault(LogOut_1).default; } });
|
|
60
|
-
var MlMatch_1 = require("./MlMatch");
|
|
61
|
-
Object.defineProperty(exports, "MlMatch", { enumerable: true, get: function () { return __importDefault(MlMatch_1).default; } });
|
|
62
60
|
var Merge_1 = require("./Merge");
|
|
63
61
|
Object.defineProperty(exports, "Merge", { enumerable: true, get: function () { return __importDefault(Merge_1).default; } });
|
|
64
62
|
var MergeDark_1 = require("./MergeDark");
|
|
65
63
|
Object.defineProperty(exports, "MergeDark", { enumerable: true, get: function () { return __importDefault(MergeDark_1).default; } });
|
|
64
|
+
var MlMatch_1 = require("./MlMatch");
|
|
65
|
+
Object.defineProperty(exports, "MlMatch", { enumerable: true, get: function () { return __importDefault(MlMatch_1).default; } });
|
|
66
66
|
var NegativeRuleIcon_1 = require("./NegativeRuleIcon");
|
|
67
67
|
Object.defineProperty(exports, "NegativeRuleIcon", { enumerable: true, get: function () { return __importDefault(NegativeRuleIcon_1).default; } });
|
|
68
68
|
var NegativeRuleTooltipIcon_1 = require("./NegativeRuleTooltipIcon");
|
|
@@ -79,16 +79,16 @@ var NotMatchDark_1 = require("./NotMatchDark");
|
|
|
79
79
|
Object.defineProperty(exports, "NotMatchDark", { enumerable: true, get: function () { return __importDefault(NotMatchDark_1).default; } });
|
|
80
80
|
var NotMatchRule_1 = require("./NotMatchRule");
|
|
81
81
|
Object.defineProperty(exports, "NotMatchRule", { enumerable: true, get: function () { return __importDefault(NotMatchRule_1).default; } });
|
|
82
|
-
var PmIcon_1 = require("./PmIcon");
|
|
83
|
-
Object.defineProperty(exports, "PmIcon", { enumerable: true, get: function () { return __importDefault(PmIcon_1).default; } });
|
|
84
|
-
var PmTaskIcon_1 = require("./PmTaskIcon");
|
|
85
|
-
Object.defineProperty(exports, "PmTaskIcon", { enumerable: true, get: function () { return __importDefault(PmTaskIcon_1).default; } });
|
|
86
82
|
var Pin_1 = require("./Pin");
|
|
87
83
|
Object.defineProperty(exports, "Pin", { enumerable: true, get: function () { return __importDefault(Pin_1).default; } });
|
|
88
84
|
var PinOutlined_1 = require("./PinOutlined");
|
|
89
85
|
Object.defineProperty(exports, "PinOutlined", { enumerable: true, get: function () { return __importDefault(PinOutlined_1).default; } });
|
|
90
86
|
var PivotingIcon_1 = require("./PivotingIcon");
|
|
91
87
|
Object.defineProperty(exports, "PivotingIcon", { enumerable: true, get: function () { return __importDefault(PivotingIcon_1).default; } });
|
|
88
|
+
var PmIcon_1 = require("./PmIcon");
|
|
89
|
+
Object.defineProperty(exports, "PmIcon", { enumerable: true, get: function () { return __importDefault(PmIcon_1).default; } });
|
|
90
|
+
var PmTaskIcon_1 = require("./PmTaskIcon");
|
|
91
|
+
Object.defineProperty(exports, "PmTaskIcon", { enumerable: true, get: function () { return __importDefault(PmTaskIcon_1).default; } });
|
|
92
92
|
var Polygon_1 = require("./Polygon");
|
|
93
93
|
Object.defineProperty(exports, "Polygon", { enumerable: true, get: function () { return __importDefault(Polygon_1).default; } });
|
|
94
94
|
var PotentialMatch_1 = require("./PotentialMatch");
|
|
@@ -97,6 +97,8 @@ var Profile_1 = require("./Profile");
|
|
|
97
97
|
Object.defineProperty(exports, "Profile", { enumerable: true, get: function () { return __importDefault(Profile_1).default; } });
|
|
98
98
|
var Radius_1 = require("./Radius");
|
|
99
99
|
Object.defineProperty(exports, "Radius", { enumerable: true, get: function () { return __importDefault(Radius_1).default; } });
|
|
100
|
+
var ReadOnlyError_1 = require("./ReadOnlyError");
|
|
101
|
+
Object.defineProperty(exports, "ReadOnlyError", { enumerable: true, get: function () { return __importDefault(ReadOnlyError_1).default; } });
|
|
100
102
|
var Reassign_1 = require("./Reassign");
|
|
101
103
|
Object.defineProperty(exports, "Reassign", { enumerable: true, get: function () { return __importDefault(Reassign_1).default; } });
|
|
102
104
|
var Recommended_1 = require("./Recommended");
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React, { memo, useContext } from 'react';
|
|
2
2
|
import i18n from 'ui-i18n';
|
|
3
|
+
import { ErrorType } from '@reltio/mdm-sdk';
|
|
4
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
3
5
|
import HyperlinkIcon from '../../../icons/Hyperlink';
|
|
4
6
|
import { SmallIconButtonWithTooltip } from '../../SmallIconButton';
|
|
5
7
|
import { ScrollToElementContext, useMdmIsEditableMode, useMdmMetadata } from '../../../contexts';
|
|
6
8
|
import { getDisplayedAttributeTypesPath, getDisplayedErrorMessage, getDisplayedErrorPath } from './helpers';
|
|
9
|
+
import { ReadOnlyError } from '../../../icons';
|
|
7
10
|
import useStyles from '../styles';
|
|
8
11
|
export var Error = memo(function (_a) {
|
|
9
12
|
var error = _a.error;
|
|
@@ -15,7 +18,10 @@ export var Error = memo(function (_a) {
|
|
|
15
18
|
var displayedAttributeTypesPath = getDisplayedAttributeTypesPath(error);
|
|
16
19
|
var highlightError = useContext(ScrollToElementContext).highlightError;
|
|
17
20
|
var showLink = error.uri || (error.parentUri && error.attributeTypeUri);
|
|
18
|
-
return (React.createElement("
|
|
21
|
+
return (React.createElement("div", { className: styles.errorListItem },
|
|
22
|
+
React.createElement("div", { className: styles.listItemMarker }, error.type === ErrorType.rdmIssueInReference ? (React.createElement(Tooltip, { title: i18n.text('This error is visible only in view mode') },
|
|
23
|
+
React.createElement("span", null,
|
|
24
|
+
React.createElement(ReadOnlyError, { className: styles.errorIcon })))) : (React.createElement("div", { className: styles.discIcon }))),
|
|
19
25
|
React.createElement("div", { className: styles.errorWrapper },
|
|
20
26
|
displayedAttributeTypesPath && (React.createElement("span", { className: styles.attributeTypesPath }, displayedAttributeTypesPath)),
|
|
21
27
|
React.createElement("span", { className: styles.errorTitle },
|
|
@@ -19,8 +19,7 @@ export var ErrorsPanel = memo(function (_a) {
|
|
|
19
19
|
}, expandIcon: React.createElement(ExpandMoreIcon, null) },
|
|
20
20
|
icon,
|
|
21
21
|
React.createElement(Typography, { className: styles.accordionSummaryHeading }, title)),
|
|
22
|
-
React.createElement(AccordionDetails, { className: classnames(styles.accordionDetails, accordionDetailsClassName) },
|
|
23
|
-
React.createElement("ul", null, items.map(function (error, i) { return (React.createElement(ErrorComponent, { key: i, error: error })); })))));
|
|
22
|
+
React.createElement(AccordionDetails, { className: classnames(styles.accordionDetails, accordionDetailsClassName) }, items.map(function (error, i) { return (React.createElement(ErrorComponent, { key: i, error: error })); }))));
|
|
24
23
|
}))) : null;
|
|
25
24
|
});
|
|
26
25
|
ErrorsPanel.displayName = 'ErrorsPanel';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon" | "parents" | "errorWrapper" | "accordion" | "accordionExpanded" | "accordionSummary" | "accordionSummaryHeading" | "accordionSummaryExpanded" | "accordionSummaryContent" | "accordionDetails" | "errorTitle" | "attributeTypesPath" | "goToIcon" | "errorsAccordion" | "errorsAccordionDetails" | "warningsAccordion" | "warningsAccordionDetails" | "errorIcon" | "warningIcon">;
|
|
1
|
+
declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon" | "parents" | "errorWrapper" | "accordion" | "accordionExpanded" | "accordionSummary" | "accordionSummaryHeading" | "accordionSummaryExpanded" | "accordionSummaryContent" | "accordionDetails" | "errorTitle" | "attributeTypesPath" | "goToIcon" | "errorsAccordion" | "errorsAccordionDetails" | "warningsAccordion" | "warningsAccordionDetails" | "errorIcon" | "warningIcon" | "errorListItem" | "listItemMarker" | "discIcon">;
|
|
2
2
|
export default useStyles;
|
|
@@ -41,24 +41,19 @@ var useStyles = makeStyles(function (theme) { return ({
|
|
|
41
41
|
accordionDetails: {
|
|
42
42
|
maxHeight: '21vh',
|
|
43
43
|
overflow: 'auto',
|
|
44
|
-
paddingTop:
|
|
45
|
-
paddingBottom:
|
|
46
|
-
'& ul': {
|
|
47
|
-
paddingLeft: '23px',
|
|
48
|
-
marginTop: '3px'
|
|
49
|
-
},
|
|
50
|
-
'& li': {
|
|
51
|
-
paddingLeft: '9px',
|
|
52
|
-
paddingBottom: '8px'
|
|
53
|
-
}
|
|
44
|
+
paddingTop: '3px',
|
|
45
|
+
paddingBottom: '8px'
|
|
54
46
|
},
|
|
55
47
|
parents: {
|
|
56
48
|
color: theme.palette.text.primary
|
|
57
49
|
},
|
|
58
50
|
errorWrapper: {
|
|
51
|
+
flex: 1,
|
|
59
52
|
lineHeight: '18px',
|
|
60
53
|
display: 'flex',
|
|
61
|
-
flexDirection: 'column'
|
|
54
|
+
flexDirection: 'column',
|
|
55
|
+
paddingLeft: '8px',
|
|
56
|
+
paddingBottom: '8px'
|
|
62
57
|
},
|
|
63
58
|
errorTitle: {
|
|
64
59
|
display: 'flex',
|
|
@@ -92,6 +87,27 @@ var useStyles = makeStyles(function (theme) { return ({
|
|
|
92
87
|
},
|
|
93
88
|
warningIcon: {
|
|
94
89
|
fill: '#F9A825'
|
|
90
|
+
},
|
|
91
|
+
errorListItem: {
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'flex-start',
|
|
94
|
+
'& svg': {
|
|
95
|
+
fill: 'currentColor'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
listItemMarker: {
|
|
99
|
+
flexShrink: 0,
|
|
100
|
+
width: '24px',
|
|
101
|
+
marginTop: '3px',
|
|
102
|
+
display: 'flex',
|
|
103
|
+
justifyContent: 'center'
|
|
104
|
+
},
|
|
105
|
+
discIcon: {
|
|
106
|
+
height: '4px',
|
|
107
|
+
width: '4px',
|
|
108
|
+
backgroundColor: 'currentColor',
|
|
109
|
+
borderRadius: '50%',
|
|
110
|
+
marginTop: '4px'
|
|
95
111
|
}
|
|
96
112
|
}); });
|
|
97
113
|
export default useStyles;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { AttributeError } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const useCachedErrors: (allErrors: AttributeError[]) => AttributeError[];
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
1
|
+
import { useRef, useMemo } from 'react';
|
|
2
|
+
import { ErrorType, isViewMode } from '@reltio/mdm-sdk';
|
|
3
|
+
import { useMdmMode } from '../../contexts';
|
|
2
4
|
import { areErrorsEqual } from './ErrorsPanel/helpers';
|
|
3
5
|
export var useCachedErrors = function (allErrors) {
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
+
var mode = useMdmMode();
|
|
7
|
+
var filteredErrors = useMemo(function () { return (isViewMode(mode) ? allErrors : allErrors.filter(function (_a) {
|
|
8
|
+
var type = _a.type;
|
|
9
|
+
return type !== ErrorType.rdmIssueInReference;
|
|
10
|
+
})); }, [mode, allErrors]);
|
|
11
|
+
var cacheForFilteredErrors = useRef(filteredErrors);
|
|
12
|
+
var areEqualErrors = areErrorsEqual(filteredErrors, cacheForFilteredErrors.current);
|
|
6
13
|
if (!areEqualErrors) {
|
|
7
|
-
|
|
14
|
+
cacheForFilteredErrors.current = filteredErrors;
|
|
8
15
|
}
|
|
9
|
-
return
|
|
16
|
+
return cacheForFilteredErrors.current;
|
|
10
17
|
};
|
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { forwardRef, useCallback, useContext } from 'react';
|
|
24
24
|
import { ViewIdContext, UrlGeneratorsContext, useMdmUiPath, useMdmAction } from '../../contexts';
|
|
25
|
+
import { isControlOrCommandPressed } from '../../core';
|
|
25
26
|
var EntityUriLink = forwardRef(function (_a, ref) {
|
|
26
27
|
var value = _a.value, children = _a.children, screen = _a.screen, className = _a.className, _b = _a.shouldOpenInNewTab, shouldOpenInNewTab = _b === void 0 ? false : _b, otherProps = __rest(_a, ["value", "children", "screen", "className", "shouldOpenInNewTab"]);
|
|
27
28
|
var viewId = useContext(ViewIdContext);
|
|
@@ -30,9 +31,11 @@ var EntityUriLink = forwardRef(function (_a, ref) {
|
|
|
30
31
|
var uiPath = useMdmUiPath();
|
|
31
32
|
var generateEntityUrlByUri = function (uri) { return generateEntityUrl({ uiPath: uiPath, uri: uri, screen: screen }); };
|
|
32
33
|
var handleClick = useCallback(function (e) {
|
|
33
|
-
|
|
34
|
+
if (!isControlOrCommandPressed(e)) {
|
|
35
|
+
openEntity({ uri: value, viewId: viewId, screen: screen });
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
}
|
|
34
38
|
e.stopPropagation();
|
|
35
|
-
e.preventDefault();
|
|
36
39
|
}, [openEntity, screen, value, viewId]);
|
|
37
40
|
return (React.createElement("a", __assign({ ref: ref, href: generateEntityUrlByUri(value), onClick: shouldOpenInNewTab ? undefined : handleClick, target: shouldOpenInNewTab ? '_blank' : '_self', className: className }, otherProps), children));
|
|
38
41
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useStyles } from './styles';
|
|
3
|
+
import { isControlOrCommandPressed } from '../../core';
|
|
3
4
|
var Link = function (_a) {
|
|
4
5
|
var to = _a.to, children = _a.children, onClick = _a.onClick;
|
|
5
6
|
var styles = useStyles();
|
|
6
7
|
return (React.createElement("a", { href: to, onClick: function (e) {
|
|
7
|
-
if (onClick) {
|
|
8
|
+
if ((!isControlOrCommandPressed(e) || !to) && onClick) {
|
|
8
9
|
onClick();
|
|
9
10
|
e.stopPropagation();
|
|
10
11
|
e.preventDefault();
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import React, { forwardRef, useContext } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, useContext } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { UrlGeneratorsContext, useMdmUiPath } from '../../contexts';
|
|
4
4
|
import { useStyles } from './styles';
|
|
5
|
+
import { isControlOrCommandPressed } from '../../core';
|
|
5
6
|
var PivotingUriLink = forwardRef(function (_a, ref) {
|
|
6
7
|
var value = _a.value, attributeType = _a.attributeType, children = _a.children, className = _a.className, onClick = _a.onClick;
|
|
7
8
|
var styles = useStyles();
|
|
8
9
|
var generatePivotingUrl = useContext(UrlGeneratorsContext).generatePivotingUrl;
|
|
9
10
|
var uiPath = useMdmUiPath();
|
|
10
11
|
var url = generatePivotingUrl({ uiPath: uiPath, uri: attributeType.uri, value: JSON.stringify(value) });
|
|
11
|
-
|
|
12
|
+
var handleClick = useCallback(function (e) {
|
|
13
|
+
if (!isControlOrCommandPressed(e)) {
|
|
12
14
|
onClick();
|
|
13
|
-
e.stopPropagation();
|
|
14
15
|
e.preventDefault();
|
|
15
|
-
}
|
|
16
|
+
}
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
}, [onClick]);
|
|
19
|
+
return (React.createElement("a", { ref: ref, href: url, onClick: handleClick, className: classnames(styles.link, className) }, children));
|
|
16
20
|
});
|
|
17
21
|
PivotingUriLink.displayName = 'PivotingUriLink';
|
|
18
22
|
export default PivotingUriLink;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TEntityType } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
selectProps: {
|
|
5
|
+
currentEntityType: TEntityType;
|
|
6
|
+
menuIsOpen: boolean;
|
|
7
|
+
disableLinkClick: boolean;
|
|
8
|
+
};
|
|
9
|
+
children: string;
|
|
10
|
+
data: {
|
|
11
|
+
entityUri: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare const SingleValue: ({ selectProps: { currentEntityType, menuIsOpen, disableLinkClick }, children, data }: Props) => JSX.Element;
|
|
1
15
|
export default SingleValue;
|
|
2
|
-
declare function SingleValue(props: any): JSX.Element;
|
|
3
|
-
declare namespace SingleValue {
|
|
4
|
-
namespace propTypes {
|
|
5
|
-
const children: PropTypes.Requireable<string>;
|
|
6
|
-
const data: PropTypes.Validator<object>;
|
|
7
|
-
const selectProps: PropTypes.Validator<object>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
@@ -10,15 +10,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React, { useContext } from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import classnames from 'classnames';
|
|
15
14
|
import i18n from 'ui-i18n';
|
|
16
15
|
import { getLabel, isTempUri } from '@reltio/mdm-sdk';
|
|
17
16
|
import Typography from '@mui/material/Typography';
|
|
18
17
|
import { ViewIdContext, UrlGeneratorsContext, useMdmUiPath, useMdmAction } from '../../../../../contexts';
|
|
19
18
|
import { useSingleValueStyles } from './styles';
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
import { isControlOrCommandPressed } from '../../../../../core';
|
|
20
|
+
var SingleValue = function (_a) {
|
|
21
|
+
var _b = _a.selectProps, currentEntityType = _b.currentEntityType, menuIsOpen = _b.menuIsOpen, disableLinkClick = _b.disableLinkClick, children = _a.children, data = _a.data;
|
|
22
22
|
var styles = useSingleValueStyles();
|
|
23
23
|
var openEntity = useMdmAction('openEntity');
|
|
24
24
|
var uiPath = useMdmUiPath();
|
|
@@ -26,8 +26,15 @@ var SingleValue = function (props) {
|
|
|
26
26
|
var generateEntityUrl = useContext(UrlGeneratorsContext).generateEntityUrl;
|
|
27
27
|
var handleOnMouseDown = function (event) {
|
|
28
28
|
event.stopPropagation();
|
|
29
|
-
|
|
29
|
+
};
|
|
30
|
+
var handleClick = function (event) {
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
if (disableLinkClick) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
}
|
|
35
|
+
else if (!isControlOrCommandPressed(event)) {
|
|
30
36
|
openEntity({ uri: data.entityUri, viewId: viewId });
|
|
37
|
+
event.preventDefault();
|
|
31
38
|
}
|
|
32
39
|
};
|
|
33
40
|
var valueProps = isTempUri(data.entityUri)
|
|
@@ -38,7 +45,7 @@ var SingleValue = function (props) {
|
|
|
38
45
|
: {
|
|
39
46
|
className: classnames(styles.singleValue, styles.linkValue),
|
|
40
47
|
onMouseDown: handleOnMouseDown,
|
|
41
|
-
onClick:
|
|
48
|
+
onClick: handleClick,
|
|
42
49
|
href: generateEntityUrl({ uiPath: uiPath, uri: data.entityUri }),
|
|
43
50
|
component: 'a'
|
|
44
51
|
};
|
|
@@ -46,9 +53,4 @@ var SingleValue = function (props) {
|
|
|
46
53
|
? i18n.text("New ".concat(currentEntityType.label, " will be created"))
|
|
47
54
|
: getLabel(children))));
|
|
48
55
|
};
|
|
49
|
-
SingleValue.propTypes = {
|
|
50
|
-
children: PropTypes.string,
|
|
51
|
-
data: PropTypes.object.isRequired,
|
|
52
|
-
selectProps: PropTypes.object.isRequired
|
|
53
|
-
};
|
|
54
56
|
export default SingleValue;
|
package/esm/core/utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export function getValue(e: any): any;
|
|
2
|
-
export function getChecked(e: any): any;
|
|
3
|
-
export function stopPropagation(e: any): any;
|
|
4
|
-
export function noop(): void;
|
|
5
|
-
export function EmptyStub(): any;
|
|
6
|
-
export function mergeClasses(classes: any, other: any): any;
|
|
7
|
-
export function isIE(): any;
|
|
8
1
|
export function createStandardAction(type: any): (payload: any) => {
|
|
9
2
|
type: any;
|
|
10
3
|
payload: any;
|
|
11
4
|
};
|
|
12
|
-
export function
|
|
5
|
+
export function EmptyStub(): any;
|
|
6
|
+
export function getChecked(e: any): any;
|
|
7
|
+
export function isControlOrCommandPressed(e: any): any;
|
|
8
|
+
export function getValue(e: any): any;
|
|
9
|
+
export function isIE(): any;
|
|
10
|
+
export function mergeClasses(classes: any, other: any): any;
|
|
11
|
+
export function noop(): void;
|
|
13
12
|
export function parseJSON(value: any): any;
|
|
13
|
+
export function stopPropagation(e: any): any;
|
|
14
|
+
export function toggleSortOrder(order: any): "asc" | "desc";
|
package/esm/core/utils.js
CHANGED
|
@@ -14,6 +14,7 @@ import classNames from 'classnames';
|
|
|
14
14
|
var getValue = function (e) { return e.target.value; };
|
|
15
15
|
var getChecked = function (e) { return e.target.checked; };
|
|
16
16
|
var stopPropagation = function (e) { return e.stopPropagation(); };
|
|
17
|
+
var isControlOrCommandPressed = function (e) { return e.ctrlKey || e.metaKey; };
|
|
17
18
|
var noop = function () { };
|
|
18
19
|
var EmptyStub = function () { return null; };
|
|
19
20
|
var mergeClasses = function (classes, other) {
|
|
@@ -36,4 +37,4 @@ var parseJSON = function (value) {
|
|
|
36
37
|
return undefined;
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
export {
|
|
40
|
+
export { createStandardAction, EmptyStub, getChecked, isControlOrCommandPressed, getValue, isIE, mergeClasses, noop, parseJSON, stopPropagation, toggleSortOrder };
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
import React from 'react';
|
|
13
|
+
var SvgReadOnlyError = function (props) {
|
|
14
|
+
return (React.createElement("svg", __assign({ width: 12, height: 12, viewBox: "0 0 12 12", fill: "#DD2C00", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
15
|
+
React.createElement("path", { d: "M6 11.848a1.15 1.15 0 01-.445-.088 1.309 1.309 0 01-.386-.248L.487 6.832a1.31 1.31 0 01-.247-.387 1.207 1.207 0 010-.897c.058-.146.14-.272.247-.38L5.17.489c.116-.117.245-.202.386-.256a1.303 1.303 0 01.897 0 .953.953 0 01.38.256l4.68 4.68a.954.954 0 01.256.38 1.303 1.303 0 010 .897c-.054.14-.139.27-.256.386l-4.68 4.681a1.205 1.205 0 01-.831.335zm0-1.167L10.681 6 6 1.319 1.319 6 6 10.681zm-.583-4.098h1.166v-3.5H5.417v3.5zM6 8.333a.564.564 0 00.416-.167.564.564 0 00.167-.416.564.564 0 00-.167-.416A.564.564 0 006 7.167a.564.564 0 00-.416.167.564.564 0 00-.167.416c0 .165.056.304.167.416.112.111.25.167.416.167z" })));
|
|
16
|
+
};
|
|
17
|
+
export default SvgReadOnlyError;
|
package/esm/icons/index.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export { default as Ignored } from './Ignored';
|
|
|
24
24
|
export { default as IgnoredOutlined } from './IgnoredOutlined';
|
|
25
25
|
export { default as LogIn } from './LogIn';
|
|
26
26
|
export { default as LogOut } from './LogOut';
|
|
27
|
-
export { default as MlMatch } from './MlMatch';
|
|
28
27
|
export { default as Merge } from './Merge';
|
|
29
28
|
export { default as MergeDark } from './MergeDark';
|
|
29
|
+
export { default as MlMatch } from './MlMatch';
|
|
30
30
|
export { default as NegativeRuleIcon } from './NegativeRuleIcon';
|
|
31
31
|
export { default as NegativeRuleTooltipIcon } from './NegativeRuleTooltipIcon';
|
|
32
32
|
export { default as NestedAttribute } from './NestedAttribute';
|
|
@@ -35,15 +35,16 @@ export { default as NoDataSearch } from './NoDataSearch';
|
|
|
35
35
|
export { default as NoMatches } from './NoMatches';
|
|
36
36
|
export { default as NotMatchDark } from './NotMatchDark';
|
|
37
37
|
export { default as NotMatchRule } from './NotMatchRule';
|
|
38
|
-
export { default as PmIcon } from './PmIcon';
|
|
39
|
-
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
40
38
|
export { default as Pin } from './Pin';
|
|
41
39
|
export { default as PinOutlined } from './PinOutlined';
|
|
42
40
|
export { default as PivotingIcon } from './PivotingIcon';
|
|
41
|
+
export { default as PmIcon } from './PmIcon';
|
|
42
|
+
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
43
43
|
export { default as Polygon } from './Polygon';
|
|
44
44
|
export { default as PotentialMatch } from './PotentialMatch';
|
|
45
45
|
export { default as Profile } from './Profile';
|
|
46
46
|
export { default as Radius } from './Radius';
|
|
47
|
+
export { default as ReadOnlyError } from './ReadOnlyError';
|
|
47
48
|
export { default as Reassign } from './Reassign';
|
|
48
49
|
export { default as Recommended } from './Recommended';
|
|
49
50
|
export { default as ReferenceAttribute } from './ReferenceAttribute';
|
package/esm/icons/index.js
CHANGED
|
@@ -24,9 +24,9 @@ export { default as Ignored } from './Ignored';
|
|
|
24
24
|
export { default as IgnoredOutlined } from './IgnoredOutlined';
|
|
25
25
|
export { default as LogIn } from './LogIn';
|
|
26
26
|
export { default as LogOut } from './LogOut';
|
|
27
|
-
export { default as MlMatch } from './MlMatch';
|
|
28
27
|
export { default as Merge } from './Merge';
|
|
29
28
|
export { default as MergeDark } from './MergeDark';
|
|
29
|
+
export { default as MlMatch } from './MlMatch';
|
|
30
30
|
export { default as NegativeRuleIcon } from './NegativeRuleIcon';
|
|
31
31
|
export { default as NegativeRuleTooltipIcon } from './NegativeRuleTooltipIcon';
|
|
32
32
|
export { default as NestedAttribute } from './NestedAttribute';
|
|
@@ -35,15 +35,16 @@ export { default as NoDataSearch } from './NoDataSearch';
|
|
|
35
35
|
export { default as NoMatches } from './NoMatches';
|
|
36
36
|
export { default as NotMatchDark } from './NotMatchDark';
|
|
37
37
|
export { default as NotMatchRule } from './NotMatchRule';
|
|
38
|
-
export { default as PmIcon } from './PmIcon';
|
|
39
|
-
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
40
38
|
export { default as Pin } from './Pin';
|
|
41
39
|
export { default as PinOutlined } from './PinOutlined';
|
|
42
40
|
export { default as PivotingIcon } from './PivotingIcon';
|
|
41
|
+
export { default as PmIcon } from './PmIcon';
|
|
42
|
+
export { default as PmTaskIcon } from './PmTaskIcon';
|
|
43
43
|
export { default as Polygon } from './Polygon';
|
|
44
44
|
export { default as PotentialMatch } from './PotentialMatch';
|
|
45
45
|
export { default as Profile } from './Profile';
|
|
46
46
|
export { default as Radius } from './Radius';
|
|
47
|
+
export { default as ReadOnlyError } from './ReadOnlyError';
|
|
47
48
|
export { default as Reassign } from './Reassign';
|
|
48
49
|
export { default as Recommended } from './Recommended';
|
|
49
50
|
export { default as ReferenceAttribute } from './ReferenceAttribute';
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1723",
|
|
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
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-sdk": "^1.4.1712",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"d3-cloud": "^1.2.5",
|
|
13
13
|
"d3-geo": "^2.0.1",
|