@reltio/components 1.4.872 → 1.4.876

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 (40) hide show
  1. package/components/history/HistoryGraph/HistoryCircle.d.ts +14 -0
  2. package/components/history/HistoryGraph/HistoryCircle.js +20 -0
  3. package/components/history/HistoryGraph/HistoryGraph.d.ts +7 -0
  4. package/components/history/HistoryGraph/HistoryGraph.js +86 -0
  5. package/components/history/HistoryGraph/HistoryLink.d.ts +11 -0
  6. package/components/history/HistoryGraph/HistoryLink.js +13 -0
  7. package/components/history/HistoryGraph/helpers.d.ts +2 -0
  8. package/components/history/HistoryGraph/helpers.js +18 -0
  9. package/components/history/HistoryRow/HistoryRow.d.ts +8 -0
  10. package/components/history/HistoryRow/HistoryRow.js +48 -0
  11. package/components/history/HistoryRow/styles.d.ts +5 -0
  12. package/components/history/HistoryRow/styles.js +59 -0
  13. package/components/history/HistoryTree/HistoryTree.d.ts +10 -0
  14. package/components/history/HistoryTree/HistoryTree.js +74 -0
  15. package/components/history/HistoryTree/styles.d.ts +1 -0
  16. package/components/history/HistoryTree/styles.js +26 -0
  17. package/components/history/HistoryView/HistoryView.d.ts +4 -2
  18. package/components/history/HistoryView/HistoryView.js +5 -2
  19. package/components/history/HistoryView/styles.js +4 -1
  20. package/components/history/hooks/useHistory.d.ts +16 -0
  21. package/components/history/hooks/useHistory.js +45 -0
  22. package/components/history/hooks/useHistoryTree.d.ts +9 -0
  23. package/components/history/hooks/useHistoryTree.js +243 -0
  24. package/components/history/hooks/useHistoryWithTotal.d.ts +2 -0
  25. package/components/history/hooks/useHistoryWithTotal.js +19 -1
  26. package/components/history/index.d.ts +1 -0
  27. package/components/history/index.js +3 -1
  28. package/components/history/types/HistoryChangeTypes.d.ts +42 -0
  29. package/components/history/types/HistoryChangeTypes.js +23 -0
  30. package/components/history/types/HistoryData.d.ts +6 -0
  31. package/components/history/types/HistoryData.js +2 -0
  32. package/components/history/types/HistoryLane.d.ts +5 -0
  33. package/components/history/types/HistoryLane.js +2 -0
  34. package/components/history/types/HistoryLife.d.ts +5 -0
  35. package/components/history/types/HistoryLife.js +2 -0
  36. package/components/history/types/HistoryRowData.d.ts +5 -0
  37. package/components/history/types/HistoryRowData.js +2 -0
  38. package/components/history/types/index.d.ts +5 -0
  39. package/components/history/types/index.js +3 -1
  40. package/package.json +3 -3
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ x: number;
4
+ y: number;
5
+ color: string;
6
+ isDashed?: boolean;
7
+ isCollapsed?: boolean;
8
+ showCollapseIcon?: boolean;
9
+ showLine?: boolean;
10
+ };
11
+ export declare const BUMP_RADIUS = 3;
12
+ export declare const LINE_MARGIN = 4;
13
+ declare const HistoryCircle: ({ x, y, color, isDashed, isCollapsed, showCollapseIcon, showLine }: Props) => JSX.Element;
14
+ export default HistoryCircle;
@@ -0,0 +1,20 @@
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.LINE_MARGIN = exports.BUMP_RADIUS = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ exports.BUMP_RADIUS = 3;
9
+ exports.LINE_MARGIN = 4;
10
+ var HistoryCircle = function (_a) {
11
+ var x = _a.x, y = _a.y, color = _a.color, isDashed = _a.isDashed, isCollapsed = _a.isCollapsed, showCollapseIcon = _a.showCollapseIcon, showLine = _a.showLine;
12
+ var radius = showCollapseIcon ? exports.BUMP_RADIUS * 2 : exports.BUMP_RADIUS;
13
+ return (react_1.default.createElement("g", null,
14
+ showLine && (react_1.default.createElement("rect", { id: "line", x: x - radius - exports.LINE_MARGIN, y: y - radius - exports.LINE_MARGIN, width: radius * 2 + exports.LINE_MARGIN * 2, height: 2, fill: color })),
15
+ react_1.default.createElement("circle", { cx: x, cy: y, r: radius, fill: isDashed ? '#fff' : color, stroke: color, strokeDasharray: isDashed ? '1,1' : undefined, strokeWidth: 2 }),
16
+ showCollapseIcon && (react_1.default.createElement("g", { id: "icon" },
17
+ react_1.default.createElement("rect", { x: x - 4, y: y - 1, width: 8, height: 2, fill: "#fff" }),
18
+ isCollapsed && react_1.default.createElement("rect", { x: x - 1, y: y - 4, width: 2, height: 8, fill: "#fff" })))));
19
+ };
20
+ exports.default = HistoryCircle;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { HistoryData } from '../types';
3
+ declare type Props = {
4
+ graphData: HistoryData;
5
+ };
6
+ declare const _default: React.MemoExoticComponent<({ graphData }: Props) => JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var react_1 = __importStar(require("react"));
26
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
27
+ var HistoryLink_1 = __importDefault(require("./HistoryLink"));
28
+ var HistoryCircle_1 = __importDefault(require("./HistoryCircle"));
29
+ var types_1 = require("../types");
30
+ var helpers_1 = require("./helpers");
31
+ var COL_WIDTH = 16;
32
+ var COL_MARGIN = 24;
33
+ var ROW_MARGIN = 16;
34
+ var ROW_HEIGHT = 16;
35
+ var HistoryGraph = function (_a) {
36
+ var graphData = _a.graphData;
37
+ var historyLanes = graphData.historyLanes, rows = graphData.rows;
38
+ var rowPositions = [ROW_MARGIN];
39
+ var _b = rows.reduce(function (acc, _a, i) {
40
+ var uri = _a.uri, height = _a.height, uris = _a.uris, type = _a.type, index = _a.index;
41
+ var x = historyLanes[uri].index * COL_WIDTH + COL_MARGIN;
42
+ var y = rowPositions[i];
43
+ rowPositions.push(y + height);
44
+ var isFakeType = helpers_1.isFakeHistoryType(type);
45
+ var circleUri = isFakeType ? uris[0] : uri;
46
+ var isCollapsed = !(uris === null || uris === void 0 ? void 0 : uris.some(function (uri) { return historyLanes[uri]; }));
47
+ acc.circles.push(react_1.default.createElement(HistoryCircle_1.default, { key: "circle-" + circleUri + "-" + i, x: x, y: y, color: mdm_sdk_1.getContributorColor(circleUri), isDashed: isFakeType, isCollapsed: isCollapsed, showCollapseIcon: !!uris, showLine: type === types_1.HistoryChangeTypes.FAKE_NAVIGATE_PROFILE }));
48
+ acc.rowLines.push(react_1.default.createElement("rect", { key: circleUri + "-" + index, x: x, y: y - ROW_HEIGHT / 2, width: '100%', height: ROW_HEIGHT, fill: mdm_sdk_1.getContributorColor(circleUri), opacity: 0.06 }));
49
+ var isUpRight = type === types_1.HistoryChangeTypes.ENTITIES_SPLITTED;
50
+ uris === null || uris === void 0 ? void 0 : uris.forEach(function (contributorUri) {
51
+ var contributorLane = historyLanes[contributorUri];
52
+ if (!contributorLane)
53
+ return;
54
+ var rowHeight = rows[i].height;
55
+ var toX = contributorLane.index * COL_WIDTH + COL_MARGIN;
56
+ var toY = isUpRight ? y - rowHeight : y + rowHeight;
57
+ if (x !== toX)
58
+ acc.links.push(react_1.default.createElement(HistoryLink_1.default, { key: "link-" + contributorUri + "-" + index, x: x, y: y, toX: toX, toY: toY, isDashed: helpers_1.isFakeHistoryType(type), color: mdm_sdk_1.getContributorColor(contributorUri) }));
59
+ });
60
+ return acc;
61
+ }, { links: [], circles: [], rowLines: [] }), links = _b.links, rowLines = _b.rowLines, circles = _b.circles;
62
+ var width = Object.keys(historyLanes).length * COL_WIDTH + COL_MARGIN;
63
+ var height = rowPositions[rowPositions.length - 1] - ROW_MARGIN;
64
+ Object.entries(historyLanes).forEach(function (_a) {
65
+ var contributorUri = _a[0], contributorLane = _a[1];
66
+ var x = contributorLane.index * COL_WIDTH + COL_MARGIN;
67
+ contributorLane.lifeTime.forEach(function (_a, i) {
68
+ var _b;
69
+ var start = _a.start, end = _a.end;
70
+ if (((_b = rows[end === null || end === void 0 ? void 0 : end.index]) === null || _b === void 0 ? void 0 : _b.type) === types_1.HistoryChangeTypes.ENTITIES_SPLITTED)
71
+ return;
72
+ var startY = rowPositions[start === null || start === void 0 ? void 0 : start.index] || height;
73
+ var endY = rowPositions[(end === null || end === void 0 ? void 0 : end.index) + 1] || ROW_MARGIN;
74
+ var color = mdm_sdk_1.getContributorColor(contributorUri);
75
+ if (!end && contributorLane.index > 0) {
76
+ circles.push(react_1.default.createElement(HistoryCircle_1.default, { key: "initCircle-" + contributorUri + "-" + i, x: x, y: endY, color: color, showLine: true }));
77
+ }
78
+ links.push(react_1.default.createElement("path", { key: "line-" + contributorUri + "-" + i, d: "M" + x + " " + startY + " L" + x + " " + endY, stroke: color, strokeWidth: 2 }));
79
+ });
80
+ });
81
+ return (react_1.default.createElement("svg", { className: "chart", width: width, height: height },
82
+ react_1.default.createElement("g", { id: "rowLines" }, rowLines),
83
+ react_1.default.createElement("g", { id: "links" }, links),
84
+ react_1.default.createElement("g", { id: "circles" }, circles)));
85
+ };
86
+ exports.default = react_1.memo(HistoryGraph);
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ x: number;
4
+ y: number;
5
+ toX: number;
6
+ toY: number;
7
+ color: string;
8
+ isDashed?: boolean;
9
+ };
10
+ declare const HistoryLink: ({ x, y, toX, toY, color, isDashed }: Props) => JSX.Element;
11
+ export default HistoryLink;
@@ -0,0 +1,13 @@
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
+ var react_1 = __importDefault(require("react"));
7
+ var helpers_1 = require("./helpers");
8
+ var HistoryLink = function (_a) {
9
+ var x = _a.x, y = _a.y, toX = _a.toX, toY = _a.toY, color = _a.color, isDashed = _a.isDashed;
10
+ var lineData = helpers_1.getHistoryLinkCurve(x, y, toX, toY);
11
+ return (react_1.default.createElement("path", { d: lineData, stroke: color, strokeWidth: 2, fill: 'none', strokeDasharray: isDashed ? '3,3' : undefined }));
12
+ };
13
+ exports.default = HistoryLink;
@@ -0,0 +1,2 @@
1
+ export declare const getHistoryLinkCurve: (x: number, y: number, toX: number, toY: number) => string;
2
+ export declare const isFakeHistoryType: (type: string) => boolean;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFakeHistoryType = exports.getHistoryLinkCurve = void 0;
4
+ var HistoryChangeTypes_1 = require("../types/HistoryChangeTypes");
5
+ var getHistoryLinkCurve = function (x, y, toX, toY) {
6
+ var isUp = y > toY;
7
+ var isLeft = x < toX;
8
+ var curveStartX = isLeft ? toX - 12 : toX + 12;
9
+ var curveCenterY = isUp ? -6 : 6;
10
+ var curveEndY = isUp ? -12 : 12;
11
+ var curve = isLeft ? "c 6 0 12 " + curveCenterY + " 12" : "c -6 0 -12 " + curveCenterY + " -12";
12
+ return "M" + x + " " + y + " L" + curveStartX + " " + y + " " + curve + " " + curveEndY + " L" + toX + " " + toY;
13
+ };
14
+ exports.getHistoryLinkCurve = getHistoryLinkCurve;
15
+ var isFakeHistoryType = function (type) {
16
+ return type === HistoryChangeTypes_1.HistoryChangeTypes.FAKE_FILTERED_INCOMING || type === HistoryChangeTypes_1.HistoryChangeTypes.FAKE_FILTERED_OUTGOING;
17
+ };
18
+ exports.isFakeHistoryType = isFakeHistoryType;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { HistoryChange } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ change: HistoryChange;
5
+ isCurrent?: boolean;
6
+ };
7
+ declare const _default: React.MemoExoticComponent<({ change, isCurrent }: Props) => JSX.Element>;
8
+ export default _default;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var react_1 = __importStar(require("react"));
26
+ var classnames_1 = __importDefault(require("classnames"));
27
+ var ui_i18n_1 = __importDefault(require("ui-i18n"));
28
+ var mdm_sdk_1 = require("@reltio/mdm-sdk");
29
+ var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
30
+ var activities_1 = require("../../activityLog/utils/activities");
31
+ var styles_1 = require("./styles");
32
+ var HistoryRow = function (_a) {
33
+ var change = _a.change, isCurrent = _a.isCurrent;
34
+ var uri = change.uri, type = change.type, matchGroups = change.matchGroups, user = change.user, timestamp = change.timestamp;
35
+ var color = mdm_sdk_1.getContributorColor(uri);
36
+ var styles = styles_1.useStyles({ color: color });
37
+ return (react_1.default.createElement("div", { className: styles.historyRow },
38
+ react_1.default.createElement("div", { className: styles.rowHeader },
39
+ react_1.default.createElement("div", { className: styles.badge }),
40
+ react_1.default.createElement(Typography_1.default, { className: classnames_1.default(styles.title, { bold: isCurrent }) }, isCurrent ? ui_i18n_1.default.text('Current view') : activities_1.getActivityLabel(type)),
41
+ !isCurrent && react_1.default.createElement(Typography_1.default, { className: styles.date }, ui_i18n_1.default.date(timestamp, 'L LT'))),
42
+ matchGroups && (react_1.default.createElement(Typography_1.default, { className: styles.title },
43
+ ui_i18n_1.default.text('Match rule:'),
44
+ " ",
45
+ matchGroups.join(', '))),
46
+ react_1.default.createElement(Typography_1.default, { className: styles.user }, user)));
47
+ };
48
+ exports.default = react_1.memo(HistoryRow);
@@ -0,0 +1,5 @@
1
+ declare type Type = {
2
+ color?: string;
3
+ };
4
+ export declare const useStyles: (props: Type) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "date" | "user" | "badge" | "historyRow" | "rowHeader">;
5
+ export {};
@@ -0,0 +1,59 @@
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 () { return ({
6
+ historyRow: {
7
+ padding: '8px 12px 16px'
8
+ },
9
+ rowHeader: {
10
+ display: 'flex',
11
+ position: 'relative'
12
+ },
13
+ badge: function (_a) {
14
+ var color = _a.color;
15
+ return ({
16
+ position: 'absolute',
17
+ width: '2px',
18
+ height: '100%',
19
+ left: '-9px',
20
+ pointerEvents: 'none',
21
+ background: color,
22
+ '&:before': {
23
+ height: '100%',
24
+ width: '3px',
25
+ content: '""',
26
+ left: '-3px',
27
+ background: color,
28
+ position: 'absolute',
29
+ opacity: 0.06
30
+ }
31
+ });
32
+ },
33
+ title: {
34
+ color: 'rgba(0,0,0,0.87)',
35
+ fontSize: '13px',
36
+ letterSpacing: 0,
37
+ lineHeight: '16px',
38
+ fontWeight: 400,
39
+ overflow: 'hidden',
40
+ textOverflow: 'ellipsis',
41
+ whiteSpace: 'nowrap',
42
+ '&.bold': {
43
+ fontWeight: 500
44
+ }
45
+ },
46
+ date: {
47
+ marginLeft: 'auto',
48
+ color: 'rgba(0,0,0,0.54)',
49
+ fontSize: '11px',
50
+ letterSpacing: 0,
51
+ lineHeight: '16px'
52
+ },
53
+ user: {
54
+ color: 'rgba(0,0,0,0.38)',
55
+ fontSize: '12px',
56
+ letterSpacing: 0,
57
+ lineHeight: '14px'
58
+ }
59
+ }); });
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { HistoryData } from '../types';
3
+ declare type Props = {
4
+ historyData: HistoryData;
5
+ canLoadMore: boolean;
6
+ onLoadMore: () => void;
7
+ isLoading: boolean;
8
+ };
9
+ declare const HistoryTree: ({ historyData, isLoading, canLoadMore, onLoadMore }: Props) => JSX.Element;
10
+ export default HistoryTree;
@@ -0,0 +1,74 @@
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 react_resize_detector_1 = __importDefault(require("react-resize-detector"));
38
+ var ui_i18n_1 = __importDefault(require("ui-i18n"));
39
+ var ramda_1 = require("ramda");
40
+ var classnames_1 = __importDefault(require("classnames"));
41
+ var Button_1 = __importDefault(require("@material-ui/core/Button"));
42
+ var HistoryRow_1 = __importDefault(require("../HistoryRow/HistoryRow"));
43
+ var HistoryGraph_1 = __importDefault(require("../HistoryGraph/HistoryGraph"));
44
+ var LinearLoadIndicator_1 = __importDefault(require("../../LinearLoadIndicator/LinearLoadIndicator"));
45
+ var styles_1 = require("./styles");
46
+ var HistoryTree = function (_a) {
47
+ var _b;
48
+ var _c;
49
+ var historyData = _a.historyData, isLoading = _a.isLoading, canLoadMore = _a.canLoadMore, onLoadMore = _a.onLoadMore;
50
+ var styles = styles_1.useStyles();
51
+ var _d = react_1.useState({ historyLanes: {}, rows: [] }), graphData = _d[0], setGraphData = _d[1];
52
+ var _e = react_1.useState(false), isScrollable = _e[0], setIsScrollable = _e[1];
53
+ var graphRef = react_1.useRef(null);
54
+ var rowsRef = react_1.useCallback(function (node) {
55
+ var _a;
56
+ if (!ramda_1.isNil(node)) {
57
+ var rows = (_a = historyData.rows) === null || _a === void 0 ? void 0 : _a.map(function (item, i) { var _a; return (__assign(__assign({}, item), { height: (_a = node.childNodes[i]) === null || _a === void 0 ? void 0 : _a.clientHeight })); });
58
+ setGraphData({ historyLanes: historyData.historyLanes, rows: rows });
59
+ }
60
+ }, [historyData]);
61
+ var handleGraphScroll = function () {
62
+ var _a = (graphRef === null || graphRef === void 0 ? void 0 : graphRef.current) || {}, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth, scrollLeft = _a.scrollLeft;
63
+ setIsScrollable(scrollLeft < scrollWidth - clientWidth);
64
+ };
65
+ return (react_1.default.createElement("div", { className: styles.historyTree },
66
+ isLoading && react_1.default.createElement(LinearLoadIndicator_1.default, null),
67
+ react_1.default.createElement("div", { className: classnames_1.default(styles.graph, (_b = {}, _b[styles.shadow] = isScrollable, _b)), onScroll: handleGraphScroll, ref: graphRef },
68
+ react_1.default.createElement(HistoryGraph_1.default, { graphData: graphData }),
69
+ react_1.default.createElement(react_resize_detector_1.default, { handleWidth: true, onResize: handleGraphScroll })),
70
+ react_1.default.createElement("div", { ref: rowsRef, className: styles.history }, (_c = historyData.rows) === null || _c === void 0 ? void 0 : _c.map(function (change, i) { return (react_1.default.createElement(HistoryRow_1.default, { key: "row-" + i, change: change, isCurrent: i === 0 })); })),
71
+ canLoadMore && (react_1.default.createElement("div", { className: styles.buttonContainer },
72
+ react_1.default.createElement(Button_1.default, { color: "primary", onClick: function () { return onLoadMore(); } }, ui_i18n_1.default.text('Show more'))))));
73
+ };
74
+ exports.default = HistoryTree;
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"history" | "historyTree" | "graph" | "buttonContainer" | "shadow">;
@@ -0,0 +1,26 @@
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({
6
+ historyTree: {
7
+ display: 'grid',
8
+ gridTemplateColumns: 'auto 1fr',
9
+ overflowY: 'auto'
10
+ },
11
+ graph: {
12
+ overflowX: 'scroll',
13
+ overflowY: 'hidden'
14
+ },
15
+ history: {
16
+ minWidth: 344
17
+ },
18
+ buttonContainer: {
19
+ gridColumnStart: 1,
20
+ gridColumnEnd: 3,
21
+ padding: '8px 16px'
22
+ },
23
+ shadow: {
24
+ boxShadow: 'inset -8px 0px 5px -5px rgba(0,0,0,0.1)'
25
+ }
26
+ });
@@ -1,10 +1,12 @@
1
- import { HistoryWithTotal } from '@reltio/mdm-sdk';
2
1
  import React from 'react';
2
+ import { HistoryWithTotal } from '@reltio/mdm-sdk';
3
3
  declare type Props = {
4
4
  isLoading: boolean;
5
5
  historyWithTotal: HistoryWithTotal;
6
6
  contributorsUris: string[];
7
7
  entityUri: string;
8
+ canLoadMore: boolean;
9
+ onLoadMore: () => void;
8
10
  };
9
- declare const _default: React.MemoExoticComponent<({ isLoading, historyWithTotal, contributorsUris, entityUri }: Props) => JSX.Element>;
11
+ declare const _default: React.MemoExoticComponent<({ isLoading, historyWithTotal, contributorsUris, entityUri, canLoadMore, onLoadMore }: Props) => JSX.Element>;
10
12
  export default _default;
@@ -23,17 +23,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var react_1 = __importStar(require("react"));
26
+ var HistoryTree_1 = __importDefault(require("../HistoryTree/HistoryTree"));
26
27
  var ContributorsPanel_1 = __importDefault(require("../ContributorsPanel/ContributorsPanel"));
28
+ var useHistoryTree_1 = require("../hooks/useHistoryTree");
27
29
  var styles_1 = require("./styles");
28
30
  var HistoryView = function (_a) {
29
- var isLoading = _a.isLoading, historyWithTotal = _a.historyWithTotal, contributorsUris = _a.contributorsUris, entityUri = _a.entityUri;
31
+ var isLoading = _a.isLoading, historyWithTotal = _a.historyWithTotal, contributorsUris = _a.contributorsUris, entityUri = _a.entityUri, canLoadMore = _a.canLoadMore, onLoadMore = _a.onLoadMore;
30
32
  var styles = styles_1.useStyles();
31
33
  var _b = react_1.useState(null), selectedUris = _b[0], setSelectedUris = _b[1];
32
34
  react_1.useEffect(function () {
33
35
  setSelectedUris(contributorsUris);
34
36
  }, [contributorsUris]);
37
+ var historyData = useHistoryTree_1.useHistoryTree({ entityUri: entityUri, historyChanges: historyWithTotal === null || historyWithTotal === void 0 ? void 0 : historyWithTotal.changes, selectedUris: selectedUris });
35
38
  return (react_1.default.createElement("div", { className: styles.root },
36
39
  react_1.default.createElement(ContributorsPanel_1.default, { values: contributorsUris, selectedValues: selectedUris, onSelectValues: setSelectedUris, entityUri: entityUri, className: styles.borderBottom }),
37
- !isLoading && react_1.default.createElement("div", null, "total: " + (historyWithTotal === null || historyWithTotal === void 0 ? void 0 : historyWithTotal.total))));
40
+ react_1.default.createElement(HistoryTree_1.default, { historyData: historyData, isLoading: isLoading, onLoadMore: onLoadMore, canLoadMore: canLoadMore })));
38
41
  };
39
42
  exports.default = react_1.memo(HistoryView);
@@ -4,7 +4,10 @@ exports.useStyles = void 0;
4
4
  var styles_1 = require("@material-ui/core/styles");
5
5
  exports.useStyles = styles_1.makeStyles({
6
6
  root: {
7
- flex: 1
7
+ display: 'flex',
8
+ flexDirection: 'column',
9
+ overflow: 'hidden',
10
+ position: 'relative'
8
11
  },
9
12
  borderBottom: {
10
13
  borderBottom: '1px solid rgba(0, 0, 0, 0.12)'
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { HistoryFilter } from '../types';
3
+ declare type Props = {
4
+ entityUri: string;
5
+ enabled: boolean;
6
+ };
7
+ export declare const useHistory: ({ entityUri, enabled }: Props) => {
8
+ isLoading: boolean;
9
+ canLoadMore: boolean;
10
+ onLoadMore: () => void;
11
+ historicUris: string[];
12
+ historyWithTotal: import("@reltio/mdm-sdk").HistoryWithTotal;
13
+ historyFilter: HistoryFilter;
14
+ setHistoryFilter: import("react").Dispatch<import("react").SetStateAction<HistoryFilter>>;
15
+ };
16
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useHistory = void 0;
4
+ var react_1 = require("react");
5
+ var useHistoricUris_1 = require("./useHistoricUris");
6
+ var useHistoryWithTotal_1 = require("./useHistoryWithTotal");
7
+ var MAX_HISTORY_ROWS = 32;
8
+ var useHistory = function (_a) {
9
+ var entityUri = _a.entityUri, enabled = _a.enabled;
10
+ var _b = react_1.useState(null), historyFilter = _b[0], setHistoryFilter = _b[1];
11
+ var _c = react_1.useState(0), historyPage = _c[0], setHistoryPage = _c[1];
12
+ var _d = useHistoricUris_1.useHistoricUris({
13
+ entityUri: entityUri,
14
+ enabled: enabled
15
+ }), isHistoricUrisLoading = _d.isLoading, historicUris = _d.historicUris;
16
+ var _e = useHistoryWithTotal_1.useHistoryWithTotal({
17
+ entityUri: entityUri,
18
+ enabled: enabled && !!historicUris,
19
+ historicUris: historicUris,
20
+ max: MAX_HISTORY_ROWS,
21
+ offset: historyPage * MAX_HISTORY_ROWS,
22
+ order: 'desc',
23
+ showAll: true
24
+ }), isHistoryLoading = _e.isLoading, historyWithTotal = _e.historyWithTotal, loadMore = _e.loadMore;
25
+ var canLoadMore = react_1.useMemo(function () { return (historyPage + 1) * MAX_HISTORY_ROWS <= (historyWithTotal === null || historyWithTotal === void 0 ? void 0 : historyWithTotal.total); }, [
26
+ historyWithTotal,
27
+ historyPage
28
+ ]);
29
+ var onLoadMore = react_1.useCallback(function () {
30
+ if (!canLoadMore)
31
+ return;
32
+ loadMore((historyPage + 1) * MAX_HISTORY_ROWS);
33
+ setHistoryPage(historyPage + 1);
34
+ }, [loadMore, historyPage, canLoadMore]);
35
+ return {
36
+ isLoading: isHistoryLoading || isHistoricUrisLoading,
37
+ canLoadMore: canLoadMore,
38
+ onLoadMore: onLoadMore,
39
+ historicUris: historicUris,
40
+ historyWithTotal: historyWithTotal,
41
+ historyFilter: historyFilter,
42
+ setHistoryFilter: setHistoryFilter
43
+ };
44
+ };
45
+ exports.useHistory = useHistory;
@@ -0,0 +1,9 @@
1
+ import { HistoryChange } from '@reltio/mdm-sdk';
2
+ import { HistoryData } from './../types';
3
+ declare type Props = {
4
+ entityUri: string;
5
+ historyChanges: HistoryChange[];
6
+ selectedUris: string[];
7
+ };
8
+ export declare const useHistoryTree: ({ entityUri, historyChanges, selectedUris }: Props) => HistoryData;
9
+ export {};
@@ -0,0 +1,243 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.useHistoryTree = void 0;
15
+ var react_1 = require("react");
16
+ var ramda_1 = require("ramda");
17
+ var types_1 = require("./../types");
18
+ var useHistoryTree = function (_a) {
19
+ var entityUri = _a.entityUri, historyChanges = _a.historyChanges, selectedUris = _a.selectedUris;
20
+ return react_1.useMemo(function () {
21
+ var _a;
22
+ var historyLanes = (_a = {}, _a[entityUri] = { index: 0, lifeTime: [] }, _a);
23
+ var rows = [
24
+ { type: types_1.HistoryChangeTypes.FAKE_UPDATE, user: '', timestamp: 0, uri: entityUri }
25
+ ];
26
+ var checkChange = ramda_1.curry(function (involvedUris, change) {
27
+ var _a;
28
+ var uri = change.uri || entityUri;
29
+ if (Array.isArray(involvedUris)) {
30
+ if (change.type !== types_1.HistoryChangeTypes.ENTITY_LOST_MERGE)
31
+ return null;
32
+ if (involvedUris.includes(uri)) {
33
+ return change;
34
+ }
35
+ else if (change.uris) {
36
+ return involvedUris.some(function (involvedUri) { return change.uris.includes(involvedUri); }) ? change : null;
37
+ }
38
+ }
39
+ else {
40
+ if (uri === involvedUris || ((_a = change.uris) === null || _a === void 0 ? void 0 : _a.includes(involvedUris)))
41
+ return change;
42
+ }
43
+ return null;
44
+ });
45
+ var findPreviousChange = function (index, involvedUris) {
46
+ return ramda_1.pipe(ramda_1.slice(0, index - 1), ramda_1.reverse, ramda_1.find(checkChange(involvedUris)))(historyChanges);
47
+ };
48
+ var checkLaneUri = function (uri) {
49
+ var contributorLane = historyLanes[uri];
50
+ if (!contributorLane && (!selectedUris || selectedUris.includes(uri))) {
51
+ historyLanes[uri] = {
52
+ index: Object.keys(historyLanes).length,
53
+ lifeTime: []
54
+ };
55
+ }
56
+ return contributorLane;
57
+ };
58
+ var startNewLife = function (lifeTime, change) {
59
+ var currentLife = lifeTime[lifeTime.length - 1];
60
+ if (currentLife &&
61
+ (!currentLife.start ||
62
+ (currentLife.start.type === types_1.HistoryChangeTypes.ENTITY_CREATED &&
63
+ change.type === types_1.HistoryChangeTypes.ENTITIES_SPLITTED))) {
64
+ currentLife.start = change;
65
+ return;
66
+ }
67
+ lifeTime.push({ start: change, end: null });
68
+ };
69
+ var updateLife = function (lifeTime, change) {
70
+ var shouldAddNewLife = true;
71
+ if (lifeTime.length) {
72
+ var currentLife = lifeTime[lifeTime.length - 1];
73
+ shouldAddNewLife = !((!currentLife.start || currentLife.start.timestamp < change.timestamp) &&
74
+ (!currentLife.end || currentLife.end.timestamp > change.timestamp));
75
+ }
76
+ if (shouldAddNewLife) {
77
+ lifeTime.push({ start: null, end: null });
78
+ }
79
+ };
80
+ var endLife = function (lifeTime, change) {
81
+ if (lifeTime.length) {
82
+ var currentLife = lifeTime[lifeTime.length - 1];
83
+ if (!currentLife.start)
84
+ currentLife.start = change;
85
+ }
86
+ lifeTime.push({ start: null, end: change });
87
+ };
88
+ var checkLifeTime = function (lifeTime, change) {
89
+ var _a, _b;
90
+ switch (change.type) {
91
+ case types_1.HistoryChangeTypes.ENTITY_CREATED:
92
+ startNewLife(lifeTime, change);
93
+ break;
94
+ case types_1.HistoryChangeTypes.ENTITIES_MERGED_ON_THE_FLY:
95
+ case types_1.HistoryChangeTypes.ENTITY_CHANGED:
96
+ updateLife(lifeTime, change);
97
+ break;
98
+ case types_1.HistoryChangeTypes.ENTITY_LOST_MERGE:
99
+ case types_1.HistoryChangeTypes.ENTITY_REMOVED:
100
+ endLife(lifeTime, change);
101
+ break;
102
+ case types_1.HistoryChangeTypes.ENTITIES_SPLITTED:
103
+ updateLife(lifeTime, change);
104
+ (_a = change.uris) === null || _a === void 0 ? void 0 : _a.forEach(function (uri) {
105
+ var relatedLane = historyLanes[uri];
106
+ if (!relatedLane)
107
+ return;
108
+ var lifeTimeLength = relatedLane.lifeTime.length;
109
+ lifeTimeLength
110
+ ? startNewLife(relatedLane.lifeTime, change)
111
+ : endLife(relatedLane.lifeTime, change);
112
+ rows.push({
113
+ type: lifeTimeLength
114
+ ? types_1.HistoryChangeTypes.FAKE_UPDATE
115
+ : types_1.HistoryChangeTypes.FAKE_NAVIGATE_PROFILE,
116
+ uri: uri,
117
+ user: change.user,
118
+ timestamp: change.timestamp
119
+ });
120
+ });
121
+ break;
122
+ case types_1.HistoryChangeTypes.ENTITIES_MERGED:
123
+ case types_1.HistoryChangeTypes.ENTITIES_MERGED_MANUALLY:
124
+ updateLife(lifeTime, change);
125
+ (_b = change.uris) === null || _b === void 0 ? void 0 : _b.forEach(function (uri) {
126
+ var relatedLane = historyLanes[uri];
127
+ if (relatedLane)
128
+ endLife(relatedLane.lifeTime, change);
129
+ });
130
+ break;
131
+ }
132
+ };
133
+ var postProcessChanges = [];
134
+ historyChanges === null || historyChanges === void 0 ? void 0 : historyChanges.forEach(function (change, index) {
135
+ var _a;
136
+ switch (change.type) {
137
+ case types_1.HistoryChangeTypes.ENTITIES_SPLITTED:
138
+ if (!findPreviousChange(index, change.uri || entityUri)) {
139
+ return;
140
+ }
141
+ else {
142
+ var uri = change.uri;
143
+ var involvedUris = change.uris ? [change.uris, uri] : [uri];
144
+ var lostMergeChange = findPreviousChange(index, involvedUris);
145
+ if (lostMergeChange && (!uri || uri === lostMergeChange.uri))
146
+ return;
147
+ }
148
+ break;
149
+ case types_1.HistoryChangeTypes.ENTITY_LOST_MERGE:
150
+ case types_1.HistoryChangeTypes.RELATIONSHIP_CREATED:
151
+ case types_1.HistoryChangeTypes.RELATIONSHIP_REMOVED:
152
+ case types_1.HistoryChangeTypes.RELATIONSHIP_CHANGED:
153
+ return;
154
+ }
155
+ var addPostProcess = false;
156
+ (_a = change.uris) === null || _a === void 0 ? void 0 : _a.forEach(function (uri) {
157
+ if (!checkLaneUri(uri))
158
+ addPostProcess = true;
159
+ });
160
+ var contributorLane = checkLaneUri(change.uri || entityUri);
161
+ if (!contributorLane)
162
+ return;
163
+ var rowChange = __assign({}, change);
164
+ checkLifeTime(contributorLane.lifeTime, rowChange);
165
+ if (addPostProcess)
166
+ postProcessChanges.push(rowChange);
167
+ rows.push(rowChange);
168
+ });
169
+ postProcessChanges.forEach(function (postChange) {
170
+ postChange.uris.forEach(function (postUri) {
171
+ if (historyLanes[postUri])
172
+ return;
173
+ historyChanges.forEach(function (_a) {
174
+ var uri = _a.uri, uris = _a.uris, timestamp = _a.timestamp, user = _a.user, type = _a.type;
175
+ if (uri !== postUri)
176
+ return;
177
+ uris === null || uris === void 0 ? void 0 : uris.forEach(function (contributorUri) {
178
+ var contributorLane = historyLanes[contributorUri];
179
+ if (!contributorLane)
180
+ return;
181
+ var fakeType = null;
182
+ switch (type) {
183
+ case types_1.HistoryChangeTypes.ENTITIES_MERGED:
184
+ case types_1.HistoryChangeTypes.ENTITIES_MERGED_MANUALLY:
185
+ fakeType = types_1.HistoryChangeTypes.FAKE_FILTERED_INCOMING;
186
+ break;
187
+ case types_1.HistoryChangeTypes.ENTITIES_SPLITTED:
188
+ fakeType = types_1.HistoryChangeTypes.FAKE_FILTERED_OUTGOING;
189
+ break;
190
+ default:
191
+ return;
192
+ }
193
+ var fakeChange = {
194
+ type: fakeType,
195
+ uri: postChange.uri,
196
+ uris: [contributorUri],
197
+ user: user,
198
+ timestamp: timestamp
199
+ };
200
+ var extendLife = findClosestLife(contributorLane.lifeTime, postChange.timestamp);
201
+ if (fakeType === types_1.HistoryChangeTypes.FAKE_FILTERED_INCOMING) {
202
+ if (!ramda_1.isNil(extendLife.endIndex)) {
203
+ contributorLane.lifeTime[extendLife.endIndex].end = fakeChange;
204
+ }
205
+ }
206
+ else {
207
+ if (!ramda_1.isNil(extendLife.startIndex)) {
208
+ contributorLane.lifeTime[extendLife.startIndex].start = fakeChange;
209
+ }
210
+ }
211
+ rows.splice(rows.indexOf(postChange), 0, fakeChange);
212
+ });
213
+ });
214
+ });
215
+ });
216
+ rows.forEach(function (row, i) {
217
+ row.index = i;
218
+ row.uri = row.uri || entityUri;
219
+ });
220
+ return { historyLanes: historyLanes, rows: rows };
221
+ }, [entityUri, historyChanges, selectedUris]);
222
+ };
223
+ exports.useHistoryTree = useHistoryTree;
224
+ var findClosestLife = function (lifeTime, timestamp) {
225
+ return lifeTime.reduce(function (acc, _a, i) {
226
+ var start = _a.start, end = _a.end;
227
+ if (start) {
228
+ var d = timestamp - start.timestamp;
229
+ if (ramda_1.isNil(acc.startDistance) || (Math.abs(acc.startDistance) > Math.abs(d) && d > 0)) {
230
+ acc.startIndex = i;
231
+ acc.startDistance = d;
232
+ }
233
+ }
234
+ if (end) {
235
+ var d = timestamp - end.timestamp;
236
+ if (ramda_1.isNil(acc.endDistance) || (Math.abs(acc.endDistance) > Math.abs(d) && d < 0)) {
237
+ acc.endIndex = i;
238
+ acc.endDistance = d;
239
+ }
240
+ }
241
+ return acc;
242
+ }, { startIndex: null, endIndex: null, startDistance: null, endDistance: null });
243
+ };
@@ -3,6 +3,7 @@ declare type Props = {
3
3
  entityUri: string;
4
4
  enabled?: boolean;
5
5
  historicUris: string[];
6
+ showAll?: boolean;
6
7
  max?: number;
7
8
  offset?: number;
8
9
  order?: string;
@@ -11,5 +12,6 @@ declare type Props = {
11
12
  export declare const useHistoryWithTotal: ({ entityUri, enabled, historicUris, ...options }: Props) => {
12
13
  isLoading: boolean;
13
14
  historyWithTotal: HistoryWithTotal;
15
+ loadMore: (offset: number) => void;
14
16
  };
15
17
  export {};
@@ -21,6 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  }
22
22
  return t;
23
23
  };
24
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
25
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
26
+ to[j] = from[i];
27
+ return to;
28
+ };
24
29
  Object.defineProperty(exports, "__esModule", { value: true });
25
30
  exports.useHistoryWithTotal = void 0;
26
31
  var react_1 = require("react");
@@ -51,11 +56,24 @@ var useHistoryWithTotal = function (_a) {
51
56
  setHistoryWithTotal(null);
52
57
  }
53
58
  }, [entityUri, historicUris]);
59
+ var loadMore = react_1.useCallback(function (offset) {
60
+ if (entityUri && historicUris) {
61
+ setIsLoading(true);
62
+ safePromise(mdm_sdk_1.getHistoryWithTotal(__assign(__assign({ entityUri: entityUri, historicUris: historicUris }, options), { offset: offset })))
63
+ .then(function (results) {
64
+ setHistoryWithTotal(function (prev) { return (__assign(__assign({}, prev), { changes: __spreadArray(__spreadArray([], prev === null || prev === void 0 ? void 0 : prev.changes), results.changes) })); });
65
+ })
66
+ .catch(onError)
67
+ .finally(function () {
68
+ setIsLoading(false);
69
+ });
70
+ }
71
+ }, [entityUri, historicUris]);
54
72
  react_1.useEffect(function () {
55
73
  if (enabled) {
56
74
  loadData();
57
75
  }
58
76
  }, [loadData, enabled]);
59
- return { isLoading: isLoading, historyWithTotal: historyWithTotal };
77
+ return { isLoading: isLoading, historyWithTotal: historyWithTotal, loadMore: loadMore };
60
78
  };
61
79
  exports.useHistoryWithTotal = useHistoryWithTotal;
@@ -1,6 +1,7 @@
1
1
  export { useHistoricUris } from './hooks/useHistoricUris';
2
2
  export { useHistoryWithTotal } from './hooks/useHistoryWithTotal';
3
3
  export { useHistorySlice } from './hooks/useHistorySlice';
4
+ export { useHistory } from './hooks/useHistory';
4
5
  export { default as HistoryView } from './HistoryView/HistoryView';
5
6
  export { default as HistoryHeader } from './HistoryHeader/HistoryHeader';
6
7
  export { default as ProfileBandHistory } from './ProfileBandHistory/ProfileBandHistory';
@@ -13,13 +13,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProfileBandHistory = exports.HistoryHeader = exports.HistoryView = exports.useHistorySlice = exports.useHistoryWithTotal = exports.useHistoricUris = void 0;
16
+ exports.ProfileBandHistory = exports.HistoryHeader = exports.HistoryView = exports.useHistory = exports.useHistorySlice = exports.useHistoryWithTotal = exports.useHistoricUris = void 0;
17
17
  var useHistoricUris_1 = require("./hooks/useHistoricUris");
18
18
  Object.defineProperty(exports, "useHistoricUris", { enumerable: true, get: function () { return useHistoricUris_1.useHistoricUris; } });
19
19
  var useHistoryWithTotal_1 = require("./hooks/useHistoryWithTotal");
20
20
  Object.defineProperty(exports, "useHistoryWithTotal", { enumerable: true, get: function () { return useHistoryWithTotal_1.useHistoryWithTotal; } });
21
21
  var useHistorySlice_1 = require("./hooks/useHistorySlice");
22
22
  Object.defineProperty(exports, "useHistorySlice", { enumerable: true, get: function () { return useHistorySlice_1.useHistorySlice; } });
23
+ var useHistory_1 = require("./hooks/useHistory");
24
+ Object.defineProperty(exports, "useHistory", { enumerable: true, get: function () { return useHistory_1.useHistory; } });
23
25
  var HistoryView_1 = require("./HistoryView/HistoryView");
24
26
  Object.defineProperty(exports, "HistoryView", { enumerable: true, get: function () { return __importDefault(HistoryView_1).default; } });
25
27
  var HistoryHeader_1 = require("./HistoryHeader/HistoryHeader");
@@ -0,0 +1,42 @@
1
+ import { ActivityTypes } from '../../activityLog/types/ActivityTypes';
2
+ declare enum FakeTypes {
3
+ FAKE_NAVIGATE_PROFILE = "FAKE_NAVIGATE_PROFILE",
4
+ FAKE_FILTERED_INCOMING = "FAKE_FILTERED_INCOMING",
5
+ FAKE_FILTERED_OUTGOING = "FAKE_FILTERED_OUTGOING",
6
+ FAKE_UPDATE = "FAKE_UPDATE"
7
+ }
8
+ export declare const HistoryChangeTypes: {
9
+ FAKE_NAVIGATE_PROFILE: FakeTypes.FAKE_NAVIGATE_PROFILE;
10
+ FAKE_FILTERED_INCOMING: FakeTypes.FAKE_FILTERED_INCOMING;
11
+ FAKE_FILTERED_OUTGOING: FakeTypes.FAKE_FILTERED_OUTGOING;
12
+ FAKE_UPDATE: FakeTypes.FAKE_UPDATE;
13
+ MODEL_UPDATED: ActivityTypes.MODEL_UPDATED;
14
+ ENTITY_REMOVED: ActivityTypes.ENTITY_REMOVED;
15
+ ENTITY_CREATED: ActivityTypes.ENTITY_CREATED;
16
+ ENTITY_CHANGED: ActivityTypes.ENTITY_CHANGED;
17
+ ENTITIES_MERGED: ActivityTypes.ENTITIES_MERGED;
18
+ ENTITIES_SPLITTED: ActivityTypes.ENTITIES_SPLITTED;
19
+ ENTITY_LOST_MERGE: ActivityTypes.ENTITY_LOST_MERGE;
20
+ RELATIONSHIP_CREATED: ActivityTypes.RELATIONSHIP_CREATED;
21
+ RELATIONSHIP_REMOVED: ActivityTypes.RELATIONSHIP_REMOVED;
22
+ RELATIONSHIP_CHANGED: ActivityTypes.RELATIONSHIP_CHANGED;
23
+ POTENTIAL_MATCHES_FOUND: ActivityTypes.POTENTIAL_MATCHES_FOUND;
24
+ NOT_MATCHES_SET: ActivityTypes.NOT_MATCHES_SET;
25
+ NOT_MATCHES_RESET: ActivityTypes.NOT_MATCHES_RESET;
26
+ PERIODIC_TASK_SCHEDULED: ActivityTypes.PERIODIC_TASK_SCHEDULED;
27
+ ENTITIES_MERGED_MANUALLY: ActivityTypes.ENTITIES_MERGED_MANUALLY;
28
+ POTENTIAL_MATCHES_REMOVED: ActivityTypes.POTENTIAL_MATCHES_REMOVED;
29
+ ENTITIES_MERGED_ON_THE_FLY: ActivityTypes.ENTITIES_MERGED_ON_THE_FLY;
30
+ USER_LOGIN: ActivityTypes.USER_LOGIN;
31
+ USER_LOGOUT: ActivityTypes.USER_LOGOUT;
32
+ USER_SEARCH: ActivityTypes.USER_SEARCH;
33
+ USER_PROFILE_VIEW: ActivityTypes.USER_PROFILE_VIEW;
34
+ COMMENT_ADDED: ActivityTypes.COMMENT_ADDED;
35
+ COMMENT_UPDATED: ActivityTypes.COMMENT_UPDATED;
36
+ COMMENT_DELETED: ActivityTypes.COMMENT_DELETED;
37
+ GROUP_CREATED: ActivityTypes.GROUP_CREATED;
38
+ GROUP_REMOVED: ActivityTypes.GROUP_REMOVED;
39
+ GROUP_CHANGED: ActivityTypes.GROUP_CHANGED;
40
+ };
41
+ export declare type HistoryChangeTypes = typeof HistoryChangeTypes;
42
+ export {};
@@ -0,0 +1,23 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.HistoryChangeTypes = void 0;
15
+ var ActivityTypes_1 = require("../../activityLog/types/ActivityTypes");
16
+ var FakeTypes;
17
+ (function (FakeTypes) {
18
+ FakeTypes["FAKE_NAVIGATE_PROFILE"] = "FAKE_NAVIGATE_PROFILE";
19
+ FakeTypes["FAKE_FILTERED_INCOMING"] = "FAKE_FILTERED_INCOMING";
20
+ FakeTypes["FAKE_FILTERED_OUTGOING"] = "FAKE_FILTERED_OUTGOING";
21
+ FakeTypes["FAKE_UPDATE"] = "FAKE_UPDATE";
22
+ })(FakeTypes || (FakeTypes = {}));
23
+ exports.HistoryChangeTypes = __assign(__assign({}, ActivityTypes_1.ActivityTypes), FakeTypes);
@@ -0,0 +1,6 @@
1
+ import { HistoryLane } from './HistoryLane';
2
+ import { HistoryRowData } from './HistoryRowData';
3
+ export declare type HistoryData = {
4
+ rows: HistoryRowData[];
5
+ historyLanes: Record<string, HistoryLane>;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { HistoryLife } from './HistoryLife';
2
+ export declare type HistoryLane = {
3
+ index: number;
4
+ lifeTime: HistoryLife[];
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { HistoryRowData } from './HistoryRowData';
2
+ export declare type HistoryLife = {
3
+ start?: HistoryRowData;
4
+ end?: HistoryRowData;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { HistoryChange } from '@reltio/mdm-sdk';
2
+ export declare type HistoryRowData = HistoryChange & {
3
+ index?: number;
4
+ height?: number;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,7 @@
1
+ export type { HistoryRowData } from './HistoryRowData';
1
2
  export type { HistoryFilter } from './HistoryFilter';
3
+ export type { HistoryLane } from './HistoryLane';
4
+ export type { HistoryLife } from './HistoryLife';
5
+ export type { HistoryData } from './HistoryData';
2
6
  export { HistoryActivityType } from './HistoryFilter';
7
+ export { HistoryChangeTypes } from './HistoryChangeTypes';
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HistoryActivityType = void 0;
3
+ exports.HistoryChangeTypes = exports.HistoryActivityType = void 0;
4
4
  var HistoryFilter_1 = require("./HistoryFilter");
5
5
  Object.defineProperty(exports, "HistoryActivityType", { enumerable: true, get: function () { return HistoryFilter_1.HistoryActivityType; } });
6
+ var HistoryChangeTypes_1 = require("./HistoryChangeTypes");
7
+ Object.defineProperty(exports, "HistoryChangeTypes", { enumerable: true, get: function () { return HistoryChangeTypes_1.HistoryChangeTypes; } });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.872",
3
+ "version": "1.4.876",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "@date-io/moment": "^1.3.5",
8
8
  "@react-google-maps/api": "^2.7.0",
9
- "@reltio/mdm-module": "^1.4.872",
10
- "@reltio/mdm-sdk": "^1.4.872",
9
+ "@reltio/mdm-module": "^1.4.876",
10
+ "@reltio/mdm-sdk": "^1.4.876",
11
11
  "classnames": "^2.2.5",
12
12
  "frontend-collective-react-dnd-scrollzone": "^1.0.2",
13
13
  "nanoid": "^2.0.0",