@reltio/components 1.4.996 → 1.4.999

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 (45) hide show
  1. package/cjs/components/ProfileBand/styles.d.ts +1 -1
  2. package/cjs/components/ProfilesList/ProfilesList.d.ts +18 -0
  3. package/cjs/components/ProfilesList/ProfilesList.js +107 -0
  4. package/cjs/components/ProfilesList/helpers.d.ts +3 -0
  5. package/cjs/components/ProfilesList/helpers.js +20 -0
  6. package/cjs/components/ProfilesList/index.d.ts +31 -0
  7. package/cjs/components/ProfilesList/index.js +16 -0
  8. package/cjs/components/ProfilesList/styles.d.ts +1 -0
  9. package/cjs/components/ProfilesList/styles.js +108 -0
  10. package/cjs/components/attributes/AttributesView/AttributesView.d.ts +1 -1
  11. package/cjs/components/attributes/AttributesView/AttributesView.js +3 -2
  12. package/cjs/components/attributes/AttributesView/index.d.ts +1 -1
  13. package/cjs/components/attributes/editMode/AttributesView/index.d.ts +2 -2
  14. package/cjs/components/attributes/readMode/AttributesView/index.d.ts +2 -2
  15. package/cjs/components/attributes/readMode/SpecialAttributes/Tags/Tag.js +10 -4
  16. package/cjs/components/attributes/types/attributesView.d.ts +1 -1
  17. package/cjs/components/index.d.ts +1 -0
  18. package/cjs/components/index.js +3 -1
  19. package/cjs/contexts/EntityContext/index.d.ts +3 -0
  20. package/cjs/contexts/EntityContext/index.js +9 -0
  21. package/cjs/contexts/index.d.ts +1 -0
  22. package/cjs/contexts/index.js +3 -1
  23. package/esm/components/ProfileBand/styles.d.ts +1 -1
  24. package/esm/components/ProfilesList/ProfilesList.d.ts +18 -0
  25. package/esm/components/ProfilesList/ProfilesList.js +83 -0
  26. package/esm/components/ProfilesList/helpers.d.ts +3 -0
  27. package/esm/components/ProfilesList/helpers.js +14 -0
  28. package/esm/components/ProfilesList/index.d.ts +31 -0
  29. package/esm/components/ProfilesList/index.js +10 -0
  30. package/esm/components/ProfilesList/styles.d.ts +1 -0
  31. package/esm/components/ProfilesList/styles.js +105 -0
  32. package/esm/components/attributes/AttributesView/AttributesView.d.ts +1 -1
  33. package/esm/components/attributes/AttributesView/AttributesView.js +3 -2
  34. package/esm/components/attributes/AttributesView/index.d.ts +1 -1
  35. package/esm/components/attributes/editMode/AttributesView/index.d.ts +2 -2
  36. package/esm/components/attributes/readMode/AttributesView/index.d.ts +2 -2
  37. package/esm/components/attributes/readMode/SpecialAttributes/Tags/Tag.js +10 -4
  38. package/esm/components/attributes/types/attributesView.d.ts +1 -1
  39. package/esm/components/index.d.ts +1 -0
  40. package/esm/components/index.js +1 -0
  41. package/esm/contexts/EntityContext/index.d.ts +3 -0
  42. package/esm/contexts/EntityContext/index.js +3 -0
  43. package/esm/contexts/index.d.ts +1 -0
  44. package/esm/contexts/index.js +1 -0
  45. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
1
  export default useStyles;
2
- declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "entityType" | "inactive" | "profileIcon" | "badge" | "profileBandWrapper" | "profileBand" | "imageProfileIcon" | "profileInfo" | "businessCard" | "specialInfo" | "entityId" | "scores">;
2
+ declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "entityType" | "inactive" | "profileIcon" | "badge" | "businessCard" | "scores" | "profileBandWrapper" | "profileBand" | "imageProfileIcon" | "profileInfo" | "specialInfo" | "entityId">;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { Entity, Metadata, RangeColorsConfig } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ metadata: Metadata;
5
+ entities: Entity[];
6
+ entityToHighlight?: string;
7
+ selectedEntityUri?: string;
8
+ scoresToShow?: string[];
9
+ rangeColorsConfig?: RangeColorsConfig;
10
+ onEntityClick?: (entityUri: string) => void;
11
+ onEntityHover?: (entityUri: string) => void;
12
+ entitiesImportStatus?: {
13
+ entityUri: string;
14
+ };
15
+ entityButtonsRenderer?: (entity: Entity) => void;
16
+ };
17
+ declare const ProfilesList: ({ entities, metadata, entityToHighlight, selectedEntityUri, scoresToShow, rangeColorsConfig, onEntityClick, onEntityHover, entitiesImportStatus, entityButtonsRenderer }: Props) => JSX.Element;
18
+ export default ProfilesList;
@@ -0,0 +1,107 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || function (mod) {
26
+ if (mod && mod.__esModule) return mod;
27
+ var result = {};
28
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
+ __setModuleDefault(result, mod);
30
+ return result;
31
+ };
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ var react_1 = __importStar(require("react"));
37
+ var classnames_1 = __importDefault(require("classnames"));
38
+ var ramda_1 = require("ramda");
39
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
40
+ var Score_1 = __importDefault(require("../Score/Score"));
41
+ var EntityTypeBadge_1 = __importDefault(require("../EntityTypeBadge/EntityTypeBadge"));
42
+ var EntityUriLink_1 = __importDefault(require("../EntityUriLink/EntityUriLink"));
43
+ var EntityAvatar_1 = __importDefault(require("../EntityAvatar/EntityAvatar"));
44
+ var ImportButton_1 = require("../ImportButton/ImportButton");
45
+ var helpers_1 = require("./helpers");
46
+ var hooks_1 = require("../../hooks");
47
+ var styles_1 = require("./styles");
48
+ var SECOND_SCROLL_PAUSE = 1000;
49
+ var ProfilesList = function (_a) {
50
+ var entities = _a.entities, metadata = _a.metadata, entityToHighlight = _a.entityToHighlight, selectedEntityUri = _a.selectedEntityUri, scoresToShow = _a.scoresToShow, rangeColorsConfig = _a.rangeColorsConfig, onEntityClick = _a.onEntityClick, onEntityHover = _a.onEntityHover, entitiesImportStatus = _a.entitiesImportStatus, entityButtonsRenderer = _a.entityButtonsRenderer;
51
+ var styles = styles_1.useStyles();
52
+ var list = react_1.useRef(null);
53
+ var scrollTimer = react_1.useRef(null);
54
+ hooks_1.useDidUpdateEffect(function () {
55
+ var _a, _b;
56
+ if (entityToHighlight) {
57
+ var element_1 = (_a = list.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll("[data-entity-uri='" + entityToHighlight + "']");
58
+ helpers_1.clearScrollTimer(scrollTimer.current);
59
+ if ((element_1 === null || element_1 === void 0 ? void 0 : element_1.length) > 0) {
60
+ var scrollableParent_1 = (_b = list.current) === null || _b === void 0 ? void 0 : _b.parentElement;
61
+ if (!helpers_1.isScrolledIntoView(element_1[0], scrollableParent_1)) {
62
+ helpers_1.scroll(element_1[0]);
63
+ scrollTimer.current = setTimeout(function () {
64
+ if (!helpers_1.isScrolledIntoView(element_1[0], scrollableParent_1)) {
65
+ helpers_1.scroll(element_1[0]);
66
+ }
67
+ }, SECOND_SCROLL_PAUSE);
68
+ }
69
+ }
70
+ }
71
+ return function () {
72
+ helpers_1.clearScrollTimer(scrollTimer.current);
73
+ };
74
+ }, [entityToHighlight]);
75
+ return (react_1.default.createElement("div", { ref: list }, (entities || []).map(function (entity) {
76
+ var _a;
77
+ var label = mdm_sdk_1.getLabel(entity.label);
78
+ var secondaryLabel = entity.secondaryLabel;
79
+ var businessCardText = mdm_sdk_1.getBusinessCardAttributesText(metadata, entity);
80
+ var isActive = mdm_sdk_1.isActiveObject(entity);
81
+ var scores = mdm_sdk_1.getScores(metadata, entity, scoresToShow);
82
+ var entityUri = entity.uri;
83
+ var entityUriForLink = mdm_sdk_1.getEntityUriForLink(entity);
84
+ var importStatus = ramda_1.prop(entityUri, entitiesImportStatus);
85
+ return (react_1.default.createElement("div", { key: entityUri, className: classnames_1.default(styles.item, (_a = {},
86
+ _a[styles.clickable] = !!onEntityClick,
87
+ _a[styles.selected] = entityUri === selectedEntityUri,
88
+ _a[styles.highlighted] = entityUri === entityToHighlight,
89
+ _a[styles.inactive] = !isActive,
90
+ _a[styles.justImported] = importStatus === ImportButton_1.ImportModes.SUCCESS,
91
+ _a)), onClick: onEntityClick ? function () { return onEntityClick(entityUri); } : undefined, onMouseEnter: onEntityHover ? function () { return onEntityHover(entityUri); } : undefined, onMouseLeave: onEntityHover ? function () { return onEntityHover(null); } : undefined, "data-entity-uri": entityUri },
92
+ react_1.default.createElement(EntityAvatar_1.default, { entity: entity, avatarClassName: styles.avatar, imageClassName: styles.image }),
93
+ react_1.default.createElement("div", { className: styles.info },
94
+ react_1.default.createElement("div", null,
95
+ react_1.default.createElement(EntityUriLink_1.default, { value: entityUriForLink, className: styles.label }, label),
96
+ secondaryLabel && react_1.default.createElement("span", { className: styles.secondaryLabel },
97
+ secondaryLabel,
98
+ " "),
99
+ businessCardText && react_1.default.createElement("span", { className: styles.businessCard }, businessCardText)),
100
+ react_1.default.createElement("div", { className: styles.secondRow },
101
+ react_1.default.createElement(EntityTypeBadge_1.default, { entity: entity }),
102
+ react_1.default.createElement("div", null, mdm_sdk_1.getEntityId(entity)),
103
+ scores.length > 0 && (react_1.default.createElement("div", { className: styles.scores }, scores.map(function (score, i) { return (react_1.default.createElement(Score_1.default, __assign({ key: i }, score, { rangeColorsConfig: rangeColorsConfig }))); }))))),
104
+ entityButtonsRenderer && entityButtonsRenderer(entity)));
105
+ })));
106
+ };
107
+ exports.default = ProfilesList;
@@ -0,0 +1,3 @@
1
+ export declare const scroll: (element: any) => any;
2
+ export declare const clearScrollTimer: (scrollTimer: any) => void;
3
+ export declare const isScrolledIntoView: (element: any, scrollableParent: any) => boolean;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isScrolledIntoView = exports.clearScrollTimer = exports.scroll = void 0;
4
+ var scroll = function (element) { return element && element.scrollIntoView({ block: 'end', behavior: 'smooth' }); };
5
+ exports.scroll = scroll;
6
+ var clearScrollTimer = function (scrollTimer) {
7
+ if (scrollTimer) {
8
+ clearTimeout(scrollTimer);
9
+ }
10
+ };
11
+ exports.clearScrollTimer = clearScrollTimer;
12
+ var isScrolledIntoView = function (element, scrollableParent) {
13
+ if (element && scrollableParent) {
14
+ var elemTop = element.offsetTop;
15
+ var elemBottom = element.offsetTop + element.clientHeight;
16
+ var clientHeight = scrollableParent.clientHeight, scrollTop = scrollableParent.scrollTop;
17
+ return elemTop >= 0 && elemBottom > scrollTop && elemBottom < scrollTop + clientHeight;
18
+ }
19
+ };
20
+ exports.isScrolledIntoView = isScrolledIntoView;
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import ProfilesList from './ProfilesList';
3
+ export { ProfilesList };
4
+ declare const _default: import("react-redux").ConnectedComponent<({ entities, metadata, entityToHighlight, selectedEntityUri, scoresToShow, rangeColorsConfig, onEntityClick, onEntityHover, entitiesImportStatus, entityButtonsRenderer }: {
5
+ metadata: import("@reltio/mdm-sdk").Metadata;
6
+ entities: import("@reltio/mdm-sdk").Entity[];
7
+ entityToHighlight?: string;
8
+ selectedEntityUri?: string;
9
+ scoresToShow?: string[];
10
+ rangeColorsConfig?: import("@reltio/mdm-sdk").RangeColorsConfig;
11
+ onEntityClick?: (entityUri: string) => void;
12
+ onEntityHover?: (entityUri: string) => void;
13
+ entitiesImportStatus?: {
14
+ entityUri: string;
15
+ };
16
+ entityButtonsRenderer?: (entity: import("@reltio/mdm-sdk").Entity) => void;
17
+ }) => JSX.Element, import("react-redux").Omit<{
18
+ metadata: import("@reltio/mdm-sdk").Metadata;
19
+ entities: import("@reltio/mdm-sdk").Entity[];
20
+ entityToHighlight?: string;
21
+ selectedEntityUri?: string;
22
+ scoresToShow?: string[];
23
+ rangeColorsConfig?: import("@reltio/mdm-sdk").RangeColorsConfig;
24
+ onEntityClick?: (entityUri: string) => void;
25
+ onEntityHover?: (entityUri: string) => void;
26
+ entitiesImportStatus?: {
27
+ entityUri: string;
28
+ };
29
+ entityButtonsRenderer?: (entity: import("@reltio/mdm-sdk").Entity) => void;
30
+ }, "metadata">>;
31
+ export default _default;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ProfilesList = void 0;
7
+ var react_redux_1 = require("react-redux");
8
+ var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
9
+ var ProfilesList_1 = __importDefault(require("./ProfilesList"));
10
+ exports.ProfilesList = ProfilesList_1.default;
11
+ var mapStateToProps = function (state) {
12
+ return {
13
+ metadata: mdm_module_1.default.selectors.getMetadata(state)
14
+ };
15
+ };
16
+ exports.default = react_redux_1.connect(mapStateToProps)(ProfilesList_1.default);
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "image" | "secondaryLabel" | "item" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "secondRow" | "@keyframes animate" | "highlighted" | "justImported" | "businessCard" | "scores">;
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStyles = void 0;
4
+ var styles_1 = require("@material-ui/core/styles");
5
+ exports.useStyles = styles_1.makeStyles(function (theme) {
6
+ return {
7
+ '@keyframes animate': {
8
+ from: { background: 'transparent' },
9
+ '66%': { background: '#f2e68e' },
10
+ '100%': { background: 'transparent' }
11
+ },
12
+ highlighted: {
13
+ animationName: '$animate',
14
+ animationDuration: '3s',
15
+ animationIterationCount: 1
16
+ },
17
+ item: {
18
+ display: 'flex',
19
+ minHeight: '40px',
20
+ borderBottom: '1px solid rgba(0, 0, 0, 0.1)',
21
+ flexDirection: 'row',
22
+ '&:after': {
23
+ // IE flex & min-height workaround
24
+ content: '',
25
+ minHeight: 'inherit',
26
+ fontSize: 0
27
+ },
28
+ '&:hover': {
29
+ backgroundColor: 'rgba(0, 0, 0, 0.03)'
30
+ }
31
+ },
32
+ clickable: {
33
+ cursor: 'pointer'
34
+ },
35
+ selected: {
36
+ background: styles_1.fade(theme.palette.primary.main, 0.12),
37
+ '&:hover': {
38
+ background: styles_1.fade(theme.palette.primary.main, 0.24)
39
+ }
40
+ },
41
+ inactive: {
42
+ background: theme.inactiveBackground,
43
+ '&:hover': {
44
+ background: theme.inactiveHoverBackground
45
+ },
46
+ '&$selected': {
47
+ background: theme.inactiveSelectedBackground,
48
+ '&:hover': {
49
+ background: theme.inactiveSelectedHoverBackground
50
+ }
51
+ }
52
+ },
53
+ justImported: {
54
+ backgroundColor: '#FFFBEB !important'
55
+ },
56
+ avatar: {
57
+ marginLeft: '20px'
58
+ },
59
+ image: {
60
+ height: '32px',
61
+ width: '32px',
62
+ marginTop: '8px',
63
+ marginBottom: '7px'
64
+ },
65
+ info: {
66
+ marginLeft: '20px',
67
+ flexGrow: 1,
68
+ display: 'flex',
69
+ flexDirection: 'column',
70
+ justifyContent: 'center',
71
+ fontSize: '13px',
72
+ width: '100%',
73
+ overflow: 'hidden',
74
+ overflowWrap: 'break-word',
75
+ wordWrap: 'break-word' // for IE
76
+ },
77
+ label: {
78
+ fontSize: '13px',
79
+ lineHeight: '15px',
80
+ fontWeight: 500,
81
+ color: theme.palette.primary.main,
82
+ marginRight: '17px',
83
+ textDecoration: 'none'
84
+ },
85
+ secondaryLabel: {
86
+ marginRight: '12px'
87
+ },
88
+ businessCard: {
89
+ color: 'rgba(0, 0, 0, 0.54)'
90
+ },
91
+ secondRow: {
92
+ display: 'flex',
93
+ marginTop: '2px',
94
+ alignItems: 'center',
95
+ color: 'rgba(0, 0, 0, 0.54)',
96
+ fontSize: '12px'
97
+ },
98
+ scores: {
99
+ display: 'flex',
100
+ flexWrap: 'wrap',
101
+ color: 'rgba(0, 0, 0, 0.87)',
102
+ marginLeft: '10px',
103
+ marginRight: '20px',
104
+ fontSize: '13px',
105
+ minWidth: '134px'
106
+ }
107
+ };
108
+ });
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AttributesViewOwnProps } from '../types';
3
- declare const AttributesView: ({ mode, attributesCount, pinnedAttributes, ...restProps }: AttributesViewOwnProps) => JSX.Element;
3
+ declare const AttributesView: ({ mode, attributesCount, pinnedAttributes, entity, ...restProps }: AttributesViewOwnProps) => JSX.Element;
4
4
  export default AttributesView;
@@ -29,8 +29,9 @@ var react_1 = __importDefault(require("react"));
29
29
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
30
30
  var AttributesView_1 = __importDefault(require("../readMode/AttributesView"));
31
31
  var AttributesView_2 = __importDefault(require("../editMode/AttributesView"));
32
+ var contexts_1 = require("../../../contexts");
32
33
  var AttributesView = function (_a) {
33
- var _b = _a.mode, mode = _b === void 0 ? mdm_sdk_1.Mode.Viewing : _b, attributesCount = _a.attributesCount, pinnedAttributes = _a.pinnedAttributes, restProps = __rest(_a, ["mode", "attributesCount", "pinnedAttributes"]);
34
- return mdm_sdk_1.isViewMode(mode) ? (react_1.default.createElement(AttributesView_1.default, __assign({ attributesCount: attributesCount }, restProps))) : (react_1.default.createElement(AttributesView_2.default, __assign({ mode: mode, pinnedAttributes: pinnedAttributes }, restProps)));
34
+ var _b = _a.mode, mode = _b === void 0 ? mdm_sdk_1.Mode.Viewing : _b, attributesCount = _a.attributesCount, pinnedAttributes = _a.pinnedAttributes, entity = _a.entity, restProps = __rest(_a, ["mode", "attributesCount", "pinnedAttributes", "entity"]);
35
+ return (react_1.default.createElement(contexts_1.EntityContext.Provider, { value: entity }, mdm_sdk_1.isViewMode(mode) ? (react_1.default.createElement(AttributesView_1.default, __assign({ attributesCount: attributesCount, entity: entity }, restProps))) : (react_1.default.createElement(AttributesView_2.default, __assign({ mode: mode, pinnedAttributes: pinnedAttributes, entity: entity }, restProps)))));
35
36
  };
36
37
  exports.default = AttributesView;
@@ -3,5 +3,5 @@ import { AttributesViewOwnProps } from '../types';
3
3
  import AttributesView from './AttributesView';
4
4
  declare type Props = Pick<AttributesViewOwnProps, 'entity' | 'mode'>;
5
5
  export { AttributesView };
6
- declare const _default: import("react-redux").ConnectedComponent<({ mode, attributesCount, pinnedAttributes, ...restProps }: AttributesViewOwnProps) => JSX.Element, import("react-redux").Omit<AttributesViewOwnProps, "entity" | "mode"> & Props>;
6
+ declare const _default: import("react-redux").ConnectedComponent<({ mode, attributesCount, pinnedAttributes, entity, ...restProps }: AttributesViewOwnProps) => JSX.Element, import("react-redux").Omit<AttributesViewOwnProps, "entity" | "mode"> & Props>;
7
7
  export default _default;
@@ -2,7 +2,7 @@
2
2
  import AttributesView from './AttributesView';
3
3
  export { AttributesView };
4
4
  declare const _default: import("react-redux").ConnectedComponent<({ className, entity, mode, metadata, caption, excludeUris, includeUris, pinnedAttributes }: {
5
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
5
+ entity?: import("@reltio/mdm-sdk").Entity;
6
6
  caption?: string;
7
7
  includeUris?: string[];
8
8
  excludeUris?: string[];
@@ -14,7 +14,7 @@ declare const _default: import("react-redux").ConnectedComponent<({ className, e
14
14
  roles?: string[];
15
15
  }[];
16
16
  }) => JSX.Element, import("react-redux").Omit<{
17
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
17
+ entity?: import("@reltio/mdm-sdk").Entity;
18
18
  caption?: string;
19
19
  includeUris?: string[];
20
20
  excludeUris?: string[];
@@ -2,7 +2,7 @@
2
2
  import AttributesView from './AttributesView';
3
3
  export { AttributesView };
4
4
  declare const _default: import("react-redux").ConnectedComponent<({ className, entity, metadata, caption, excludeUris, includeUris, attributesCount }: {
5
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
5
+ entity?: import("@reltio/mdm-sdk").Entity;
6
6
  caption?: string;
7
7
  includeUris?: string[];
8
8
  excludeUris?: string[];
@@ -14,7 +14,7 @@ declare const _default: import("react-redux").ConnectedComponent<({ className, e
14
14
  roles?: string[];
15
15
  }[];
16
16
  }) => JSX.Element, import("react-redux").Omit<{
17
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
17
+ entity?: import("@reltio/mdm-sdk").Entity;
18
18
  caption?: string;
19
19
  includeUris?: string[];
20
20
  excludeUris?: string[];
@@ -27,17 +27,23 @@ var Link_1 = __importDefault(require("@material-ui/core/Link"));
27
27
  var react_redux_1 = require("react-redux");
28
28
  var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
29
29
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
30
- var HistoryAppearanceContext_1 = require("../../../../../contexts/HistoryAppearanceContext");
30
+ var contexts_1 = require("../../../../../contexts");
31
31
  var historyAppearance_1 = require("../../helpers/historyAppearance");
32
32
  var styles_1 = require("../styles");
33
33
  var Tag = function (_a) {
34
34
  var value = _a.value;
35
35
  var styles = styles_1.useCommonStyles();
36
36
  var uiPath = react_redux_1.useSelector(mdm_module_1.default.selectors.getUIPath);
37
- var entity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity);
38
- var appearance = react_1.useContext(HistoryAppearanceContext_1.HistoryDiffContext).appearance;
37
+ var ownEntity = react_1.useContext(contexts_1.EntityContext);
38
+ var currentEntity = react_redux_1.useSelector(mdm_module_1.default.selectors.getEntity);
39
+ var appearance = react_1.useContext(contexts_1.HistoryDiffContext).appearance;
39
40
  var attributeAppearance = historyAppearance_1.getHistoryAppearanceBySpecialAttributeValue('tags', value, appearance);
40
41
  var historyClassName = historyAppearance_1.getHistoryAttributeClassName(attributeAppearance);
41
- return (react_1.default.createElement(Link_1.default, { underline: "none", className: styles[historyClassName], href: mdm_sdk_1.getTagLink({ uiPath: uiPath, tag: value, entityUri: entity.uri }) }, value));
42
+ var entity = ownEntity || currentEntity;
43
+ return (react_1.default.createElement(Link_1.default, { underline: "none", className: styles[historyClassName], href: mdm_sdk_1.getTagLink({
44
+ uiPath: uiPath,
45
+ tag: value,
46
+ entityUri: entity.dataTenant ? mdm_sdk_1.getDataTenantEntityUri(entity) : entity.uri
47
+ }) }, value));
42
48
  };
43
49
  exports.default = Tag;
@@ -3,7 +3,7 @@ declare type OwnProps = {
3
3
  attributesCount?: number;
4
4
  caption?: string;
5
5
  className?: string;
6
- entity?: Entity | Record<string, never>;
6
+ entity?: Entity;
7
7
  excludeUris?: string[];
8
8
  includeUris?: string[];
9
9
  pinnedAttributes?: {
@@ -127,3 +127,4 @@ export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
127
127
  export { MergeButton } from './MergeButton/MergeButton';
128
128
  export { NotMatchButton } from './NotMatchButton/NotMatchButton';
129
129
  export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
130
+ export { default as ProfilesList } from './ProfilesList';
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.NoResults = exports.NoData = exports.DropDownSelector = exports.DropDownMenuButton = exports.Drawer = exports.DataTypeValue = exports.ConnectionRelationTypeSelector = exports.ConfigureColumnsPopup = exports.MenuWithPopper = exports.DropdownIndicatorWithIconButton = exports.DropdownIndicator = exports.CommentsContainer = exports.ColorBar = exports.CollapseButton = exports.CollaborationItem = exports.ClickAwayProvider = exports.BasicViewHeader = exports.BasicViewContent = exports.BasicView = exports.ProfileBandNavigation = exports.AvatarWithFallback = exports.AutoSizeList = exports.ReadOnlyAttributesPager = exports.SimpleAttribute = exports.ReferenceAttribute = exports.NestedAttribute = exports.EditableImageAttributesLine = exports.ImageAttributesLine = exports.ReadOnlyAttributesList = exports.ReadOnlyAttributeValuesBlock = exports.EditableAttribute = exports.ReadOnlyAttribute = exports.CardinalityMessage = exports.AttributesPager = exports.SimpleAttributeEditor = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.NestedAttributeEditor = exports.MoreAttributesButton = exports.EntitySelector = exports.EntityCreator = exports.AttributesList = exports.BranchDecorator = exports.AttributesView = exports.AttributeListItem = void 0;
17
17
  exports.SidePanel = exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopupPopper = exports.SelectionPopup = exports.useKeyboardNavigation = exports.WhiteSearchInput = exports.SearchInput = exports.ScoreLabel = exports.Score = exports.ResizablePanes = exports.ReltioGridLayout = exports.ReactSortableTreeUtils = exports.ReactSortableTreeHandlers = exports.ReactSortableTree = exports.ReactSelectOptionFilters = exports.MultiSelect = exports.QueryBuilderRowsGroup = exports.QueryBuilderRow = exports.ProfileCard = exports.ProfileBand = exports.PotentialMatchReviewCard = exports.PopupWithArrow = exports.Popper = exports.MultipleInput = exports.ModeSwitcherSelect = exports.ModeSwitcher = exports.TransitiveMatchBlock = exports.SimpleMatchRulesBuilder = exports.SimpleMatchRulesBlock = exports.MatchRulesBlock = exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportModes = exports.ImportButton = exports.ImageGalleryDialog = exports.Highlighter = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.FlipCard = exports.FacetViewHeader = exports.ExpandedValueTooltip = exports.ErrorWrapper = exports.ErrorPopup = exports.ErrorBoundary = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = void 0;
18
- exports.ActionButtonMode = exports.ActionButton = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.RelationEditor = exports.OvIcon = exports.ErrorMessage = exports.ReltioMap = exports.ConfirmDeleteDialog = exports.ConfirmationDialog = exports.Marginator = exports.LightArrowTooltip = exports.ArrowExpandButton = exports.ScrollableTabs = exports.ExpandableSearchInput = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = void 0;
18
+ exports.ProfilesList = exports.ActionButtonMode = exports.ActionButton = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.RelationEditor = exports.OvIcon = exports.ErrorMessage = exports.ReltioMap = exports.ConfirmDeleteDialog = exports.ConfirmationDialog = exports.Marginator = exports.LightArrowTooltip = exports.ArrowExpandButton = exports.ScrollableTabs = exports.ExpandableSearchInput = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = void 0;
19
19
  __exportStar(require("./activityLog"), exports);
20
20
  var AttributeListItem_1 = require("./AttributeListItem/AttributeListItem");
21
21
  Object.defineProperty(exports, "AttributeListItem", { enumerable: true, get: function () { return __importDefault(AttributeListItem_1).default; } });
@@ -271,3 +271,5 @@ Object.defineProperty(exports, "NotMatchButton", { enumerable: true, get: functi
271
271
  var ActionButton_1 = require("./ActionButton/ActionButton");
272
272
  Object.defineProperty(exports, "ActionButton", { enumerable: true, get: function () { return ActionButton_1.ActionButton; } });
273
273
  Object.defineProperty(exports, "ActionButtonMode", { enumerable: true, get: function () { return ActionButton_1.ActionButtonMode; } });
274
+ var ProfilesList_1 = require("./ProfilesList");
275
+ Object.defineProperty(exports, "ProfilesList", { enumerable: true, get: function () { return __importDefault(ProfilesList_1).default; } });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { Entity } from '@reltio/mdm-sdk';
3
+ export declare const EntityContext: React.Context<Entity>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EntityContext = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ exports.EntityContext = react_1.default.createContext(null);
9
+ exports.EntityContext.displayName = 'EntityContext';
@@ -14,3 +14,4 @@ export { ExpandedAttributesProvider, useAttributeExpanded } from './ExpandedAttr
14
14
  export { EntityMarkerContext } from './EntityMarkerContext';
15
15
  export { WorkflowTasksContext } from './WorkflowTasksContext';
16
16
  export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
17
+ export { EntityContext } from './EntityContext';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
3
+ exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
4
4
  var AsyncMountContext_1 = require("./AsyncMountContext");
5
5
  Object.defineProperty(exports, "AsyncMountContext", { enumerable: true, get: function () { return AsyncMountContext_1.AsyncMountContext; } });
6
6
  var HistoryAppearanceContext_1 = require("./HistoryAppearanceContext");
@@ -38,3 +38,5 @@ var WorkflowTasksContext_1 = require("./WorkflowTasksContext");
38
38
  Object.defineProperty(exports, "WorkflowTasksContext", { enumerable: true, get: function () { return WorkflowTasksContext_1.WorkflowTasksContext; } });
39
39
  var RelatedObjectUrisContext_1 = require("./RelatedObjectUrisContext");
40
40
  Object.defineProperty(exports, "RelatedObjectUrisContext", { enumerable: true, get: function () { return RelatedObjectUrisContext_1.RelatedObjectUrisContext; } });
41
+ var EntityContext_1 = require("./EntityContext");
42
+ Object.defineProperty(exports, "EntityContext", { enumerable: true, get: function () { return EntityContext_1.EntityContext; } });
@@ -1,2 +1,2 @@
1
1
  export default useStyles;
2
- declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "entityType" | "inactive" | "profileIcon" | "badge" | "profileBandWrapper" | "profileBand" | "imageProfileIcon" | "profileInfo" | "businessCard" | "specialInfo" | "entityId" | "scores">;
2
+ declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "secondaryLabel" | "entityType" | "inactive" | "profileIcon" | "badge" | "businessCard" | "scores" | "profileBandWrapper" | "profileBand" | "imageProfileIcon" | "profileInfo" | "specialInfo" | "entityId">;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { Entity, Metadata, RangeColorsConfig } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ metadata: Metadata;
5
+ entities: Entity[];
6
+ entityToHighlight?: string;
7
+ selectedEntityUri?: string;
8
+ scoresToShow?: string[];
9
+ rangeColorsConfig?: RangeColorsConfig;
10
+ onEntityClick?: (entityUri: string) => void;
11
+ onEntityHover?: (entityUri: string) => void;
12
+ entitiesImportStatus?: {
13
+ entityUri: string;
14
+ };
15
+ entityButtonsRenderer?: (entity: Entity) => void;
16
+ };
17
+ declare const ProfilesList: ({ entities, metadata, entityToHighlight, selectedEntityUri, scoresToShow, rangeColorsConfig, onEntityClick, onEntityHover, entitiesImportStatus, entityButtonsRenderer }: Props) => JSX.Element;
18
+ export default ProfilesList;
@@ -0,0 +1,83 @@
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, { useRef } from 'react';
13
+ import classnames from 'classnames';
14
+ import { prop } from 'ramda';
15
+ import { getBusinessCardAttributesText, getEntityId, getEntityUriForLink, getLabel, getScores, isActiveObject } from '@reltio/mdm-sdk';
16
+ import Score from '../Score/Score';
17
+ import EntityTypeBadge from '../EntityTypeBadge/EntityTypeBadge';
18
+ import EntityUriLink from '../EntityUriLink/EntityUriLink';
19
+ import EntityAvatar from '../EntityAvatar/EntityAvatar';
20
+ import { ImportModes } from '../ImportButton/ImportButton';
21
+ import { clearScrollTimer, isScrolledIntoView, scroll } from './helpers';
22
+ import { useDidUpdateEffect } from '../../hooks';
23
+ import { useStyles } from './styles';
24
+ var SECOND_SCROLL_PAUSE = 1000;
25
+ var ProfilesList = function (_a) {
26
+ var entities = _a.entities, metadata = _a.metadata, entityToHighlight = _a.entityToHighlight, selectedEntityUri = _a.selectedEntityUri, scoresToShow = _a.scoresToShow, rangeColorsConfig = _a.rangeColorsConfig, onEntityClick = _a.onEntityClick, onEntityHover = _a.onEntityHover, entitiesImportStatus = _a.entitiesImportStatus, entityButtonsRenderer = _a.entityButtonsRenderer;
27
+ var styles = useStyles();
28
+ var list = useRef(null);
29
+ var scrollTimer = useRef(null);
30
+ useDidUpdateEffect(function () {
31
+ var _a, _b;
32
+ if (entityToHighlight) {
33
+ var element_1 = (_a = list.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll("[data-entity-uri='" + entityToHighlight + "']");
34
+ clearScrollTimer(scrollTimer.current);
35
+ if ((element_1 === null || element_1 === void 0 ? void 0 : element_1.length) > 0) {
36
+ var scrollableParent_1 = (_b = list.current) === null || _b === void 0 ? void 0 : _b.parentElement;
37
+ if (!isScrolledIntoView(element_1[0], scrollableParent_1)) {
38
+ scroll(element_1[0]);
39
+ scrollTimer.current = setTimeout(function () {
40
+ if (!isScrolledIntoView(element_1[0], scrollableParent_1)) {
41
+ scroll(element_1[0]);
42
+ }
43
+ }, SECOND_SCROLL_PAUSE);
44
+ }
45
+ }
46
+ }
47
+ return function () {
48
+ clearScrollTimer(scrollTimer.current);
49
+ };
50
+ }, [entityToHighlight]);
51
+ return (React.createElement("div", { ref: list }, (entities || []).map(function (entity) {
52
+ var _a;
53
+ var label = getLabel(entity.label);
54
+ var secondaryLabel = entity.secondaryLabel;
55
+ var businessCardText = getBusinessCardAttributesText(metadata, entity);
56
+ var isActive = isActiveObject(entity);
57
+ var scores = getScores(metadata, entity, scoresToShow);
58
+ var entityUri = entity.uri;
59
+ var entityUriForLink = getEntityUriForLink(entity);
60
+ var importStatus = prop(entityUri, entitiesImportStatus);
61
+ return (React.createElement("div", { key: entityUri, className: classnames(styles.item, (_a = {},
62
+ _a[styles.clickable] = !!onEntityClick,
63
+ _a[styles.selected] = entityUri === selectedEntityUri,
64
+ _a[styles.highlighted] = entityUri === entityToHighlight,
65
+ _a[styles.inactive] = !isActive,
66
+ _a[styles.justImported] = importStatus === ImportModes.SUCCESS,
67
+ _a)), onClick: onEntityClick ? function () { return onEntityClick(entityUri); } : undefined, onMouseEnter: onEntityHover ? function () { return onEntityHover(entityUri); } : undefined, onMouseLeave: onEntityHover ? function () { return onEntityHover(null); } : undefined, "data-entity-uri": entityUri },
68
+ React.createElement(EntityAvatar, { entity: entity, avatarClassName: styles.avatar, imageClassName: styles.image }),
69
+ React.createElement("div", { className: styles.info },
70
+ React.createElement("div", null,
71
+ React.createElement(EntityUriLink, { value: entityUriForLink, className: styles.label }, label),
72
+ secondaryLabel && React.createElement("span", { className: styles.secondaryLabel },
73
+ secondaryLabel,
74
+ " "),
75
+ businessCardText && React.createElement("span", { className: styles.businessCard }, businessCardText)),
76
+ React.createElement("div", { className: styles.secondRow },
77
+ React.createElement(EntityTypeBadge, { entity: entity }),
78
+ React.createElement("div", null, getEntityId(entity)),
79
+ scores.length > 0 && (React.createElement("div", { className: styles.scores }, scores.map(function (score, i) { return (React.createElement(Score, __assign({ key: i }, score, { rangeColorsConfig: rangeColorsConfig }))); }))))),
80
+ entityButtonsRenderer && entityButtonsRenderer(entity)));
81
+ })));
82
+ };
83
+ export default ProfilesList;
@@ -0,0 +1,3 @@
1
+ export declare const scroll: (element: any) => any;
2
+ export declare const clearScrollTimer: (scrollTimer: any) => void;
3
+ export declare const isScrolledIntoView: (element: any, scrollableParent: any) => boolean;
@@ -0,0 +1,14 @@
1
+ export var scroll = function (element) { return element && element.scrollIntoView({ block: 'end', behavior: 'smooth' }); };
2
+ export var clearScrollTimer = function (scrollTimer) {
3
+ if (scrollTimer) {
4
+ clearTimeout(scrollTimer);
5
+ }
6
+ };
7
+ export var isScrolledIntoView = function (element, scrollableParent) {
8
+ if (element && scrollableParent) {
9
+ var elemTop = element.offsetTop;
10
+ var elemBottom = element.offsetTop + element.clientHeight;
11
+ var clientHeight = scrollableParent.clientHeight, scrollTop = scrollableParent.scrollTop;
12
+ return elemTop >= 0 && elemBottom > scrollTop && elemBottom < scrollTop + clientHeight;
13
+ }
14
+ };
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import ProfilesList from './ProfilesList';
3
+ export { ProfilesList };
4
+ declare const _default: import("react-redux").ConnectedComponent<({ entities, metadata, entityToHighlight, selectedEntityUri, scoresToShow, rangeColorsConfig, onEntityClick, onEntityHover, entitiesImportStatus, entityButtonsRenderer }: {
5
+ metadata: import("@reltio/mdm-sdk").Metadata;
6
+ entities: import("@reltio/mdm-sdk").Entity[];
7
+ entityToHighlight?: string;
8
+ selectedEntityUri?: string;
9
+ scoresToShow?: string[];
10
+ rangeColorsConfig?: import("@reltio/mdm-sdk").RangeColorsConfig;
11
+ onEntityClick?: (entityUri: string) => void;
12
+ onEntityHover?: (entityUri: string) => void;
13
+ entitiesImportStatus?: {
14
+ entityUri: string;
15
+ };
16
+ entityButtonsRenderer?: (entity: import("@reltio/mdm-sdk").Entity) => void;
17
+ }) => JSX.Element, import("react-redux").Omit<{
18
+ metadata: import("@reltio/mdm-sdk").Metadata;
19
+ entities: import("@reltio/mdm-sdk").Entity[];
20
+ entityToHighlight?: string;
21
+ selectedEntityUri?: string;
22
+ scoresToShow?: string[];
23
+ rangeColorsConfig?: import("@reltio/mdm-sdk").RangeColorsConfig;
24
+ onEntityClick?: (entityUri: string) => void;
25
+ onEntityHover?: (entityUri: string) => void;
26
+ entitiesImportStatus?: {
27
+ entityUri: string;
28
+ };
29
+ entityButtonsRenderer?: (entity: import("@reltio/mdm-sdk").Entity) => void;
30
+ }, "metadata">>;
31
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { connect } from 'react-redux';
2
+ import mdmModule from '@reltio/mdm-module';
3
+ import ProfilesList from './ProfilesList';
4
+ var mapStateToProps = function (state) {
5
+ return {
6
+ metadata: mdmModule.selectors.getMetadata(state)
7
+ };
8
+ };
9
+ export { ProfilesList };
10
+ export default connect(mapStateToProps)(ProfilesList);
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "image" | "secondaryLabel" | "item" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "secondRow" | "@keyframes animate" | "highlighted" | "justImported" | "businessCard" | "scores">;
@@ -0,0 +1,105 @@
1
+ import { fade, makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles(function (theme) {
3
+ return {
4
+ '@keyframes animate': {
5
+ from: { background: 'transparent' },
6
+ '66%': { background: '#f2e68e' },
7
+ '100%': { background: 'transparent' }
8
+ },
9
+ highlighted: {
10
+ animationName: '$animate',
11
+ animationDuration: '3s',
12
+ animationIterationCount: 1
13
+ },
14
+ item: {
15
+ display: 'flex',
16
+ minHeight: '40px',
17
+ borderBottom: '1px solid rgba(0, 0, 0, 0.1)',
18
+ flexDirection: 'row',
19
+ '&:after': {
20
+ // IE flex & min-height workaround
21
+ content: '',
22
+ minHeight: 'inherit',
23
+ fontSize: 0
24
+ },
25
+ '&:hover': {
26
+ backgroundColor: 'rgba(0, 0, 0, 0.03)'
27
+ }
28
+ },
29
+ clickable: {
30
+ cursor: 'pointer'
31
+ },
32
+ selected: {
33
+ background: fade(theme.palette.primary.main, 0.12),
34
+ '&:hover': {
35
+ background: fade(theme.palette.primary.main, 0.24)
36
+ }
37
+ },
38
+ inactive: {
39
+ background: theme.inactiveBackground,
40
+ '&:hover': {
41
+ background: theme.inactiveHoverBackground
42
+ },
43
+ '&$selected': {
44
+ background: theme.inactiveSelectedBackground,
45
+ '&:hover': {
46
+ background: theme.inactiveSelectedHoverBackground
47
+ }
48
+ }
49
+ },
50
+ justImported: {
51
+ backgroundColor: '#FFFBEB !important'
52
+ },
53
+ avatar: {
54
+ marginLeft: '20px'
55
+ },
56
+ image: {
57
+ height: '32px',
58
+ width: '32px',
59
+ marginTop: '8px',
60
+ marginBottom: '7px'
61
+ },
62
+ info: {
63
+ marginLeft: '20px',
64
+ flexGrow: 1,
65
+ display: 'flex',
66
+ flexDirection: 'column',
67
+ justifyContent: 'center',
68
+ fontSize: '13px',
69
+ width: '100%',
70
+ overflow: 'hidden',
71
+ overflowWrap: 'break-word',
72
+ wordWrap: 'break-word' // for IE
73
+ },
74
+ label: {
75
+ fontSize: '13px',
76
+ lineHeight: '15px',
77
+ fontWeight: 500,
78
+ color: theme.palette.primary.main,
79
+ marginRight: '17px',
80
+ textDecoration: 'none'
81
+ },
82
+ secondaryLabel: {
83
+ marginRight: '12px'
84
+ },
85
+ businessCard: {
86
+ color: 'rgba(0, 0, 0, 0.54)'
87
+ },
88
+ secondRow: {
89
+ display: 'flex',
90
+ marginTop: '2px',
91
+ alignItems: 'center',
92
+ color: 'rgba(0, 0, 0, 0.54)',
93
+ fontSize: '12px'
94
+ },
95
+ scores: {
96
+ display: 'flex',
97
+ flexWrap: 'wrap',
98
+ color: 'rgba(0, 0, 0, 0.87)',
99
+ marginLeft: '10px',
100
+ marginRight: '20px',
101
+ fontSize: '13px',
102
+ minWidth: '134px'
103
+ }
104
+ };
105
+ });
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AttributesViewOwnProps } from '../types';
3
- declare const AttributesView: ({ mode, attributesCount, pinnedAttributes, ...restProps }: AttributesViewOwnProps) => JSX.Element;
3
+ declare const AttributesView: ({ mode, attributesCount, pinnedAttributes, entity, ...restProps }: AttributesViewOwnProps) => JSX.Element;
4
4
  export default AttributesView;
@@ -24,8 +24,9 @@ import React from 'react';
24
24
  import { isViewMode, Mode } from '@reltio/mdm-sdk';
25
25
  import ReadModeAttributesView from '../readMode/AttributesView';
26
26
  import EditModeAttributesView from '../editMode/AttributesView';
27
+ import { EntityContext } from '../../../contexts';
27
28
  var AttributesView = function (_a) {
28
- var _b = _a.mode, mode = _b === void 0 ? Mode.Viewing : _b, attributesCount = _a.attributesCount, pinnedAttributes = _a.pinnedAttributes, restProps = __rest(_a, ["mode", "attributesCount", "pinnedAttributes"]);
29
- return isViewMode(mode) ? (React.createElement(ReadModeAttributesView, __assign({ attributesCount: attributesCount }, restProps))) : (React.createElement(EditModeAttributesView, __assign({ mode: mode, pinnedAttributes: pinnedAttributes }, restProps)));
29
+ var _b = _a.mode, mode = _b === void 0 ? Mode.Viewing : _b, attributesCount = _a.attributesCount, pinnedAttributes = _a.pinnedAttributes, entity = _a.entity, restProps = __rest(_a, ["mode", "attributesCount", "pinnedAttributes", "entity"]);
30
+ return (React.createElement(EntityContext.Provider, { value: entity }, isViewMode(mode) ? (React.createElement(ReadModeAttributesView, __assign({ attributesCount: attributesCount, entity: entity }, restProps))) : (React.createElement(EditModeAttributesView, __assign({ mode: mode, pinnedAttributes: pinnedAttributes, entity: entity }, restProps)))));
30
31
  };
31
32
  export default AttributesView;
@@ -3,5 +3,5 @@ import { AttributesViewOwnProps } from '../types';
3
3
  import AttributesView from './AttributesView';
4
4
  declare type Props = Pick<AttributesViewOwnProps, 'entity' | 'mode'>;
5
5
  export { AttributesView };
6
- declare const _default: import("react-redux").ConnectedComponent<({ mode, attributesCount, pinnedAttributes, ...restProps }: AttributesViewOwnProps) => JSX.Element, import("react-redux").Omit<AttributesViewOwnProps, "entity" | "mode"> & Props>;
6
+ declare const _default: import("react-redux").ConnectedComponent<({ mode, attributesCount, pinnedAttributes, entity, ...restProps }: AttributesViewOwnProps) => JSX.Element, import("react-redux").Omit<AttributesViewOwnProps, "entity" | "mode"> & Props>;
7
7
  export default _default;
@@ -2,7 +2,7 @@
2
2
  import AttributesView from './AttributesView';
3
3
  export { AttributesView };
4
4
  declare const _default: import("react-redux").ConnectedComponent<({ className, entity, mode, metadata, caption, excludeUris, includeUris, pinnedAttributes }: {
5
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
5
+ entity?: import("@reltio/mdm-sdk").Entity;
6
6
  caption?: string;
7
7
  includeUris?: string[];
8
8
  excludeUris?: string[];
@@ -14,7 +14,7 @@ declare const _default: import("react-redux").ConnectedComponent<({ className, e
14
14
  roles?: string[];
15
15
  }[];
16
16
  }) => JSX.Element, import("react-redux").Omit<{
17
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
17
+ entity?: import("@reltio/mdm-sdk").Entity;
18
18
  caption?: string;
19
19
  includeUris?: string[];
20
20
  excludeUris?: string[];
@@ -2,7 +2,7 @@
2
2
  import AttributesView from './AttributesView';
3
3
  export { AttributesView };
4
4
  declare const _default: import("react-redux").ConnectedComponent<({ className, entity, metadata, caption, excludeUris, includeUris, attributesCount }: {
5
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
5
+ entity?: import("@reltio/mdm-sdk").Entity;
6
6
  caption?: string;
7
7
  includeUris?: string[];
8
8
  excludeUris?: string[];
@@ -14,7 +14,7 @@ declare const _default: import("react-redux").ConnectedComponent<({ className, e
14
14
  roles?: string[];
15
15
  }[];
16
16
  }) => JSX.Element, import("react-redux").Omit<{
17
- entity?: import("@reltio/mdm-sdk").Entity | Record<string, never>;
17
+ entity?: import("@reltio/mdm-sdk").Entity;
18
18
  caption?: string;
19
19
  includeUris?: string[];
20
20
  excludeUris?: string[];
@@ -2,18 +2,24 @@ import React, { useContext } from 'react';
2
2
  import Link from '@material-ui/core/Link';
3
3
  import { useSelector } from 'react-redux';
4
4
  import mdmModule from '@reltio/mdm-module';
5
- import { getTagLink } from '@reltio/mdm-sdk';
6
- import { HistoryDiffContext } from '../../../../../contexts/HistoryAppearanceContext';
5
+ import { getDataTenantEntityUri, getTagLink } from '@reltio/mdm-sdk';
6
+ import { EntityContext, HistoryDiffContext } from '../../../../../contexts';
7
7
  import { getHistoryAppearanceBySpecialAttributeValue, getHistoryAttributeClassName } from '../../helpers/historyAppearance';
8
8
  import { useCommonStyles } from '../styles';
9
9
  var Tag = function (_a) {
10
10
  var value = _a.value;
11
11
  var styles = useCommonStyles();
12
12
  var uiPath = useSelector(mdmModule.selectors.getUIPath);
13
- var entity = useSelector(mdmModule.selectors.getEntity);
13
+ var ownEntity = useContext(EntityContext);
14
+ var currentEntity = useSelector(mdmModule.selectors.getEntity);
14
15
  var appearance = useContext(HistoryDiffContext).appearance;
15
16
  var attributeAppearance = getHistoryAppearanceBySpecialAttributeValue('tags', value, appearance);
16
17
  var historyClassName = getHistoryAttributeClassName(attributeAppearance);
17
- return (React.createElement(Link, { underline: "none", className: styles[historyClassName], href: getTagLink({ uiPath: uiPath, tag: value, entityUri: entity.uri }) }, value));
18
+ var entity = ownEntity || currentEntity;
19
+ return (React.createElement(Link, { underline: "none", className: styles[historyClassName], href: getTagLink({
20
+ uiPath: uiPath,
21
+ tag: value,
22
+ entityUri: entity.dataTenant ? getDataTenantEntityUri(entity) : entity.uri
23
+ }) }, value));
18
24
  };
19
25
  export default Tag;
@@ -3,7 +3,7 @@ declare type OwnProps = {
3
3
  attributesCount?: number;
4
4
  caption?: string;
5
5
  className?: string;
6
- entity?: Entity | Record<string, never>;
6
+ entity?: Entity;
7
7
  excludeUris?: string[];
8
8
  includeUris?: string[];
9
9
  pinnedAttributes?: {
@@ -127,3 +127,4 @@ export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
127
127
  export { MergeButton } from './MergeButton/MergeButton';
128
128
  export { NotMatchButton } from './NotMatchButton/NotMatchButton';
129
129
  export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
130
+ export { default as ProfilesList } from './ProfilesList';
@@ -126,3 +126,4 @@ export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
126
126
  export { MergeButton } from './MergeButton/MergeButton';
127
127
  export { NotMatchButton } from './NotMatchButton/NotMatchButton';
128
128
  export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
129
+ export { default as ProfilesList } from './ProfilesList';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { Entity } from '@reltio/mdm-sdk';
3
+ export declare const EntityContext: React.Context<Entity>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export var EntityContext = React.createContext(null);
3
+ EntityContext.displayName = 'EntityContext';
@@ -14,3 +14,4 @@ export { ExpandedAttributesProvider, useAttributeExpanded } from './ExpandedAttr
14
14
  export { EntityMarkerContext } from './EntityMarkerContext';
15
15
  export { WorkflowTasksContext } from './WorkflowTasksContext';
16
16
  export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
17
+ export { EntityContext } from './EntityContext';
@@ -14,3 +14,4 @@ export { ExpandedAttributesProvider, useAttributeExpanded } from './ExpandedAttr
14
14
  export { EntityMarkerContext } from './EntityMarkerContext';
15
15
  export { WorkflowTasksContext } from './WorkflowTasksContext';
16
16
  export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
17
+ export { EntityContext } from './EntityContext';
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.996",
3
+ "version": "1.4.999",
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.996",
11
- "@reltio/mdm-sdk": "^1.4.996",
10
+ "@reltio/mdm-module": "^1.4.999",
11
+ "@reltio/mdm-sdk": "^1.4.999",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",