@reltio/components 1.4.1571 → 1.4.1573

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 (61) hide show
  1. package/cjs/components/BasicTableView/BasicTable/BasicTable.js +14 -3
  2. package/cjs/components/BasicTableView/BasicTable/CellRenderer/CellRenderer.d.ts +3 -3
  3. package/cjs/components/BasicTableView/BasicTable/CellRenderer/CellRenderer.js +4 -3
  4. package/cjs/components/BasicTableView/BasicTable/helpers/dataHelpers.d.ts +1 -1
  5. package/cjs/components/BasicTableView/BasicTable/helpers/dataHelpers.js +6 -4
  6. package/cjs/components/BasicTableView/BasicTable/hooks/useBasicTableCellRenderer.d.ts +12 -16
  7. package/cjs/components/BasicTableView/BasicTable/hooks/useBasicTableCellRenderer.js +9 -8
  8. package/cjs/components/BasicTableView/BasicTable/hooks/useCollapsibleTableRows.d.ts +3 -2
  9. package/cjs/components/BasicTableView/BasicTable/hooks/useCollapsibleTableRows.js +2 -2
  10. package/cjs/components/BasicTableView/BasicTable/hooks/useDynamicRowCellHeight.d.ts +9 -2
  11. package/cjs/components/BasicTableView/BasicTable/hooks/useDynamicRowCellHeight.js +3 -2
  12. package/cjs/components/BasicTableView/RowCellAutoSizer/RowCellAutoSizer.d.ts +2 -1
  13. package/cjs/components/BasicTableView/RowCellAutoSizer/RowCellAutoSizer.js +1 -1
  14. package/cjs/components/BasicTableView/types/index.d.ts +10 -7
  15. package/cjs/components/crosswalks/AttributesTable/AttributesTable.js +12 -5
  16. package/cjs/components/crosswalks/AttributesTable/cell-renderers/AttributeValuesRenderer.d.ts +3 -7
  17. package/cjs/components/crosswalks/AttributesTable/cell-renderers/CommonRowCellRenderer.d.ts +12 -0
  18. package/cjs/components/crosswalks/AttributesTable/cell-renderers/CommonRowCellRenderer.js +41 -0
  19. package/cjs/components/crosswalks/AttributesTable/cell-renderers/OvValuesRenderer.d.ts +6 -7
  20. package/cjs/components/crosswalks/AttributesTable/cell-renderers/OvValuesRenderer.js +6 -3
  21. package/cjs/components/crosswalks/AttributesTable/cell-renderers/RowCellRenderer.d.ts +7 -10
  22. package/cjs/components/crosswalks/AttributesTable/cell-renderers/RowCellRenderer.js +3 -2
  23. package/cjs/components/crosswalks/AttributesTable/cell-renderers/RuleTypeRenderer.d.ts +2 -7
  24. package/cjs/components/crosswalks/AttributesTable/cell-renderers/WinnerSourcesRenderer.d.ts +2 -4
  25. package/cjs/components/crosswalks/AttributesTable/cell-renderers/styles.d.ts +1 -1
  26. package/cjs/components/crosswalks/AttributesTable/cell-renderers/styles.js +17 -1
  27. package/cjs/components/crosswalks/AttributesTable/helpers.d.ts +5 -10
  28. package/cjs/components/crosswalks/types/AttributesTableData.d.ts +50 -0
  29. package/cjs/components/crosswalks/types/AttributesTableData.js +2 -0
  30. package/cjs/components/crosswalks/types/index.d.ts +1 -0
  31. package/esm/components/BasicTableView/BasicTable/BasicTable.js +15 -4
  32. package/esm/components/BasicTableView/BasicTable/CellRenderer/CellRenderer.d.ts +3 -3
  33. package/esm/components/BasicTableView/BasicTable/CellRenderer/CellRenderer.js +4 -3
  34. package/esm/components/BasicTableView/BasicTable/helpers/dataHelpers.d.ts +1 -1
  35. package/esm/components/BasicTableView/BasicTable/helpers/dataHelpers.js +7 -5
  36. package/esm/components/BasicTableView/BasicTable/hooks/useBasicTableCellRenderer.d.ts +12 -16
  37. package/esm/components/BasicTableView/BasicTable/hooks/useBasicTableCellRenderer.js +9 -8
  38. package/esm/components/BasicTableView/BasicTable/hooks/useCollapsibleTableRows.d.ts +3 -2
  39. package/esm/components/BasicTableView/BasicTable/hooks/useCollapsibleTableRows.js +2 -2
  40. package/esm/components/BasicTableView/BasicTable/hooks/useDynamicRowCellHeight.d.ts +9 -2
  41. package/esm/components/BasicTableView/BasicTable/hooks/useDynamicRowCellHeight.js +3 -2
  42. package/esm/components/BasicTableView/RowCellAutoSizer/RowCellAutoSizer.d.ts +2 -1
  43. package/esm/components/BasicTableView/RowCellAutoSizer/RowCellAutoSizer.js +1 -1
  44. package/esm/components/BasicTableView/types/index.d.ts +10 -7
  45. package/esm/components/crosswalks/AttributesTable/AttributesTable.js +14 -7
  46. package/esm/components/crosswalks/AttributesTable/cell-renderers/AttributeValuesRenderer.d.ts +3 -7
  47. package/esm/components/crosswalks/AttributesTable/cell-renderers/CommonRowCellRenderer.d.ts +12 -0
  48. package/esm/components/crosswalks/AttributesTable/cell-renderers/CommonRowCellRenderer.js +34 -0
  49. package/esm/components/crosswalks/AttributesTable/cell-renderers/OvValuesRenderer.d.ts +6 -7
  50. package/esm/components/crosswalks/AttributesTable/cell-renderers/OvValuesRenderer.js +6 -3
  51. package/esm/components/crosswalks/AttributesTable/cell-renderers/RowCellRenderer.d.ts +7 -10
  52. package/esm/components/crosswalks/AttributesTable/cell-renderers/RowCellRenderer.js +3 -2
  53. package/esm/components/crosswalks/AttributesTable/cell-renderers/RuleTypeRenderer.d.ts +2 -7
  54. package/esm/components/crosswalks/AttributesTable/cell-renderers/WinnerSourcesRenderer.d.ts +2 -4
  55. package/esm/components/crosswalks/AttributesTable/cell-renderers/styles.d.ts +1 -1
  56. package/esm/components/crosswalks/AttributesTable/cell-renderers/styles.js +17 -1
  57. package/esm/components/crosswalks/AttributesTable/helpers.d.ts +5 -10
  58. package/esm/components/crosswalks/types/AttributesTableData.d.ts +50 -0
  59. package/esm/components/crosswalks/types/AttributesTableData.js +1 -0
  60. package/esm/components/crosswalks/types/index.d.ts +1 -0
  61. package/package.json +4 -4
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ import { AttributeType, AttributeValue, Crosswalk, SurvivorStrategy } from '@reltio/mdm-sdk';
3
+ import { ColumnData, RenderRowCellProps } from '../../BasicTableView/types';
4
+ import { CrosswalksMap } from '../../attributes/inline';
5
+ export type RuleTypeValues = {
6
+ ruleType: SurvivorStrategy;
7
+ primaryAttributeUri?: string;
8
+ comparisonAttributeUri?: string;
9
+ sourcesUriOrder?: string[];
10
+ };
11
+ export type OvValues = {
12
+ attributeType: AttributeType;
13
+ values: AttributeValue[];
14
+ };
15
+ export type AttributeValues = {
16
+ attributeType: AttributeType;
17
+ attributeValues: AttributeValue[];
18
+ crosswalksMap: CrosswalksMap;
19
+ };
20
+ export type WinnerSources = {
21
+ crosswalks: Crosswalk[];
22
+ };
23
+ export type AttributesTableRowValue = {
24
+ count: number;
25
+ ovValues: OvValues;
26
+ rawValue: AttributeValue[];
27
+ ruleType?: RuleTypeValues;
28
+ values?: AttributeValues;
29
+ winnerSources?: WinnerSources;
30
+ };
31
+ export type AttributesTableColumnData = ColumnData & {
32
+ id: keyof AttributesTableRowValue;
33
+ };
34
+ export type GetRowCellKeyProps = {
35
+ rowValue: AttributesTableRowValue;
36
+ columnData: AttributesTableColumnData;
37
+ cellIndex: number;
38
+ rowIndex: number;
39
+ };
40
+ type CellValueRendererProps = {
41
+ value: unknown;
42
+ rowValue: AttributesTableRowValue;
43
+ [key: string]: unknown;
44
+ };
45
+ export type RowCellRendererProps = RenderRowCellProps & {
46
+ CellValueRenderer: (props: CellValueRendererProps) => JSX.Element;
47
+ columnData: AttributesTableColumnData;
48
+ rowValue: AttributesTableRowValue;
49
+ };
50
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,3 +5,4 @@ export type { CrosswalksByTypes } from './CrosswalksByTypes';
5
5
  export type { AddCrosswalkEvent } from './AddCrosswalkEvent';
6
6
  export type { DeleteCrosswalkEvent } from './DeleteCrosswalkEvent';
7
7
  export type { EditCrosswalkEvent } from './EditCrosswalkEvent';
8
+ export type { AttributesTableColumnData, AttributesTableRowValue, RuleTypeValues, GetRowCellKeyProps, RowCellRendererProps, AttributeValues, OvValues, WinnerSources } from './AttributesTableData';
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React, { useMemo, forwardRef } from 'react';
23
+ import React, { useMemo, forwardRef, useCallback } from 'react';
24
24
  import PropTypes from 'prop-types';
25
25
  import Table from 'react-components/dist/Table/Table';
26
26
  import defaultGetRowCellHeight from './helpers/defaultGetRowCellHeight';
@@ -33,21 +33,32 @@ import { RowCollapseContext } from './contexts/RowCollapseContext';
33
33
  import { prop } from 'ramda';
34
34
  import useCollapsibleTableRows from './hooks/useCollapsibleTableRows';
35
35
  var BasicTable = forwardRef(function (_a, ref) {
36
- var columnsData = _a.columnsData, rowsData = _a.rowsData, context = _a.context, sorting = _a.sorting, onSort = _a.onSort, _b = _a.renderRowCell, renderRowCell = _b === void 0 ? defaultRenderRowCell : _b, _c = _a.getRowCellHeight, getRowCellHeight = _c === void 0 ? defaultGetRowCellHeight : _c, filters = _a.filters, onFilter = _a.onFilter, headRowHeight = _a.headRowHeight, _d = _a.maxRowValuesCount, maxRowValuesCount = _d === void 0 ? Infinity : _d, autosizing = _a.autosizing, maxHeight = _a.maxHeight, otherProps = __rest(_a, ["columnsData", "rowsData", "context", "sorting", "onSort", "renderRowCell", "getRowCellHeight", "filters", "onFilter", "headRowHeight", "maxRowValuesCount", "autosizing", "maxHeight"]);
36
+ var columnsData = _a.columnsData, rowsData = _a.rowsData, context = _a.context, sorting = _a.sorting, onSort = _a.onSort, _b = _a.renderRowCell, renderRowCell = _b === void 0 ? defaultRenderRowCell : _b, _c = _a.getRowCellHeight, getRowCellHeight = _c === void 0 ? defaultGetRowCellHeight : _c, filters = _a.filters, onFilter = _a.onFilter, headRowHeight = _a.headRowHeight, _d = _a.maxRowValuesCount, maxRowValuesCount = _d === void 0 ? Infinity : _d, autosizing = _a.autosizing, maxHeight = _a.maxHeight, getIdFromRowValue = _a.getIdFromRowValue, otherProps = __rest(_a, ["columnsData", "rowsData", "context", "sorting", "onSort", "renderRowCell", "getRowCellHeight", "filters", "onFilter", "headRowHeight", "maxRowValuesCount", "autosizing", "maxHeight", "getIdFromRowValue"]);
37
37
  var tableHeadData = useMemo(function () { return getTableHeadData(columnsData, filters, onFilter); }, [columnsData, filters, onFilter]);
38
38
  var _e = useCollapsibleTableRows({
39
39
  rowsData: rowsData,
40
40
  columnsData: columnsData,
41
41
  renderRowCell: renderRowCell,
42
42
  getRowCellHeight: getRowCellHeight,
43
- maxRowValuesCount: maxRowValuesCount
43
+ maxRowValuesCount: maxRowValuesCount,
44
+ getIdFromRowValue: getIdFromRowValue
44
45
  }), tableRowsData = _e.tableRowsData, collapseContextValue = _e.collapseContextValue;
46
+ var toggleRowCollapse = collapseContextValue.toggleRowCollapse, getIsRowCollapsed = collapseContextValue.getIsRowCollapsed;
47
+ var onStartDragRow = useCallback(function () {
48
+ setTimeout(function () {
49
+ tableRowsData.forEach(function (_, index) {
50
+ if (!getIsRowCollapsed(index)) {
51
+ toggleRowCollapse(index);
52
+ }
53
+ });
54
+ }, 0);
55
+ }, [getIsRowCollapsed, toggleRowCollapse, tableRowsData]);
45
56
  if (!tableHeadData.length) {
46
57
  return null;
47
58
  }
48
59
  return (React.createElement(RowCollapseContext.Provider, { value: collapseContextValue },
49
60
  React.createElement(TableContext.Provider, { value: context },
50
- React.createElement(Table, __assign({ autosizing: autosizing, maxHeight: maxHeight, defaultRowHeight: 48 }, otherProps, { fixHead: tableRowsData.length > 0, headData: tableHeadData, rowsData: tableRowsData, sortField: prop('field', sorting), sortOrder: prop('order', sorting), onSort: onSort, headRowHeight: filters ? headRowHeight + COLUMN_FILTER_HEIGHT : headRowHeight, ref: ref })))));
61
+ React.createElement(Table, __assign({ autosizing: autosizing, maxHeight: maxHeight, defaultRowHeight: 48, onStartDragRow: onStartDragRow }, otherProps, { fixHead: tableRowsData.length > 0, headData: tableHeadData, rowsData: tableRowsData, sortField: prop('field', sorting), sortOrder: prop('order', sorting), onSort: onSort, headRowHeight: filters ? headRowHeight + COLUMN_FILTER_HEIGHT : headRowHeight, ref: ref })))));
51
62
  });
52
63
  export var BasicTableType = {
53
64
  columnsData: PropTypes.arrayOf(ColumnDataType).isRequired,
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { CollapseContext, ColumnData, TableRowsData } from '../../types';
2
+ import { CollapseContext, ColumnData, RowId, TableRowsData } from '../../types';
3
3
  type Props = {
4
4
  columnId: string;
5
5
  rowIndex: number;
6
6
  collapseContextValue: CollapseContext;
7
- getRowHeight: (rowIndex: number) => number;
8
- getHeightForSubRow: (rowIndex: number, columnIndex: number, subRowIndex: number) => number;
7
+ getRowHeight: (rowId: RowId) => number;
8
+ getHeightForSubRow: (rowId: RowId, columnIndex: number, subRowIndex: number) => number;
9
9
  tableRowsData: TableRowsData;
10
10
  columnsData: ColumnData[];
11
11
  };
@@ -26,13 +26,14 @@ import { RowCollapseContext } from '../contexts/RowCollapseContext';
26
26
  import { getCellContentFromRowsData } from 'react-components/dist/Table/tableUtils';
27
27
  export var CellRenderer = function (_a) {
28
28
  var columnId = _a.columnId, rowIndex = _a.rowIndex, collapseContextValue = _a.collapseContextValue, getRowHeight = _a.getRowHeight, tableRowsData = _a.tableRowsData, columnsData = _a.columnsData, getHeightForSubRow = _a.getHeightForSubRow, otherProps = __rest(_a, ["columnId", "rowIndex", "collapseContextValue", "getRowHeight", "tableRowsData", "columnsData", "getHeightForSubRow"]);
29
+ var rowData = tableRowsData[rowIndex];
29
30
  return (React.createElement(RowCollapseContext.Provider, { value: collapseContextValue },
30
- React.createElement("div", __assign({}, otherProps, { style: { height: getRowHeight(rowIndex) } }), tableRowsData.length > 0 &&
31
+ React.createElement("div", __assign({}, otherProps, { style: { height: getRowHeight(rowData === null || rowData === void 0 ? void 0 : rowData.id) } }), tableRowsData.length > 0 &&
31
32
  getCellContentFromRowsData({
32
33
  columnIndex: columnsData.findIndex(propEq('id', columnId)),
33
34
  headData: columnsData,
34
- rowsData: tableRowsData,
35
- rowIndex: rowIndex,
35
+ rowData: rowData,
36
+ id: rowData.id,
36
37
  getHeightForSubRow: getHeightForSubRow
37
38
  }))));
38
39
  };
@@ -1,3 +1,3 @@
1
- export function getTableRowsData(rowValues: any, columnsData: any, renderRowCell: any, getRowCellHeight: any, getRowMaxValuesCount?: any): any;
1
+ export function getTableRowsData(rowValues: any, columnsData: any, renderRowCell: any, getRowCellHeight: any, getRowMaxValuesCount?: any, getIdFromRowValue?: (_: any, rowIndex: any) => any): any;
2
2
  export function getTableHeadData(columnsData: any, filters: any, onFilter: any): any;
3
3
  export function getMaxRowValuesCount(columnsData: any, rowValue: any): any;
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import DefaultCellValueRenderer from '../cell-value-renderers/DefaultCellValueRenderer';
13
13
  import withFilter from '../HOCs/withFilter';
14
14
  import { calcRowSpansForNestedKeys, flattenNestedColumnValues, getNestedKeyForNestedColumnCell, TOTAL_ROW_SPAN_KEY } from './nestedHelpers';
15
- import { add, always, assoc, chain, evolve, isEmpty, isNil, map, mapObjIndexed, max, objOf, pipe, pluck, prop, propEq, propOr, reduce, reject, slice, uniq, unless, values } from 'ramda';
15
+ import { add, always, assoc, chain, evolve, isEmpty, isNil, map, mapObjIndexed, max, pipe, pluck, prop, propEq, propOr, reduce, reject, slice, uniq, unless, values } from 'ramda';
16
16
  import { wrapInArrayIfNeeded } from '@reltio/mdm-sdk';
17
17
  import DefaultHeadCellRenderer from 'react-components/dist/Table/DefaultHeadCellRenderer/DefaultHeadCellRenderer';
18
18
  import withFilterAtBottom from '../HOCs/withFilterAtBottom';
@@ -75,11 +75,13 @@ var applyValuesCountConstraint = function (maxValuesCount) {
75
75
  values: slice(0, maxValuesCount)
76
76
  })))));
77
77
  };
78
- var getTableRowsData = function (rowValues, columnsData, renderRowCell, getRowCellHeight, getRowMaxValuesCount) {
78
+ var defaultGetIdFromRowValue = function (_, rowIndex) { return rowIndex; };
79
+ var getTableRowsData = function (rowValues, columnsData, renderRowCell, getRowCellHeight, getRowMaxValuesCount, getIdFromRowValue) {
79
80
  if (getRowMaxValuesCount === void 0) { getRowMaxValuesCount = always(Infinity); }
80
- return rowValues.map(pipe(function (rowValue, rowIndex) {
81
- return pipe(buildRowValues(rowValue), applyValuesCountConstraint(getRowMaxValuesCount(rowIndex)), calcRowSpans, calcHeights(columnsData, getRowCellHeight, rowIndex, rowValue), applyCellRenderer(columnsData, renderRowCell, rowIndex, rowValue))(columnsData);
82
- }, objOf('data')));
81
+ if (getIdFromRowValue === void 0) { getIdFromRowValue = defaultGetIdFromRowValue; }
82
+ return rowValues.map(function (rowValue, rowIndex) {
83
+ return pipe(buildRowValues(rowValue), applyValuesCountConstraint(getRowMaxValuesCount(rowIndex)), calcRowSpans, calcHeights(columnsData, getRowCellHeight, rowIndex, rowValue), applyCellRenderer(columnsData, renderRowCell, rowIndex, rowValue), function (val) { return ({ data: val, id: getIdFromRowValue(rowValue, rowIndex) }); })(columnsData);
84
+ });
83
85
  };
84
86
  var getTableHeadData = function (columnsData, filters, onFilter) {
85
87
  return columnsData.map(function (_a) {
@@ -1,26 +1,22 @@
1
- declare const useBasicTableCellRenderer: ({ rowsData, columnsData, renderRowCell, getRowCellHeight, defaultRowHeight, maxRowValuesCount }: {
2
- rowsData: any;
3
- columnsData: any;
4
- renderRowCell?: ({ cell, CellValueRenderer, ...otherProps }: {
5
- [x: string]: any;
6
- cell: any;
7
- CellValueRenderer: any;
8
- }) => any;
9
- getRowCellHeight?: ({ columnData, cell }: {
10
- columnData: any;
11
- cell: any;
12
- }) => number;
1
+ import { ElementsRowsData, ColumnData, RowValue, RenderRowCell, GetRowCellHeight, RowId } from '../../types';
2
+ type Props = {
3
+ rowsData: ElementsRowsData;
4
+ columnsData: ColumnData[];
5
+ getIdFromRowValue?: (rowValue: RowValue, index?: number) => RowId;
6
+ renderRowCell?: RenderRowCell;
7
+ getRowCellHeight?: GetRowCellHeight;
13
8
  defaultRowHeight?: number;
14
9
  maxRowValuesCount?: number;
15
- }) => {
16
- getRowHeight: (rowIndex: number) => number;
10
+ };
11
+ declare const useBasicTableCellRenderer: ({ rowsData, columnsData, getIdFromRowValue, renderRowCell, getRowCellHeight, defaultRowHeight, maxRowValuesCount }: Props) => {
12
+ getRowHeight: (rowId: RowId) => number;
17
13
  collapseContextValue: {
18
14
  maxRowValuesCount: number;
19
15
  toggleRowCollapse: (rowIndex: number) => void;
20
16
  getIsRowCollapsible: (rowValue: Record<string, unknown>) => boolean;
21
17
  getIsRowCollapsed: (rowIndex: number) => boolean;
22
18
  };
23
- getHeightForSubRow: (rowIndex: any, columnIndex: any, subRowIndex: any) => any;
24
- tableRowsData: import("../..").TableRowsData;
19
+ getHeightForSubRow: (rowId: RowId, columnIndex: number, subRowIndex: number) => any;
20
+ tableRowsData: import("../../types").TableRowsData;
25
21
  };
26
22
  export default useBasicTableCellRenderer;
@@ -5,25 +5,26 @@ import defaultGetRowCellHeight from '../helpers/defaultGetRowCellHeight';
5
5
  import { pathOr } from 'ramda';
6
6
  import useCollapsibleTableRows from './useCollapsibleTableRows';
7
7
  var useBasicTableCellRenderer = function (_a) {
8
- var rowsData = _a.rowsData, columnsData = _a.columnsData, _b = _a.renderRowCell, renderRowCell = _b === void 0 ? defaultRenderRowCell : _b, _c = _a.getRowCellHeight, getRowCellHeight = _c === void 0 ? defaultGetRowCellHeight : _c, _d = _a.defaultRowHeight, defaultRowHeight = _d === void 0 ? 48 : _d, _e = _a.maxRowValuesCount, maxRowValuesCount = _e === void 0 ? Infinity : _e;
8
+ var rowsData = _a.rowsData, columnsData = _a.columnsData, getIdFromRowValue = _a.getIdFromRowValue, _b = _a.renderRowCell, renderRowCell = _b === void 0 ? defaultRenderRowCell : _b, _c = _a.getRowCellHeight, getRowCellHeight = _c === void 0 ? defaultGetRowCellHeight : _c, _d = _a.defaultRowHeight, defaultRowHeight = _d === void 0 ? 48 : _d, _e = _a.maxRowValuesCount, maxRowValuesCount = _e === void 0 ? Infinity : _e;
9
9
  var _f = useCollapsibleTableRows({
10
10
  rowsData: rowsData,
11
11
  columnsData: columnsData,
12
12
  renderRowCell: renderRowCell,
13
13
  getRowCellHeight: getRowCellHeight,
14
- maxRowValuesCount: maxRowValuesCount
14
+ maxRowValuesCount: maxRowValuesCount,
15
+ getIdFromRowValue: getIdFromRowValue
15
16
  }), tableRowsData = _f.tableRowsData, collapseContextValue = _f.collapseContextValue;
16
17
  return useMemo(function () {
17
- var rowHeightCache = tableRowsData.reduce(function (cache, rowData, rowIndex) {
18
- var data = rowData.data;
19
- cache[rowIndex] = calculateRowHeight(data, defaultRowHeight);
18
+ var rowHeightCache = tableRowsData.reduce(function (cache, rowData) {
19
+ var data = rowData.data, id = rowData.id;
20
+ cache[id] = calculateRowHeight(data, defaultRowHeight);
20
21
  return cache;
21
22
  }, {});
22
- var getHeightForSubRow = function (rowIndex, columnIndex, subRowIndex) {
23
- var heightPath = [rowIndex, 'subRowHeight', columnIndex, subRowIndex, 'height'];
23
+ var getHeightForSubRow = function (rowId, columnIndex, subRowIndex) {
24
+ var heightPath = [rowId, 'subRowHeight', columnIndex, subRowIndex, 'height'];
24
25
  return pathOr(0, heightPath, rowHeightCache);
25
26
  };
26
- var getRowHeight = function (rowIndex) { return pathOr(0, [rowIndex, 'height'], rowHeightCache); };
27
+ var getRowHeight = function (rowId) { return pathOr(0, [rowId, 'height'], rowHeightCache); };
27
28
  return { getRowHeight: getRowHeight, collapseContextValue: collapseContextValue, getHeightForSubRow: getHeightForSubRow, tableRowsData: tableRowsData };
28
29
  }, [tableRowsData, defaultRowHeight, collapseContextValue]);
29
30
  };
@@ -1,12 +1,13 @@
1
- import { ColumnData, ElementsRowsData, GetRowCellHeight, RenderRowCell, TableRowsData } from '../../types';
1
+ import { ColumnData, ElementsRowsData, GetRowCellHeight, RenderRowCell, RowValue, TableRowsData, RowId } from '../../types';
2
2
  type Props = {
3
3
  rowsData: ElementsRowsData;
4
4
  columnsData: ColumnData[];
5
5
  renderRowCell: RenderRowCell;
6
6
  getRowCellHeight: GetRowCellHeight;
7
7
  maxRowValuesCount: number;
8
+ getIdFromRowValue?: (rowValue: RowValue, rowIndex: number) => RowId;
8
9
  };
9
- declare const useCollapsibleTableRows: ({ rowsData, columnsData, renderRowCell, getRowCellHeight, maxRowValuesCount }: Props) => {
10
+ declare const useCollapsibleTableRows: ({ rowsData, columnsData, renderRowCell, getRowCellHeight, maxRowValuesCount, getIdFromRowValue }: Props) => {
10
11
  tableRowsData: TableRowsData;
11
12
  collapseContextValue: {
12
13
  maxRowValuesCount: number;
@@ -3,12 +3,12 @@ import { equals, filter, remove } from 'ramda';
3
3
  import { getTableRowsData, getMaxRowValuesCount } from '../helpers/dataHelpers';
4
4
  import { useDidUpdateEffect, usePrevious } from '../../../../hooks';
5
5
  var useCollapsibleTableRows = function (_a) {
6
- var rowsData = _a.rowsData, columnsData = _a.columnsData, renderRowCell = _a.renderRowCell, getRowCellHeight = _a.getRowCellHeight, maxRowValuesCount = _a.maxRowValuesCount;
6
+ var rowsData = _a.rowsData, columnsData = _a.columnsData, renderRowCell = _a.renderRowCell, getRowCellHeight = _a.getRowCellHeight, maxRowValuesCount = _a.maxRowValuesCount, getIdFromRowValue = _a.getIdFromRowValue;
7
7
  var _b = useState([]), expandedIndexes = _b[0], setExpandedIndexes = _b[1];
8
8
  var getRowMaxValuesCount = useCallback(function (rowIndex) {
9
9
  return expandedIndexes.includes(rowIndex) ? Infinity : maxRowValuesCount;
10
10
  }, [expandedIndexes, maxRowValuesCount]);
11
- var tableRowsData = useMemo(function () { return getTableRowsData(rowsData, columnsData, renderRowCell, getRowCellHeight, getRowMaxValuesCount); }, [rowsData, columnsData, renderRowCell, getRowCellHeight, getRowMaxValuesCount]);
11
+ var tableRowsData = useMemo(function () { return getTableRowsData(rowsData, columnsData, renderRowCell, getRowCellHeight, getRowMaxValuesCount, getIdFromRowValue); }, [rowsData, columnsData, renderRowCell, getRowCellHeight, getRowMaxValuesCount, getIdFromRowValue]);
12
12
  var toggleRowCollapse = useCallback(function (rowIndex) {
13
13
  setExpandedIndexes(function (expandedIndexes) {
14
14
  var index = expandedIndexes.findIndex(equals(rowIndex));
@@ -1,6 +1,13 @@
1
- export default useDynamicRowCellHeight;
2
- declare function useDynamicRowCellHeight(): {
1
+ import { ColumnData, RowValue } from '../../types';
2
+ type GetRowCellKeyProps = {
3
+ rowIndex: number;
4
+ cellIndex: number;
5
+ columnData: ColumnData;
6
+ rowValue: RowValue;
7
+ };
8
+ declare const useDynamicRowCellHeight: (getRowCellKey?: ({ rowIndex, columnData: { id }, cellIndex }: GetRowCellKeyProps) => string) => {
3
9
  getDynamicRowCellHeight: any;
4
10
  changeRowCellHeight: any;
5
11
  clearHeightsCache: () => void;
6
12
  };
13
+ export default useDynamicRowCellHeight;
@@ -12,11 +12,12 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { useCallback, useRef, useState } from 'react';
13
13
  import { __, curry, identity, pipe, prop, useWith, equals } from 'ramda';
14
14
  import { debounce } from '@reltio/mdm-sdk';
15
- var getRowCellKey = function (_a) {
15
+ var defaultGetRowCellKey = function (_a) {
16
16
  var rowIndex = _a.rowIndex, id = _a.columnData.id, cellIndex = _a.cellIndex;
17
17
  return "".concat(id, "[").concat(rowIndex, "][").concat(cellIndex, "]");
18
18
  };
19
- var useDynamicRowCellHeight = function () {
19
+ var useDynamicRowCellHeight = function (getRowCellKey) {
20
+ if (getRowCellKey === void 0) { getRowCellKey = defaultGetRowCellKey; }
20
21
  var _a = useState({}), rowCellHeightsMap = _a[0], setRowCellHeightsMap = _a[1];
21
22
  var rowCellHeightsMapCache = useRef({});
22
23
  var batchHeightUpdate = function (key, value) {
@@ -1,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
- import { ColumnData, RenderRowCellProps } from '../types';
2
+ import { ColumnData, RenderRowCellProps, RowValue } from '../types';
3
3
  type OnChangeHeightProps = {
4
4
  rowIndex: number;
5
5
  cellIndex: number;
6
6
  columnData: ColumnData;
7
+ rowValue: RowValue;
7
8
  };
8
9
  type Props = {
9
10
  onChangeHeight: (props: OnChangeHeightProps) => (size: number) => void;
@@ -16,7 +16,7 @@ var RowCellAutoSizer = function (_a) {
16
16
  var onChangeHeight = _a.onChangeHeight, cell = _a.children, cellProps = __rest(_a, ["onChangeHeight", "children"]);
17
17
  var cellRef = useRef();
18
18
  var rowValue = cellProps.rowValue, rowIndex = cellProps.rowIndex, columnData = cellProps.columnData, cellIndex = cellProps.cellIndex;
19
- var changeCellHeight = onChangeHeight({ rowIndex: rowIndex, cellIndex: cellIndex, columnData: columnData });
19
+ var changeCellHeight = onChangeHeight({ rowIndex: rowIndex, cellIndex: cellIndex, columnData: columnData, rowValue: rowValue });
20
20
  var adjustCellHeight = function () { return cellRef.current && changeCellHeight(cellRef.current.clientHeight); };
21
21
  useDidUpdateEffect(adjustCellHeight, [rowValue.rawValue]);
22
22
  return (React.createElement("div", { ref: cellRef },
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { DataTypeDefinition } from '@reltio/mdm-sdk';
3
3
  import useCollapsibleTableRows from '../BasicTable/hooks/useCollapsibleTableRows';
4
4
  export type Sorting = {
@@ -33,6 +33,7 @@ export type ColumnData = {
33
33
  [key: string]: unknown;
34
34
  };
35
35
  export type CollapseContext = ReturnType<typeof useCollapsibleTableRows>['collapseContextValue'];
36
+ export type RowId = string | number;
36
37
  export type RowValue = {
37
38
  rawValue: unknown;
38
39
  [key: string]: unknown;
@@ -46,18 +47,20 @@ export type TableRowsData = Array<{
46
47
  rowSpan?: number;
47
48
  values: React.ReactNode;
48
49
  }[]>;
50
+ id?: RowId;
49
51
  }>;
52
+ type RowCell = {
53
+ values: unknown[];
54
+ rowSpan: number;
55
+ height: number;
56
+ };
50
57
  type GetRowCellHeightArg = {
51
58
  columnIndex: number;
52
59
  columnData: ColumnData;
53
60
  rowIndex: number;
54
61
  rowValue: RowValue;
55
62
  cellIndex: number;
56
- cell: {
57
- values: unknown[];
58
- rowSpan: number;
59
- height: number;
60
- };
63
+ cell: RowCell;
61
64
  };
62
65
  export type GetRowCellHeight = ({ columnIndex, columnData, rowIndex, rowValue, cellIndex, cell }: GetRowCellHeightArg) => number;
63
66
  export type RenderRowCellProps = {
@@ -66,7 +69,7 @@ export type RenderRowCellProps = {
66
69
  rowIndex: number;
67
70
  rowValue: RowValue;
68
71
  cellIndex: number;
69
- cell: ReactNode;
72
+ cell: RowCell;
70
73
  CellValueRenderer: (props: unknown) => JSX.Element;
71
74
  };
72
75
  export type RenderRowCell = ({ columnIndex, columnData, rowIndex, rowValue, cellIndex, cell, CellValueRenderer }: RenderRowCellProps) => JSX.Element;
@@ -15,17 +15,22 @@ import classnames from 'classnames';
15
15
  import i18n from 'ui-i18n';
16
16
  import mdmModule from '@reltio/mdm-module';
17
17
  import { findAttributeTypeByUri, isReadableAttribute, makeAttrTypeUri } from '@reltio/mdm-sdk';
18
- import { BasicTable, ColumnsSettings, RowCellAutoSizer, useDynamicRowCellHeight } from '../../BasicTableView';
18
+ import { BasicTable, ColumnsSettings, useDynamicRowCellHeight } from '../../BasicTableView';
19
19
  import BasicViewHeader from '../../BasicViewHeader/BasicViewHeader';
20
+ import { CommonRowCellRenderer } from './cell-renderers/CommonRowCellRenderer';
20
21
  import { COLUMNS_DATA, DEFAULT_VISIBLE_COLUMNS, getBasicTableColumnsData, getBasicTableRowsData } from './helpers';
21
- import { always, either, filter, isNil, keys, map, pipe, without, identity, both } from 'ramda';
22
- import RowCellRenderer from './cell-renderers/RowCellRenderer';
22
+ import { always, either, filter, isNil, keys, map, pipe, without, identity, both, move } from 'ramda';
23
23
  import LinearLoadIndicator from '../../LinearLoadIndicator/LinearLoadIndicator';
24
24
  import ConfirmDeleteDialog from '../../ConfirmDeleteDialog/ConfirmDeleteDialog';
25
25
  import ConfirmEditIgnoredDialog from './ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog';
26
26
  import { noop } from '../../../core';
27
27
  import { useStyles } from './styles';
28
28
  var DEFAULT_ROW_HEIGHT = 68;
29
+ var getIdFromRowValue = function (rowValue) { return rowValue.ovValues.attributeType.uri; };
30
+ var getRowCellKey = function (_a) {
31
+ var id = _a.columnData.id, cellIndex = _a.cellIndex, rowValue = _a.rowValue;
32
+ return "".concat(id, "[").concat(getIdFromRowValue(rowValue), "][").concat(cellIndex, "]");
33
+ };
29
34
  var AttributesTable = function (_a) {
30
35
  var entity = _a.entity, isLoading = _a.isLoading, crosswalksMap = _a.crosswalksMap, _b = _a.visibleColumns, visibleColumns = _b === void 0 ? DEFAULT_VISIBLE_COLUMNS : _b, onChangeVisibleColumns = _a.onChangeVisibleColumns, readOnly = _a.readOnly, _c = _a.onDelete, onDelete = _c === void 0 ? noop : _c, _d = _a.onPin, onPin = _d === void 0 ? noop : _d, _e = _a.onIgnore, onIgnore = _e === void 0 ? noop : _e, _f = _a.onEdit, onEdit = _f === void 0 ? noop : _f, _g = _a.onAdd, onAdd = _g === void 0 ? noop : _g, selectedAttributeTypes = _a.selectedAttributeTypes, _h = _a.onSelectAttributeTypes, onSelectAttributeTypes = _h === void 0 ? noop : _h, additionalHeaderItems = _a.additionalHeaderItems, className = _a.className, activeSurvivorshipGroupUri = _a.activeSurvivorshipGroupUri;
31
36
  var styles = useStyles();
@@ -56,9 +61,8 @@ var AttributesTable = function (_a) {
56
61
  crosswalksMap,
57
62
  activeSurvivorshipGroupUri
58
63
  ]);
59
- var _l = useDynamicRowCellHeight(), getDynamicRowCellHeight = _l.getDynamicRowCellHeight, changeRowCellHeight = _l.changeRowCellHeight;
60
- var renderRowCell = useCallback(function (props) { return (React.createElement(RowCellAutoSizer, __assign({ onChangeHeight: changeRowCellHeight }, props),
61
- React.createElement(RowCellRenderer, __assign({}, props)))); }, [changeRowCellHeight]);
64
+ var _l = useDynamicRowCellHeight(getRowCellKey), getDynamicRowCellHeight = _l.getDynamicRowCellHeight, changeRowCellHeight = _l.changeRowCellHeight;
65
+ var renderRowCell = useCallback(function (props) { return React.createElement(CommonRowCellRenderer, __assign({ changeRowCellHeight: changeRowCellHeight }, props)); }, [changeRowCellHeight]);
62
66
  var getRowCellHeight = useCallback(either(getDynamicRowCellHeight, always(DEFAULT_ROW_HEIGHT)), [
63
67
  getDynamicRowCellHeight
64
68
  ]);
@@ -67,6 +71,9 @@ var AttributesTable = function (_a) {
67
71
  var handleEdit = useCallback(function (event) {
68
72
  event.attributeValue.ignored ? setPendingIgnoredEditing(event) : onEdit(event);
69
73
  }, [onEdit, setPendingIgnoredEditing]);
74
+ var handleReorderAttributeTypes = useCallback(function (oldPosition, newPosition) {
75
+ onSelectAttributeTypes(move(oldPosition, newPosition, selectedAttributeTypes));
76
+ }, [onSelectAttributeTypes, selectedAttributeTypes]);
70
77
  var tableContext = useMemo(function () { return ({
71
78
  onDelete: setPendingDeletion,
72
79
  onPin: onPin,
@@ -96,7 +103,7 @@ var AttributesTable = function (_a) {
96
103
  React.createElement(ColumnsSettings, { columnsData: COLUMNS_DATA, selectedColumns: visibleColumns, onChangeColumns: onChangeVisibleColumns })),
97
104
  React.createElement("div", { className: styles.tableContent },
98
105
  isLoading && React.createElement(LinearLoadIndicator, null),
99
- React.createElement(BasicTable, { fixFirstColumn: true, headRowHeight: 48, defaultColumnWidth: 250, defaultColumnMinWidth: 200, columnsData: visibleColumnsData, rowsData: rowsData, renderRowCell: renderRowCell, getRowCellHeight: getRowCellHeight, context: tableContext })),
106
+ React.createElement(BasicTable, { fixFirstColumn: true, headRowHeight: 48, defaultColumnWidth: 250, defaultColumnMinWidth: 200, columnsData: visibleColumnsData, dndRowReorderingEnabled: true, dndRowReorderingHandler: handleReorderAttributeTypes, getIdFromRowValue: getIdFromRowValue, rowsData: rowsData, renderRowCell: renderRowCell, getRowCellHeight: getRowCellHeight, context: tableContext })),
100
107
  React.createElement(ConfirmDeleteDialog, { open: !!pendingDeletion, onClose: function () { return setPendingDeletion(null); }, onConfirm: function () { return onDelete(pendingDeletion); } }),
101
108
  React.createElement(ConfirmEditIgnoredDialog, { open: !!pendingIgnoredEditing, onClose: function () { return setPendingIgnoredEditing(null); }, onConfirmEditWithIgnore: function () { return onEdit(pendingIgnoredEditing); }, onConfirmEditWithoutIgnore: function () {
102
109
  onIgnore({ attributeValue: pendingIgnoredEditing.attributeValue });
@@ -1,12 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { AttributeType, AttributeValue } from '@reltio/mdm-sdk';
3
- import { AddInlineAttributeEvent, CrosswalksMap, DeleteInlineAttributeEvent, EditInlineAttributeEvent, IgnoreInlineAttributeEvent, PinInlineAttributeEvent } from '../../../attributes/inline';
2
+ import { AddInlineAttributeEvent, DeleteInlineAttributeEvent, EditInlineAttributeEvent, IgnoreInlineAttributeEvent, PinInlineAttributeEvent } from '../../../attributes/inline';
3
+ import { AttributeValues } from '../../types';
4
4
  type Props = {
5
- value: {
6
- attributeValues?: AttributeValue[];
7
- attributeType: AttributeType;
8
- crosswalksMap: CrosswalksMap;
9
- };
5
+ value: AttributeValues;
10
6
  onDelete: (event: DeleteInlineAttributeEvent) => void;
11
7
  onEdit: (event: EditInlineAttributeEvent) => void;
12
8
  onPin: (event: PinInlineAttributeEvent) => void;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { RowCellAutoSizer } from '../../../BasicTableView';
3
+ import { RowCellRendererProps } from '../../types';
4
+ type RowCellAutoSizerProps = React.ComponentProps<typeof RowCellAutoSizer>;
5
+ type Props = {
6
+ changeRowCellHeight: RowCellAutoSizerProps['onChangeHeight'];
7
+ someRowIsDragging?: boolean;
8
+ dragRef?: boolean;
9
+ isDragLayer?: boolean;
10
+ } & RowCellRendererProps;
11
+ export declare const CommonRowCellRenderer: ({ changeRowCellHeight, ...otherProps }: Props) => JSX.Element;
12
+ export {};
@@ -0,0 +1,34 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import RowCellRenderer from './RowCellRenderer';
25
+ // eslint-disable-next-line import/named
26
+ import { RowCellAutoSizer } from '../../../BasicTableView';
27
+ export var CommonRowCellRenderer = function (_a) {
28
+ var changeRowCellHeight = _a.changeRowCellHeight, otherProps = __rest(_a, ["changeRowCellHeight"]);
29
+ if (otherProps.isDragLayer) {
30
+ return React.createElement(RowCellRenderer, __assign({}, otherProps, { someRowIsDragging: false }));
31
+ }
32
+ return (React.createElement(RowCellAutoSizer, __assign({ onChangeHeight: changeRowCellHeight }, otherProps),
33
+ React.createElement(RowCellRenderer, __assign({}, otherProps))));
34
+ };
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
- import { AttributeType, AttributeValue } from '@reltio/mdm-sdk';
1
+ import React from 'react';
2
+ import { OvValues } from '../../types';
3
3
  type Props = {
4
- value: {
5
- values?: AttributeValue[];
6
- attributeType: AttributeType;
7
- };
4
+ value: OvValues;
5
+ someRowIsDragging?: boolean;
6
+ dragRef?: React.Ref<HTMLDivElement>;
8
7
  };
9
- declare const OvValuesRenderer: ({ value: { values, attributeType } }: Props) => JSX.Element;
8
+ declare const OvValuesRenderer: ({ value: { values, attributeType }, someRowIsDragging, dragRef }: Props) => JSX.Element;
10
9
  export default OvValuesRenderer;
@@ -1,12 +1,15 @@
1
1
  import React from 'react';
2
- import AttributeTitle from '../../../Title/Title';
2
+ import DragIndicatorIcon from '@material-ui/icons/DragIndicator';
3
3
  import ReadOnlyAttributeValuesBlock from '../../../attributes/readMode/AttributeValuesBlock/AttributeValuesBlock';
4
+ import AttributeTitle from '../../../Title/Title';
4
5
  import { useStyles } from './styles';
5
6
  var OvValuesRenderer = function (_a) {
6
- var _b = _a.value, values = _b.values, attributeType = _b.attributeType;
7
+ var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging, dragRef = _a.dragRef;
7
8
  var styles = useStyles();
8
9
  return (React.createElement("div", { className: styles.cellValueWrapper },
10
+ React.createElement("div", { ref: dragRef, className: styles.dragIndicator },
11
+ React.createElement(DragIndicatorIcon, { className: styles.dragIndicatorIcon })),
9
12
  React.createElement(AttributeTitle, { className: styles.attributeTitle, label: attributeType.label }),
10
- React.createElement(ReadOnlyAttributeValuesBlock, { values: values, attributeType: attributeType, valueContainerClassName: styles.ovValue })));
13
+ !someRowIsDragging && (React.createElement(ReadOnlyAttributeValuesBlock, { values: values, attributeType: attributeType, valueContainerClassName: styles.ovValue }))));
11
14
  };
12
15
  export default OvValuesRenderer;
@@ -1,12 +1,9 @@
1
- import React from 'react';
2
- import { ColumnData } from '../../../BasicTableView';
1
+ /// <reference types="react" />
2
+ import { RowCellRendererProps } from '../../types';
3
3
  type Props = {
4
- cell: {
5
- values: unknown[];
6
- };
7
- columnData: ColumnData;
8
- CellValueRenderer: React.ElementType;
9
- columnIndex: number;
10
- };
11
- declare const RowCellRenderer: ({ cell, CellValueRenderer, columnIndex, columnData, ...otherProps }: Props) => JSX.Element;
4
+ someRowIsDragging?: boolean;
5
+ dragRef?: boolean;
6
+ isDragLayer?: boolean;
7
+ } & RowCellRendererProps;
8
+ declare const RowCellRenderer: ({ cell, CellValueRenderer, columnIndex, columnData, someRowIsDragging, ...otherProps }: Props) => JSX.Element;
12
9
  export default RowCellRenderer;
@@ -24,9 +24,10 @@ import React from 'react';
24
24
  import classnames from 'classnames';
25
25
  import { useStyles } from './styles';
26
26
  var RowCellRenderer = function (_a) {
27
- var cell = _a.cell, CellValueRenderer = _a.CellValueRenderer, columnIndex = _a.columnIndex, columnData = _a.columnData, otherProps = __rest(_a, ["cell", "CellValueRenderer", "columnIndex", "columnData"]);
27
+ var cell = _a.cell, CellValueRenderer = _a.CellValueRenderer, columnIndex = _a.columnIndex, columnData = _a.columnData, someRowIsDragging = _a.someRowIsDragging, otherProps = __rest(_a, ["cell", "CellValueRenderer", "columnIndex", "columnData", "someRowIsDragging"]);
28
28
  var styles = useStyles();
29
29
  var isFirstColumn = columnIndex === 0;
30
- return (React.createElement("div", { className: classnames(styles.rowCell, isFirstColumn && styles.coloredCell), "data-reltio-id": "column-name-".concat(columnData.id) }, cell.values.map(function (value, index) { return (React.createElement(CellValueRenderer, __assign({ key: index, value: value }, otherProps))); })));
30
+ var shouldRenderCell = !someRowIsDragging || isFirstColumn;
31
+ return (React.createElement("div", { className: classnames(styles.rowCell, isFirstColumn && styles.coloredCell), "data-reltio-id": "column-name-".concat(columnData.id) }, shouldRenderCell && (React.createElement(React.Fragment, null, cell.values.map(function (value, index) { return (React.createElement(CellValueRenderer, __assign({ key: index, value: value, someRowIsDragging: someRowIsDragging }, otherProps))); })))));
31
32
  };
32
33
  export default RowCellRenderer;
@@ -1,12 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { SurvivorStrategy } from '@reltio/mdm-sdk';
2
+ import { RuleTypeValues } from '../../types';
3
3
  type Props = {
4
- value: {
5
- ruleType: SurvivorStrategy;
6
- sourcesUriOrder?: string[];
7
- primaryAttributeUri?: string;
8
- comparisonAttributeUri?: string;
9
- };
4
+ value: RuleTypeValues;
10
5
  };
11
6
  declare const RuleTypeRenderer: ({ value: { ruleType, sourcesUriOrder, primaryAttributeUri, comparisonAttributeUri } }: Props) => JSX.Element;
12
7
  export default RuleTypeRenderer;