@reltio/components 1.4.1202 → 1.4.1207

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.
Files changed (25) hide show
  1. package/cjs/components/DropDownMenuButton/DropDownMenuButton.d.ts +2 -2
  2. package/cjs/components/DropDownMenuButton/MenuItemRenderer.d.ts +2 -8
  3. package/cjs/components/DropDownMenuButton/MenuItemRenderer.js +3 -1
  4. package/cjs/components/MergeButton/MergeButton.js +1 -1
  5. package/cjs/components/NotMatchButton/NotMatchButton.js +1 -1
  6. package/cjs/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.d.ts +1 -0
  7. package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +3 -0
  8. package/cjs/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.js +8 -10
  9. package/cjs/components/attributes/readMode/SimpleAttribute/SimpleAttribute.js +9 -7
  10. package/cjs/components/attributes/readMode/helpers/commonStyles.d.ts +1 -0
  11. package/cjs/components/attributes/readMode/helpers/commonStyles.js +7 -0
  12. package/cjs/types/index.d.ts +17 -0
  13. package/esm/components/DropDownMenuButton/DropDownMenuButton.d.ts +2 -2
  14. package/esm/components/DropDownMenuButton/MenuItemRenderer.d.ts +2 -8
  15. package/esm/components/DropDownMenuButton/MenuItemRenderer.js +3 -1
  16. package/esm/components/MergeButton/MergeButton.js +1 -1
  17. package/esm/components/NotMatchButton/NotMatchButton.js +1 -1
  18. package/esm/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.d.ts +1 -0
  19. package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +4 -1
  20. package/esm/components/attributes/readMode/ReferenceAttribute/ReferenceAttribute.js +9 -11
  21. package/esm/components/attributes/readMode/SimpleAttribute/SimpleAttribute.js +10 -8
  22. package/esm/components/attributes/readMode/helpers/commonStyles.d.ts +1 -0
  23. package/esm/components/attributes/readMode/helpers/commonStyles.js +4 -0
  24. package/esm/types/index.d.ts +17 -0
  25. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MenuProps } from '@material-ui/core/Menu';
3
- import { Item } from './MenuItemRenderer';
3
+ import { DropDownMenuItem } from '../../types';
4
4
  declare type Props<T> = {
5
5
  className?: string;
6
6
  buttonComponent?: React.ElementType;
@@ -13,7 +13,7 @@ declare type Props<T> = {
13
13
  onMenuClose?: () => void;
14
14
  MenuItemRenderer?: (props: any) => JSX.Element;
15
15
  };
16
- declare function DropDownMenuButton<T = Item>({ className, menuId, buttonComponent, buttonContent, menuItems, buttonProps, popoverProps, onMenuOpen, onMenuClose, MenuItemRenderer }: Props<T>): JSX.Element;
16
+ declare function DropDownMenuButton<T = DropDownMenuItem>({ className, menuId, buttonComponent, buttonContent, menuItems, buttonProps, popoverProps, onMenuOpen, onMenuClose, MenuItemRenderer }: Props<T>): JSX.Element;
17
17
  declare namespace DropDownMenuButton {
18
18
  var displayName: string;
19
19
  }
@@ -1,13 +1,7 @@
1
1
  import React from 'react';
2
- export declare type Item = {
3
- text?: string;
4
- disabled?: boolean;
5
- tooltip?: string;
6
- id?: string;
7
- onClick?: (e: any) => void;
8
- };
2
+ import { DropDownMenuItem } from '../../types';
9
3
  declare type Props = {
10
- item: Item;
4
+ item: DropDownMenuItem;
11
5
  onMenuClose?: (e: any) => void;
12
6
  };
13
7
  declare const MenuItemRenderer: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
@@ -24,6 +24,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var react_1 = __importStar(require("react"));
26
26
  var ramda_1 = require("ramda");
27
+ var Checkbox_1 = __importDefault(require("@material-ui/core/Checkbox"));
27
28
  var MenuItem_1 = __importDefault(require("@material-ui/core/MenuItem"));
28
29
  var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
29
30
  var withTooltip_1 = __importDefault(require("../../HOCs/withTooltip/withTooltip"));
@@ -32,12 +33,13 @@ var MenuItemWithTooltip = withTooltip_1.default(MenuItem_1.default);
32
33
  var MenuItemRenderer = react_1.forwardRef(function (_a, ref) {
33
34
  var item = _a.item, _b = _a.onMenuClose, onMenuClose = _b === void 0 ? ramda_1.identity : _b;
34
35
  var styles = styles_1.useStyles();
35
- var disabled = item.disabled, text = item.text, tooltip = item.tooltip, onClick = item.onClick, _c = item.id, id = _c === void 0 ? '' : _c;
36
+ var disabled = item.disabled, text = item.text, tooltip = item.tooltip, onClick = item.onClick, _c = item.id, id = _c === void 0 ? '' : _c, selectable = item.selectable, selected = item.selected;
36
37
  var handleClick = function (e) {
37
38
  onMenuClose(e);
38
39
  onClick(e);
39
40
  };
40
41
  return (react_1.default.createElement(MenuItemWithTooltip, { tooltipTitle: tooltip, showForDisabled: true, classes: { root: styles.menuItem }, onClick: handleClick, disabled: disabled, ref: ref, "data-modal": true, "data-reltio-id": "reltio-search-menu-item" + id },
42
+ selectable && react_1.default.createElement(Checkbox_1.default, { checked: selected, color: "primary" }),
41
43
  react_1.default.createElement(Typography_1.default, { classes: { root: styles.menuText } }, text)));
42
44
  });
43
45
  MenuItemRenderer.displayName = 'MenuItemRenderer';
@@ -61,6 +61,6 @@ exports.MergeButton = react_1.forwardRef(function (_a, ref) {
61
61
  onError: onError,
62
62
  onSuccess: onSuccess
63
63
  }).sendMergeAllRequest;
64
- return (react_1.default.createElement(ActionButton_1.ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: disabled ? '' : ui_i18n_1.default.text('Merge'), icon: MergeDark_1.default, onClick: sendMergeAllRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
64
+ return (react_1.default.createElement(ActionButton_1.ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: ui_i18n_1.default.text('Merge'), icon: MergeDark_1.default, onClick: sendMergeAllRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
65
65
  });
66
66
  exports.MergeButton.displayName = 'mergeButton';
@@ -60,6 +60,6 @@ exports.NotMatchButton = react_1.forwardRef(function (_a, ref) {
60
60
  onFinishRequest: onFinishRequest,
61
61
  onSuccess: onSuccess
62
62
  }).sendMarkAsNotMatchRequest;
63
- return (react_1.default.createElement(ActionButton_1.ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: disabled ? '' : ui_i18n_1.default.text('Not a match'), icon: NotMatchDark_1.default, onClick: sendMarkAsNotMatchRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
63
+ return (react_1.default.createElement(ActionButton_1.ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: ui_i18n_1.default.text('Not a match'), icon: NotMatchDark_1.default, onClick: sendMarkAsNotMatchRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
64
64
  });
65
65
  exports.NotMatchButton.displayName = 'notMatchButton';
@@ -9,6 +9,7 @@ declare type Props = {
9
9
  attributeType: any;
10
10
  attributeValue: any;
11
11
  }) => JSX.Element;
12
+ showNonOv?: boolean;
12
13
  };
13
14
  declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, ...props }: Props) => JSX.Element>;
14
15
  export default _default;
@@ -44,10 +44,12 @@ var CommentsContainer_1 = __importDefault(require("../../../CommentsContainer/Co
44
44
  var classnames_2 = require("../../../../constants/classnames");
45
45
  var styles_1 = require("./styles");
46
46
  var contexts_1 = require("../../../../contexts");
47
+ var commonStyles_1 = require("../helpers/commonStyles");
47
48
  var ComplexAttribute = function (_a) {
48
49
  var _b;
49
50
  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;
50
51
  var styles = styles_1.useStyles();
52
+ var ovValueStyles = commonStyles_1.useOvValueStyles();
51
53
  var uri = attributeValue.uri;
52
54
  var _d = react_1.useState(false), expanded = _d[0], setExpanded = _d[1];
53
55
  var _e = react_1.useContext(contexts_1.HighlightedValuesContext), _f = _e.highlightedValuesUris, highlightedValuesUris = _f === void 0 ? [] : _f, highlightedClassName = _e.highlightedClassName;
@@ -67,6 +69,7 @@ var ComplexAttribute = function (_a) {
67
69
  _b[highlightedClassName] = highlightedValuesUris.some(function (uri) {
68
70
  return mdm_sdk_1.areOneHierarchyUris(uri, attributeValue.uri);
69
71
  }),
72
+ _b[ovValueStyles.ovFalse] = !mdm_sdk_1.isOv(attributeValue),
70
73
  _b)), "data-reltio-id": "reltio-attribute-complex-label" }, label),
71
74
  react_1.default.createElement("div", { className: styles.spacer }),
72
75
  react_1.default.createElement(CommentsContainer_1.default, { uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(objectType, {
@@ -45,15 +45,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  };
46
46
  Object.defineProperty(exports, "__esModule", { value: true });
47
47
  var react_1 = __importStar(require("react"));
48
+ var classnames_1 = __importDefault(require("classnames"));
48
49
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
49
50
  var contexts_1 = require("../../../../contexts");
50
51
  var ComplexAttribute_1 = __importDefault(require("../ComplexAttribute/ComplexAttribute"));
51
52
  var historyAppearance_1 = require("../helpers/historyAppearance");
52
53
  var InternalLink_1 = __importDefault(require("../../../InternalLink/InternalLink"));
54
+ var commonStyles_1 = require("../helpers/commonStyles");
53
55
  var styles_1 = __importDefault(require("./styles"));
54
56
  var ReferenceAttribute = function (_a) {
55
57
  var attributeValue = _a.attributeValue, metadata = _a.metadata, attributeType = _a.attributeType, uiPath = _a.uiPath, otherProps = __rest(_a, ["attributeValue", "metadata", "attributeType", "uiPath"]);
56
58
  var styles = styles_1.default();
59
+ var ovValueStyles = commonStyles_1.useOvValueStyles();
57
60
  var refEntityURI = mdm_sdk_1.getReferencedEntityUriFromAttrValue(attributeValue);
58
61
  var attributeTypeList = react_1.useMemo(function () { return mdm_sdk_1.getAttributeTypeSubAttributes(metadata, attributeType); }, [
59
62
  attributeType,
@@ -61,20 +64,15 @@ var ReferenceAttribute = function (_a) {
61
64
  ]);
62
65
  var appearance = react_1.useContext(contexts_1.HistoryDiffContext).appearance;
63
66
  var entityLabel = react_1.useMemo(function () {
67
+ var _a;
64
68
  var attributeAppearance = historyAppearance_1.getHistoryAppearanceByUri(attributeValue.uri, appearance);
65
69
  var historyAttributesClassName = historyAppearance_1.getHistoryAttributeClassName(attributeAppearance);
66
- return (react_1.default.createElement(InternalLink_1.default, { href: mdm_sdk_1.isEmptyValue(appearance) ? mdm_sdk_1.getEntityLink({ uiPath: uiPath, uri: refEntityURI }) : undefined, className: styles[historyAttributesClassName] },
70
+ return (react_1.default.createElement(InternalLink_1.default, { href: mdm_sdk_1.isEmptyValue(appearance) ? mdm_sdk_1.getEntityLink({ uiPath: uiPath, uri: refEntityURI }) : undefined, className: classnames_1.default(styles[historyAttributesClassName], (_a = {},
71
+ _a[ovValueStyles.ovFalse] = !mdm_sdk_1.isOv(attributeValue),
72
+ _a)) },
67
73
  mdm_sdk_1.getLabel(attributeValue.label),
68
74
  attributeValue.relationshipLabel && (react_1.default.createElement("span", { className: styles.relationshipLabel }, attributeValue.relationshipLabel))));
69
- }, [
70
- attributeValue.uri,
71
- attributeValue.label,
72
- attributeValue.relationshipLabel,
73
- appearance,
74
- refEntityURI,
75
- styles,
76
- uiPath
77
- ]);
75
+ }, [attributeValue, appearance, uiPath, refEntityURI, styles, ovValueStyles.ovFalse]);
78
76
  return (react_1.default.createElement(ComplexAttribute_1.default, __assign({ attributeTypesList: attributeTypeList, attributeValue: attributeValue, label: entityLabel, attributeType: attributeType }, otherProps)));
79
77
  };
80
78
  ReferenceAttribute.propTypes = mdm_sdk_1.ReferenceAttributeType;
@@ -33,11 +33,13 @@ var PivotingTooltip_1 = require("../../PivotingAttributes/PivotingTooltip");
33
33
  var historyAppearance_1 = require("../helpers/historyAppearance");
34
34
  var styles_1 = require("./styles");
35
35
  var contexts_1 = require("../../../../contexts");
36
+ var commonStyles_1 = require("../helpers/commonStyles");
36
37
  var SimpleAttribute = function (_a) {
37
- var _b, _c, _d;
38
- var className = _a.className, _e = _a.attributeType, attributeType = _e === void 0 ? null : _e, attributeValue = _a.attributeValue, inlined = _a.inlined;
38
+ var _b, _c, _d, _e, _f;
39
+ var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, attributeValue = _a.attributeValue, inlined = _a.inlined;
39
40
  var styles = styles_1.useStyles();
40
- var _f = react_1.useContext(contexts_1.HighlightedValuesContext), _g = _f.highlightedValuesUris, highlightedValuesUris = _g === void 0 ? [] : _g, highlightedClassName = _f.highlightedClassName;
41
+ var ovValueStyles = commonStyles_1.useOvValueStyles();
42
+ var _h = react_1.useContext(contexts_1.HighlightedValuesContext), _j = _h.highlightedValuesUris, highlightedValuesUris = _j === void 0 ? [] : _j, highlightedClassName = _h.highlightedClassName;
41
43
  var appearance = react_1.useContext(HistoryAppearanceContext_1.HistoryDiffContext).appearance;
42
44
  var attributeAppearance = historyAppearance_1.getHistoryAppearanceByUri(attributeValue.uri, appearance);
43
45
  var historyClassName = historyAppearance_1.getHistoryAttributeClassName(attributeAppearance);
@@ -49,11 +51,11 @@ var SimpleAttribute = function (_a) {
49
51
  _b[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
50
52
  _b)) },
51
53
  react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: classnames_1.default((_c = {}, _c[styles.multilineAttribute] = !inlined, _c)) },
52
- react_1.default.createElement("span", { className: styles[historyClassName], "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)))) : (react_1.default.createElement("div", { className: classnames_1.default(className, styles.root, classnames_2.COMMENTS_CONTAINER_VISIBILITY_AREA, (_d = {},
53
- _d[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
54
- _d)) },
54
+ react_1.default.createElement("span", { className: classnames_1.default(styles[historyClassName], (_d = {}, _d[ovValueStyles.ovFalse] = !mdm_sdk_1.isOv(attributeValue), _d)), "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)))) : (react_1.default.createElement("div", { className: classnames_1.default(className, styles.root, classnames_2.COMMENTS_CONTAINER_VISIBILITY_AREA, (_e = {},
55
+ _e[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
56
+ _e)) },
55
57
  react_1.default.createElement(PivotingTooltip_1.PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri },
56
- react_1.default.createElement("span", { className: styles.attributeValue, "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)),
58
+ react_1.default.createElement("span", { className: classnames_1.default(styles.attributeValue, (_f = {}, _f[ovValueStyles.ovFalse] = !mdm_sdk_1.isOv(attributeValue), _f)), "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)),
57
59
  react_1.default.createElement(CommentsContainer_1.default, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(objectType, {
58
60
  uri: attributeValue.uri
59
61
  }), objectType: objectType })));
@@ -0,0 +1 @@
1
+ export declare const useOvValueStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"ovFalse">;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOvValueStyles = void 0;
4
+ var styles_1 = require("@material-ui/core/styles");
5
+ exports.useOvValueStyles = styles_1.makeStyles(function (theme) { return ({
6
+ ovFalse: theme.inactive
7
+ }); });
@@ -103,3 +103,20 @@ export declare enum RequestStates {
103
103
  LOADED = "loaded",
104
104
  ERROR = "error"
105
105
  }
106
+ export declare type SelectableItem = {
107
+ text?: string;
108
+ disabled?: boolean;
109
+ tooltip?: string;
110
+ id?: string;
111
+ onClick?: (e: any) => void;
112
+ selected?: boolean;
113
+ };
114
+ export declare type DropDownMenuItem = {
115
+ text?: string;
116
+ disabled?: boolean;
117
+ tooltip?: string;
118
+ id?: string;
119
+ onClick?: (e: any) => void;
120
+ selectable?: boolean;
121
+ selected?: boolean;
122
+ };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { MenuProps } from '@material-ui/core/Menu';
3
- import { Item } from './MenuItemRenderer';
3
+ import { DropDownMenuItem } from '../../types';
4
4
  declare type Props<T> = {
5
5
  className?: string;
6
6
  buttonComponent?: React.ElementType;
@@ -13,7 +13,7 @@ declare type Props<T> = {
13
13
  onMenuClose?: () => void;
14
14
  MenuItemRenderer?: (props: any) => JSX.Element;
15
15
  };
16
- declare function DropDownMenuButton<T = Item>({ className, menuId, buttonComponent, buttonContent, menuItems, buttonProps, popoverProps, onMenuOpen, onMenuClose, MenuItemRenderer }: Props<T>): JSX.Element;
16
+ declare function DropDownMenuButton<T = DropDownMenuItem>({ className, menuId, buttonComponent, buttonContent, menuItems, buttonProps, popoverProps, onMenuOpen, onMenuClose, MenuItemRenderer }: Props<T>): JSX.Element;
17
17
  declare namespace DropDownMenuButton {
18
18
  var displayName: string;
19
19
  }
@@ -1,13 +1,7 @@
1
1
  import React from 'react';
2
- export declare type Item = {
3
- text?: string;
4
- disabled?: boolean;
5
- tooltip?: string;
6
- id?: string;
7
- onClick?: (e: any) => void;
8
- };
2
+ import { DropDownMenuItem } from '../../types';
9
3
  declare type Props = {
10
- item: Item;
4
+ item: DropDownMenuItem;
11
5
  onMenuClose?: (e: any) => void;
12
6
  };
13
7
  declare const MenuItemRenderer: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLLIElement>>;
@@ -1,5 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { identity } from 'ramda';
3
+ import Checkbox from '@material-ui/core/Checkbox';
3
4
  import MenuItem from '@material-ui/core/MenuItem';
4
5
  import Typography from '@material-ui/core/Typography';
5
6
  import withTooltip from '../../HOCs/withTooltip/withTooltip';
@@ -8,12 +9,13 @@ var MenuItemWithTooltip = withTooltip(MenuItem);
8
9
  var MenuItemRenderer = forwardRef(function (_a, ref) {
9
10
  var item = _a.item, _b = _a.onMenuClose, onMenuClose = _b === void 0 ? identity : _b;
10
11
  var styles = useStyles();
11
- var disabled = item.disabled, text = item.text, tooltip = item.tooltip, onClick = item.onClick, _c = item.id, id = _c === void 0 ? '' : _c;
12
+ var disabled = item.disabled, text = item.text, tooltip = item.tooltip, onClick = item.onClick, _c = item.id, id = _c === void 0 ? '' : _c, selectable = item.selectable, selected = item.selected;
12
13
  var handleClick = function (e) {
13
14
  onMenuClose(e);
14
15
  onClick(e);
15
16
  };
16
17
  return (React.createElement(MenuItemWithTooltip, { tooltipTitle: tooltip, showForDisabled: true, classes: { root: styles.menuItem }, onClick: handleClick, disabled: disabled, ref: ref, "data-modal": true, "data-reltio-id": "reltio-search-menu-item" + id },
18
+ selectable && React.createElement(Checkbox, { checked: selected, color: "primary" }),
17
19
  React.createElement(Typography, { classes: { root: styles.menuText } }, text)));
18
20
  });
19
21
  MenuItemRenderer.displayName = 'MenuItemRenderer';
@@ -36,6 +36,6 @@ export var MergeButton = forwardRef(function (_a, ref) {
36
36
  onError: onError,
37
37
  onSuccess: onSuccess
38
38
  }).sendMergeAllRequest;
39
- return (React.createElement(ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: disabled ? '' : i18n.text('Merge'), icon: MergeIcon, onClick: sendMergeAllRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
39
+ return (React.createElement(ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: i18n.text('Merge'), icon: MergeIcon, onClick: sendMergeAllRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
40
40
  });
41
41
  MergeButton.displayName = 'mergeButton';
@@ -35,6 +35,6 @@ export var NotMatchButton = forwardRef(function (_a, ref) {
35
35
  onFinishRequest: onFinishRequest,
36
36
  onSuccess: onSuccess
37
37
  }).sendMarkAsNotMatchRequest;
38
- return (React.createElement(ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: disabled ? '' : i18n.text('Not a match'), icon: NotMatchIcon, onClick: sendMarkAsNotMatchRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
38
+ return (React.createElement(ActionButton, __assign({ className: className, disabled: disabled, mode: mode, label: i18n.text('Not a match'), icon: NotMatchIcon, onClick: sendMarkAsNotMatchRequest, onMenuClose: onMenuClose, ref: ref }, otherProps)));
39
39
  });
40
40
  NotMatchButton.displayName = 'notMatchButton';
@@ -9,6 +9,7 @@ declare type Props = {
9
9
  attributeType: any;
10
10
  attributeValue: any;
11
11
  }) => JSX.Element;
12
+ showNonOv?: boolean;
12
13
  };
13
14
  declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, ...props }: Props) => JSX.Element>;
14
15
  export default _default;
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import React, { useContext, useEffect, useMemo, useState } from 'react';
13
13
  import PropTypes from 'prop-types';
14
14
  import classnames from 'classnames';
15
- import { AttributeTypeType, areOneHierarchyUris, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType, isSpecialAttribute } from '@reltio/mdm-sdk';
15
+ import { AttributeTypeType, areOneHierarchyUris, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isOv, isRelationAttrType, isSpecialAttribute } from '@reltio/mdm-sdk';
16
16
  import Typography from '@material-ui/core/Typography';
17
17
  import AttributesList from '../AttributesList/AttributesList';
18
18
  import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
@@ -20,10 +20,12 @@ import CommentsContainer from '../../../CommentsContainer/CommentsContainer';
20
20
  import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../../constants/classnames';
21
21
  import { useStyles } from './styles';
22
22
  import { HighlightedValuesContext } from '../../../../contexts';
23
+ import { useOvValueStyles } from '../helpers/commonStyles';
23
24
  var ComplexAttribute = function (_a) {
24
25
  var _b;
25
26
  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;
26
27
  var styles = useStyles();
28
+ var ovValueStyles = useOvValueStyles();
27
29
  var uri = attributeValue.uri;
28
30
  var _d = useState(false), expanded = _d[0], setExpanded = _d[1];
29
31
  var _e = useContext(HighlightedValuesContext), _f = _e.highlightedValuesUris, highlightedValuesUris = _f === void 0 ? [] : _f, highlightedClassName = _e.highlightedClassName;
@@ -43,6 +45,7 @@ var ComplexAttribute = function (_a) {
43
45
  _b[highlightedClassName] = highlightedValuesUris.some(function (uri) {
44
46
  return areOneHierarchyUris(uri, attributeValue.uri);
45
47
  }),
48
+ _b[ovValueStyles.ovFalse] = !isOv(attributeValue),
46
49
  _b)), "data-reltio-id": "reltio-attribute-complex-label" }, label),
47
50
  React.createElement("div", { className: styles.spacer }),
48
51
  React.createElement(CommentsContainer, { uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
@@ -21,15 +21,18 @@ 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 { getAttributeTypeSubAttributes, getEntityLink, getLabel, getReferencedEntityUriFromAttrValue, isEmptyValue, ReferenceAttributeType } from '@reltio/mdm-sdk';
24
+ import classnames from 'classnames';
25
+ import { getAttributeTypeSubAttributes, getEntityLink, getLabel, getReferencedEntityUriFromAttrValue, isEmptyValue, isOv, ReferenceAttributeType } from '@reltio/mdm-sdk';
25
26
  import { HistoryDiffContext } from '../../../../contexts';
26
27
  import ComplexAttribute from '../ComplexAttribute/ComplexAttribute';
27
28
  import { getHistoryAppearanceByUri, getHistoryAttributeClassName } from '../helpers/historyAppearance';
28
29
  import InternalLink from '../../../InternalLink/InternalLink';
30
+ import { useOvValueStyles } from '../helpers/commonStyles';
29
31
  import useStyles from './styles';
30
32
  var ReferenceAttribute = function (_a) {
31
33
  var attributeValue = _a.attributeValue, metadata = _a.metadata, attributeType = _a.attributeType, uiPath = _a.uiPath, otherProps = __rest(_a, ["attributeValue", "metadata", "attributeType", "uiPath"]);
32
34
  var styles = useStyles();
35
+ var ovValueStyles = useOvValueStyles();
33
36
  var refEntityURI = getReferencedEntityUriFromAttrValue(attributeValue);
34
37
  var attributeTypeList = useMemo(function () { return getAttributeTypeSubAttributes(metadata, attributeType); }, [
35
38
  attributeType,
@@ -37,20 +40,15 @@ var ReferenceAttribute = function (_a) {
37
40
  ]);
38
41
  var appearance = useContext(HistoryDiffContext).appearance;
39
42
  var entityLabel = useMemo(function () {
43
+ var _a;
40
44
  var attributeAppearance = getHistoryAppearanceByUri(attributeValue.uri, appearance);
41
45
  var historyAttributesClassName = getHistoryAttributeClassName(attributeAppearance);
42
- return (React.createElement(InternalLink, { href: isEmptyValue(appearance) ? getEntityLink({ uiPath: uiPath, uri: refEntityURI }) : undefined, className: styles[historyAttributesClassName] },
46
+ return (React.createElement(InternalLink, { href: isEmptyValue(appearance) ? getEntityLink({ uiPath: uiPath, uri: refEntityURI }) : undefined, className: classnames(styles[historyAttributesClassName], (_a = {},
47
+ _a[ovValueStyles.ovFalse] = !isOv(attributeValue),
48
+ _a)) },
43
49
  getLabel(attributeValue.label),
44
50
  attributeValue.relationshipLabel && (React.createElement("span", { className: styles.relationshipLabel }, attributeValue.relationshipLabel))));
45
- }, [
46
- attributeValue.uri,
47
- attributeValue.label,
48
- attributeValue.relationshipLabel,
49
- appearance,
50
- refEntityURI,
51
- styles,
52
- uiPath
53
- ]);
51
+ }, [attributeValue, appearance, uiPath, refEntityURI, styles, ovValueStyles.ovFalse]);
54
52
  return (React.createElement(ComplexAttribute, __assign({ attributeTypesList: attributeTypeList, attributeValue: attributeValue, label: entityLabel, attributeType: attributeType }, otherProps)));
55
53
  };
56
54
  ReferenceAttribute.propTypes = ReferenceAttributeType;
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { getAttrDataTypeDefinition, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris, isRelationAttrType } from '@reltio/mdm-sdk';
2
+ import { getAttrDataTypeDefinition, getAttributeValue, CollaborationObjectTypes, createRelatedObjectUris, isOv, isRelationAttrType } from '@reltio/mdm-sdk';
3
3
  import classnames from 'classnames';
4
4
  import { COMMENTS_CONTAINER_VISIBILITY_AREA } from '../../../../constants/classnames';
5
5
  import { HistoryDiffContext } from '../../../../contexts/HistoryAppearanceContext';
@@ -9,11 +9,13 @@ import { PivotingTooltip } from '../../PivotingAttributes/PivotingTooltip';
9
9
  import { getHistoryAppearanceByUri, getHistoryAttributeClassName } from '../helpers/historyAppearance';
10
10
  import { useStyles } from './styles';
11
11
  import { HighlightedValuesContext } from '../../../../contexts';
12
+ import { useOvValueStyles } from '../helpers/commonStyles';
12
13
  var SimpleAttribute = function (_a) {
13
- var _b, _c, _d;
14
- var className = _a.className, _e = _a.attributeType, attributeType = _e === void 0 ? null : _e, attributeValue = _a.attributeValue, inlined = _a.inlined;
14
+ var _b, _c, _d, _e, _f;
15
+ var className = _a.className, _g = _a.attributeType, attributeType = _g === void 0 ? null : _g, attributeValue = _a.attributeValue, inlined = _a.inlined;
15
16
  var styles = useStyles();
16
- var _f = useContext(HighlightedValuesContext), _g = _f.highlightedValuesUris, highlightedValuesUris = _g === void 0 ? [] : _g, highlightedClassName = _f.highlightedClassName;
17
+ var ovValueStyles = useOvValueStyles();
18
+ var _h = useContext(HighlightedValuesContext), _j = _h.highlightedValuesUris, highlightedValuesUris = _j === void 0 ? [] : _j, highlightedClassName = _h.highlightedClassName;
17
19
  var appearance = useContext(HistoryDiffContext).appearance;
18
20
  var attributeAppearance = getHistoryAppearanceByUri(attributeValue.uri, appearance);
19
21
  var historyClassName = getHistoryAttributeClassName(attributeAppearance);
@@ -25,11 +27,11 @@ var SimpleAttribute = function (_a) {
25
27
  _b[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
26
28
  _b)) },
27
29
  React.createElement(PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri, className: classnames((_c = {}, _c[styles.multilineAttribute] = !inlined, _c)) },
28
- React.createElement("span", { className: styles[historyClassName], "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)))) : (React.createElement("div", { className: classnames(className, styles.root, COMMENTS_CONTAINER_VISIBILITY_AREA, (_d = {},
29
- _d[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
30
- _d)) },
30
+ React.createElement("span", { className: classnames(styles[historyClassName], (_d = {}, _d[ovValueStyles.ovFalse] = !isOv(attributeValue), _d)), "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)))) : (React.createElement("div", { className: classnames(className, styles.root, COMMENTS_CONTAINER_VISIBILITY_AREA, (_e = {},
31
+ _e[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
32
+ _e)) },
31
33
  React.createElement(PivotingTooltip, { value: attributeValue, attributeType: attributeType, key: attributeValue.uri },
32
- React.createElement("span", { className: styles.attributeValue, "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)),
34
+ React.createElement("span", { className: classnames(styles.attributeValue, (_f = {}, _f[ovValueStyles.ovFalse] = !isOv(attributeValue), _f)), "data-reltio-id": "reltio-attribute-value" }, dataTypeValue)),
33
35
  React.createElement(CommentsContainer, { className: styles.commentsContainer, uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
34
36
  uri: attributeValue.uri
35
37
  }), objectType: objectType })));
@@ -0,0 +1 @@
1
+ export declare const useOvValueStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"ovFalse">;
@@ -0,0 +1,4 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ export var useOvValueStyles = makeStyles(function (theme) { return ({
3
+ ovFalse: theme.inactive
4
+ }); });
@@ -103,3 +103,20 @@ export declare enum RequestStates {
103
103
  LOADED = "loaded",
104
104
  ERROR = "error"
105
105
  }
106
+ export declare type SelectableItem = {
107
+ text?: string;
108
+ disabled?: boolean;
109
+ tooltip?: string;
110
+ id?: string;
111
+ onClick?: (e: any) => void;
112
+ selected?: boolean;
113
+ };
114
+ export declare type DropDownMenuItem = {
115
+ text?: string;
116
+ disabled?: boolean;
117
+ tooltip?: string;
118
+ id?: string;
119
+ onClick?: (e: any) => void;
120
+ selectable?: boolean;
121
+ selected?: boolean;
122
+ };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1202",
3
+ "version": "1.4.1207",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
7
7
  "dependencies": {
8
8
  "@date-io/moment": "^1.3.5",
9
9
  "@react-google-maps/api": "2.7.0",
10
- "@reltio/mdm-module": "^1.4.1202",
11
- "@reltio/mdm-sdk": "^1.4.1202",
10
+ "@reltio/mdm-module": "^1.4.1207",
11
+ "@reltio/mdm-sdk": "^1.4.1207",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",