@reltio/components 1.4.1852 → 1.4.1854
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
- package/cjs/ConnectionEditor/ConnectionEditor.d.ts +3 -3
- package/cjs/ConnectionEditor/ConnectionEditor.test.js +2 -2
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -20
- package/cjs/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
- package/cjs/DependentLookupEditor/DependentLookupEditor.js +3 -21
- package/cjs/DropDownEditor/DropDownEditor.d.ts +14 -15
- package/cjs/DropDownEditor/DropDownEditor.js +0 -6
- package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +0 -20
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
- package/cjs/EditModeAttributesPager/types.d.ts +7 -6
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.js +6 -17
- package/cjs/EditModeComplexAttribute/index.d.ts +1 -0
- package/cjs/EntitySelector/EntitySelector.d.ts +19 -31
- package/cjs/EntitySelector/EntitySelector.js +0 -14
- package/cjs/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
- package/cjs/EntitySelector/components/EntityOption/EntityOption.js +0 -18
- package/cjs/ErrorWrapper/ErrorWrapper.d.ts +2 -2
- package/cjs/FilterEditor/FilterEditor.d.ts +16 -23
- package/cjs/FilterEditor/FilterEditor.js +2 -14
- package/cjs/FilterValueEditor/FilterValueEditor.d.ts +14 -24
- package/cjs/FilterValueEditor/FilterValueEditor.js +0 -9
- package/cjs/HOCs/withFilter/ColumnFilter.js +1 -1
- package/cjs/LookupEditor/LookupEditor.d.ts +11 -33
- package/cjs/LookupEditor/LookupEditor.js +1 -14
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
- package/cjs/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
- package/cjs/NestedAttribute/NestedAttribute.d.ts +4 -124
- package/cjs/NestedAttribute/NestedAttribute.js +0 -1
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.js +0 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +0 -12
- package/cjs/ReadOnlyComplexAttribute/index.d.ts +1 -0
- package/cjs/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
- package/cjs/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.js +2 -3
- package/cjs/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
- package/cjs/RelationTypeSelector/RelationTypeSelector.js +2 -14
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.js +0 -17
- package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
- package/cjs/components/ImageDetailsView/helpers/index.d.ts +5 -2
- package/cjs/components/ImportButton/ImportButton.d.ts +2 -1
- package/cjs/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
- package/cjs/components/MultipliableSelect/MultipliableSelect.js +0 -15
- package/cjs/components/ProfileBand/styles.d.ts +1 -1
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
- package/cjs/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
- package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
- package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
- package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
- package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -51
- package/cjs/components/ReactSelect/AsyncSelect.d.ts +0 -45
- package/cjs/components/ReactSelect/CreatableSelect.d.ts +0 -45
- package/cjs/components/ReactSelect/Select.d.ts +0 -45
- package/cjs/components/ReactSelect/withMuiSkin.d.ts +3 -48
- package/cjs/components/ReactSelect/withMuiSkin.js +0 -50
- package/cjs/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
- package/cjs/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
- package/cjs/components/SearchInput/SearchInput.d.ts +1 -1
- package/cjs/components/SelectionPopup/SelectionPopup.d.ts +1 -1
- package/cjs/constants/index.d.ts +1 -1
- package/cjs/constants/index.js +1 -4
- package/cjs/constants/prop-types.d.ts +0 -81
- package/cjs/constants/prop-types.js +17 -46
- package/cjs/constants/textField.d.ts +2 -2
- package/cjs/contexts/ScrollToElementContext/index.d.ts +1 -1
- package/cjs/features/graph/DataModelGraph/DataModelGraph.d.ts +6 -5
- package/cjs/features/graph/DataModelGraph/DataModelGraph.js +4 -3
- package/cjs/features/graph/DataModelGraph/DataModelGraph.test.js +3 -8
- package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.d.ts → DataModelCircleLayout.d.ts} +2 -2
- package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.js → DataModelCircleLayout.js} +5 -7
- package/cjs/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +4 -2
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +6 -5
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +43 -13
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +39 -17
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +4 -3
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +3 -3
- package/cjs/features/graph/index.d.ts +1 -1
- package/cjs/features/graph/rendering/canvas/label.js +1 -1
- package/cjs/features/graph/types/graphDataTypes.d.ts +2 -1
- package/cjs/helpers/basicTable.d.ts +2 -7
- package/cjs/hooks/useRelationTypeSelector.d.ts +12 -8
- package/cjs/hooks/useRelationTypeSelector.js +3 -1
- package/cjs/types/index.d.ts +19 -2
- package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
- package/esm/ConnectionEditor/ConnectionEditor.d.ts +3 -3
- package/esm/ConnectionEditor/ConnectionEditor.test.js +2 -2
- package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
- package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -17
- package/esm/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
- package/esm/DependentLookupEditor/DependentLookupEditor.js +4 -22
- package/esm/DropDownEditor/DropDownEditor.d.ts +14 -15
- package/esm/DropDownEditor/DropDownEditor.js +0 -6
- package/esm/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
- package/esm/EditModeAttributesList/EditModeAttributesList.js +1 -21
- package/esm/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
- package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
- package/esm/EditModeAttributesPager/types.d.ts +7 -6
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.js +7 -18
- package/esm/EditModeComplexAttribute/index.d.ts +1 -0
- package/esm/EntitySelector/EntitySelector.d.ts +19 -31
- package/esm/EntitySelector/EntitySelector.js +1 -15
- package/esm/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
- package/esm/EntitySelector/components/EntityOption/EntityOption.js +0 -18
- package/esm/ErrorWrapper/ErrorWrapper.d.ts +2 -2
- package/esm/FilterEditor/FilterEditor.d.ts +16 -23
- package/esm/FilterEditor/FilterEditor.js +3 -15
- package/esm/FilterValueEditor/FilterValueEditor.d.ts +14 -24
- package/esm/FilterValueEditor/FilterValueEditor.js +1 -10
- package/esm/HOCs/withFilter/ColumnFilter.js +1 -1
- package/esm/LookupEditor/LookupEditor.d.ts +11 -33
- package/esm/LookupEditor/LookupEditor.js +1 -11
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
- package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
- package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
- package/esm/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
- package/esm/NestedAttribute/NestedAttribute.d.ts +4 -124
- package/esm/NestedAttribute/NestedAttribute.js +1 -2
- package/esm/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
- package/esm/NestedAttributeEditor/NestedAttributeEditor.js +1 -2
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +1 -13
- package/esm/ReadOnlyComplexAttribute/index.d.ts +1 -0
- package/esm/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
- package/esm/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.js +3 -4
- package/esm/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
- package/esm/RelationTypeSelector/RelationTypeSelector.js +2 -14
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -18
- package/esm/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
- package/esm/components/ImageDetailsView/helpers/index.d.ts +5 -2
- package/esm/components/ImportButton/ImportButton.d.ts +2 -1
- package/esm/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
- package/esm/components/MultipliableSelect/MultipliableSelect.js +0 -15
- package/esm/components/ProfileBand/styles.d.ts +1 -1
- package/esm/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
- package/esm/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
- package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
- package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
- package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
- package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -28
- package/esm/components/ReactSelect/AsyncSelect.d.ts +0 -45
- package/esm/components/ReactSelect/CreatableSelect.d.ts +0 -45
- package/esm/components/ReactSelect/Select.d.ts +0 -45
- package/esm/components/ReactSelect/withMuiSkin.d.ts +3 -48
- package/esm/components/ReactSelect/withMuiSkin.js +0 -50
- package/esm/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
- package/esm/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
- package/esm/components/SearchInput/SearchInput.d.ts +1 -1
- package/esm/components/SelectionPopup/SelectionPopup.d.ts +1 -1
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/constants/prop-types.d.ts +0 -81
- package/esm/constants/prop-types.js +17 -38
- package/esm/constants/textField.d.ts +2 -2
- package/esm/contexts/ScrollToElementContext/index.d.ts +1 -1
- package/esm/features/graph/DataModelGraph/DataModelGraph.d.ts +6 -5
- package/esm/features/graph/DataModelGraph/DataModelGraph.js +4 -3
- package/esm/features/graph/DataModelGraph/DataModelGraph.test.js +3 -8
- package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.d.ts → DataModelCircleLayout.d.ts} +2 -2
- package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.js → DataModelCircleLayout.js} +3 -5
- package/esm/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +4 -2
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +6 -5
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +44 -14
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +40 -18
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +4 -3
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +3 -3
- package/esm/features/graph/index.d.ts +1 -1
- package/esm/features/graph/rendering/canvas/label.js +1 -1
- package/esm/features/graph/types/graphDataTypes.d.ts +2 -1
- package/esm/helpers/basicTable.d.ts +2 -7
- package/esm/hooks/useRelationTypeSelector.d.ts +12 -8
- package/esm/hooks/useRelationTypeSelector.js +3 -1
- package/esm/types/index.d.ts +19 -2
- package/package.json +2 -2
|
@@ -57,7 +57,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
57
57
|
return t;
|
|
58
58
|
};
|
|
59
59
|
import { renderHook, act } from '@testing-library/react-hooks';
|
|
60
|
-
import { last } from 'ramda';
|
|
60
|
+
import { last, omit } from 'ramda';
|
|
61
61
|
import { useSigma, useSetSettings, useRegisterEvents } from '@react-sigma/core';
|
|
62
62
|
import { DASHED_EDGE_COLOR, EDGE_COLOR, INACTIVE_EDGE_COLOR, INACTIVE_LABEL_COLOR, RELATED_DASHED_EDGE_COLOR, RELATED_EDGE_COLOR, SELECTED_EDGE_COLOR, useDataModelGraphAppearance } from './useDataModelGraphAppearance';
|
|
63
63
|
import { DataModelGraphNodeType } from '../../types/graphDataTypes';
|
|
@@ -86,7 +86,7 @@ describe('useDataModelGraphAppearance tests', function () {
|
|
|
86
86
|
getGraph: function () { return graph; }
|
|
87
87
|
});
|
|
88
88
|
return __assign({ graph: graph }, renderHook(useDataModelGraphAppearance, {
|
|
89
|
-
initialProps: __assign({ graph: graph, selectedNode: null, onNodeClick: jest.fn(),
|
|
89
|
+
initialProps: __assign({ graph: graph, selectedNode: null, onNodeClick: jest.fn(), selectedEdges: null, onEdgeLabelClick: jest.fn(), hideInteractionTypes: false }, props)
|
|
90
90
|
}));
|
|
91
91
|
};
|
|
92
92
|
var setSettings = jest.fn();
|
|
@@ -148,8 +148,8 @@ describe('useDataModelGraphAppearance tests', function () {
|
|
|
148
148
|
expect(nodeReducer('prescriptions', graph.getNodeAttributes('prescriptions'))).toEqual(__assign(__assign({}, getDefaultNodeAttributes(graph.getNodeAttributes('prescriptions'))), { hasBorder: true, image: expect.stringContaining('data:image/svg+xml'), label: 'Prescriptions', nodeType: DataModelGraphNodeType.interactionType }));
|
|
149
149
|
expect(result.error).toBeUndefined();
|
|
150
150
|
});
|
|
151
|
-
it('should apply correct styles when
|
|
152
|
-
var _a = setUp({
|
|
151
|
+
it('should apply correct styles when selectedEdges is specified', function () {
|
|
152
|
+
var _a = setUp({ selectedEdges: ['hcp->hca'] }), graph = _a.graph, result = _a.result;
|
|
153
153
|
var nodeReducer = getNodeReducer();
|
|
154
154
|
expect(nodeReducer('hcp', graph.getNodeAttributes('hcp'))).toEqual(__assign(__assign({}, getDefaultNodeAttributes(graph.getNodeAttributes('hcp'))), { image: 'HCP.svg', label: 'HCP', nodeType: DataModelGraphNodeType.entityType }));
|
|
155
155
|
expect(nodeReducer('hca', graph.getNodeAttributes('hca'))).toEqual(__assign(__assign({}, getDefaultNodeAttributes(graph.getNodeAttributes('hca'))), { image: 'HCA.svg', label: 'HCA', nodeType: DataModelGraphNodeType.entityType }));
|
|
@@ -165,31 +165,53 @@ describe('useDataModelGraphAppearance tests', function () {
|
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
describe('edges reducer behavior', function () {
|
|
168
|
-
var
|
|
169
|
-
size: 2
|
|
170
|
-
};
|
|
168
|
+
var getDefaultEdgeAttributes = function (attributes) { return (__assign(__assign({}, attributes), { size: 1 })); };
|
|
171
169
|
it('should apply default edge style', function () {
|
|
172
170
|
var _a = setUp(), result = _a.result, graph = _a.graph;
|
|
173
171
|
var edgeReducer = getEdgeReducer();
|
|
174
|
-
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({},
|
|
175
|
-
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({},
|
|
176
|
-
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({},
|
|
172
|
+
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->hca'))), { color: EDGE_COLOR }));
|
|
173
|
+
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hca->gpo'))), { color: EDGE_COLOR }));
|
|
174
|
+
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->prescriptions'))), { type: 'dashed', color: DASHED_EDGE_COLOR }));
|
|
177
175
|
expect(result.error).toBeUndefined();
|
|
178
176
|
});
|
|
179
177
|
it('should apply correct styles when selectedNode is specified', function () {
|
|
180
178
|
var _a = setUp({ selectedNode: 'hcp' }), graph = _a.graph, result = _a.result;
|
|
181
179
|
var edgeReducer = getEdgeReducer();
|
|
182
|
-
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({},
|
|
183
|
-
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({},
|
|
184
|
-
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({},
|
|
180
|
+
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->hca'))), { color: RELATED_EDGE_COLOR }));
|
|
181
|
+
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hca->gpo'))), { color: INACTIVE_EDGE_COLOR, labelColor: INACTIVE_LABEL_COLOR }));
|
|
182
|
+
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->prescriptions'))), { type: 'dashed', color: RELATED_DASHED_EDGE_COLOR }));
|
|
183
|
+
expect(result.error).toBeUndefined();
|
|
184
|
+
});
|
|
185
|
+
it('should apply correct styles when selectedEdges is specified', function () {
|
|
186
|
+
var _a = setUp({ selectedEdges: ['hcp->hca'] }), graph = _a.graph, result = _a.result;
|
|
187
|
+
var edgeReducer = getEdgeReducer();
|
|
188
|
+
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->hca'))), { color: SELECTED_EDGE_COLOR, selected: true }));
|
|
189
|
+
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hca->gpo'))), { selected: false, color: INACTIVE_EDGE_COLOR, labelColor: INACTIVE_LABEL_COLOR }));
|
|
190
|
+
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->prescriptions'))), { type: 'dashed', selected: false, color: INACTIVE_EDGE_COLOR, labelColor: INACTIVE_LABEL_COLOR }));
|
|
191
|
+
expect(result.error).toBeUndefined();
|
|
192
|
+
});
|
|
193
|
+
it('should remove edge label prop when relations edges amount bigger than relationEdgesLabelsAmountThreshold', function () {
|
|
194
|
+
var _a = setUp({ relationEdgesLabelsAmountThreshold: 1 }), graph = _a.graph, result = _a.result;
|
|
195
|
+
var edgeReducer = getEdgeReducer();
|
|
196
|
+
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({}, omit(['label'], getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->hca')))), { color: EDGE_COLOR }));
|
|
197
|
+
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({}, omit(['label'], getDefaultEdgeAttributes(graph.getEdgeAttributes('hca->gpo')))), { color: EDGE_COLOR }));
|
|
198
|
+
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->prescriptions'))), { type: 'dashed', color: DASHED_EDGE_COLOR }));
|
|
199
|
+
expect(result.error).toBeUndefined();
|
|
200
|
+
});
|
|
201
|
+
it('should keep edge label prop for edge related with selected node even if relations edges amount bigger than relationEdgesLabelsAmountThreshold', function () {
|
|
202
|
+
var _a = setUp({ relationEdgesLabelsAmountThreshold: 1, selectedNode: 'hcp' }), graph = _a.graph, result = _a.result;
|
|
203
|
+
var edgeReducer = getEdgeReducer();
|
|
204
|
+
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->hca'))), { color: RELATED_EDGE_COLOR }));
|
|
205
|
+
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({}, omit(['label'], getDefaultEdgeAttributes(graph.getEdgeAttributes('hca->gpo')))), { color: INACTIVE_EDGE_COLOR, labelColor: INACTIVE_LABEL_COLOR }));
|
|
206
|
+
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->prescriptions'))), { type: 'dashed', color: RELATED_DASHED_EDGE_COLOR }));
|
|
185
207
|
expect(result.error).toBeUndefined();
|
|
186
208
|
});
|
|
187
|
-
it('should
|
|
188
|
-
var _a = setUp({
|
|
209
|
+
it('should keep edge label prop for selected edge even if relations edges amount bigger than relationEdgesLabelsAmountThreshold', function () {
|
|
210
|
+
var _a = setUp({ relationEdgesLabelsAmountThreshold: 1, selectedEdges: ['hcp->hca'] }), graph = _a.graph, result = _a.result;
|
|
189
211
|
var edgeReducer = getEdgeReducer();
|
|
190
|
-
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({},
|
|
191
|
-
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({},
|
|
192
|
-
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({},
|
|
212
|
+
expect(edgeReducer('hcp->hca', graph.getEdgeAttributes('hcp->hca'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->hca'))), { color: SELECTED_EDGE_COLOR, selected: true }));
|
|
213
|
+
expect(edgeReducer('hca->gpo', graph.getEdgeAttributes('hca->gpo'))).toEqual(__assign(__assign({}, omit(['label'], getDefaultEdgeAttributes(graph.getEdgeAttributes('hca->gpo')))), { selected: false, color: INACTIVE_EDGE_COLOR, labelColor: INACTIVE_LABEL_COLOR }));
|
|
214
|
+
expect(edgeReducer('hcp->prescriptions', graph.getEdgeAttributes('hcp->prescriptions'))).toEqual(__assign(__assign({}, getDefaultEdgeAttributes(graph.getEdgeAttributes('hcp->prescriptions'))), { type: 'dashed', selected: false, color: INACTIVE_EDGE_COLOR, labelColor: INACTIVE_LABEL_COLOR }));
|
|
193
215
|
expect(result.error).toBeUndefined();
|
|
194
216
|
});
|
|
195
217
|
});
|
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { useEffect, useState, useRef, useCallback } from 'react';
|
|
13
13
|
import { useRegisterEvents, useSigma } from '@react-sigma/core';
|
|
14
|
+
import { rgbaToRgb } from '@reltio/mdm-sdk';
|
|
14
15
|
import { useSigmaCustomRenderers } from '../../hooks/useSigmaCustomRenderers';
|
|
15
16
|
import { DataModelGraphNodeType } from '../../types/graphDataTypes';
|
|
16
17
|
import { drawLabel } from '../../rendering/canvas/label';
|
|
@@ -34,7 +35,7 @@ export var useEdgeLabelsRenderer = function (_a) {
|
|
|
34
35
|
var sourceDisplayData = sigma.getNodeDisplayData(sourceId);
|
|
35
36
|
var targetDisplayData = sigma.getNodeDisplayData(targetId);
|
|
36
37
|
var relationEdge = [sourceDisplayData.nodeType, targetDisplayData.nodeType].every(function (type) { return type === DataModelGraphNodeType.entityType; });
|
|
37
|
-
return relationEdge && !edgeDisplayData.hidden;
|
|
38
|
+
return relationEdge && !edgeDisplayData.hidden && edgeDisplayData.label;
|
|
38
39
|
}, [sigma]);
|
|
39
40
|
var drawEdgeLabel = useCallback(function (context, edgeId, sourceId, targetId) {
|
|
40
41
|
delete edgeLabelsPathsMap.current[edgeId];
|
|
@@ -65,11 +66,11 @@ export var useEdgeLabelsRenderer = function (_a) {
|
|
|
65
66
|
var isHovered = hoveredEdgeLabel === edgeId;
|
|
66
67
|
var isSelected = edgeDisplayData.selected;
|
|
67
68
|
var dotScale = isHovered || isSelected ? 1.4 : 1;
|
|
68
|
-
var circleRadius = sigma.scaleSize(2
|
|
69
|
+
var circleRadius = sigma.scaleSize(2 * dotScale);
|
|
69
70
|
var _a = getEdgeCenter(edgeId, sourceId, targetId, sigma), x = _a.x, y = _a.y;
|
|
70
71
|
context.beginPath();
|
|
71
72
|
context.arc(x, y, circleRadius, 0, Math.PI * 2);
|
|
72
|
-
context.fillStyle = edgeDisplayData.color;
|
|
73
|
+
context.fillStyle = rgbaToRgb(edgeDisplayData.color);
|
|
73
74
|
context.fill();
|
|
74
75
|
}
|
|
75
76
|
}, [sigma, hoveredEdgeLabel, shouldRenderLabels]);
|
|
@@ -105,8 +105,8 @@ describe('useEdgeLabelsRenderer tests', function () {
|
|
|
105
105
|
'arc',
|
|
106
106
|
'fill'
|
|
107
107
|
]);
|
|
108
|
-
expect(canvasContext.arc).toHaveBeenCalledWith(150, 100, 2
|
|
109
|
-
expect(canvasContext.arc).toHaveBeenCalledWith(250, 100, 2
|
|
108
|
+
expect(canvasContext.arc).toHaveBeenCalledWith(150, 100, 2, 0, 2 * Math.PI);
|
|
109
|
+
expect(canvasContext.arc).toHaveBeenCalledWith(250, 100, 2, 0, 2 * Math.PI);
|
|
110
110
|
});
|
|
111
111
|
it('should correctly draw a hover state of edge', function () {
|
|
112
112
|
setUp();
|
|
@@ -127,7 +127,7 @@ describe('useEdgeLabelsRenderer tests', function () {
|
|
|
127
127
|
});
|
|
128
128
|
expect(getCanvasContextEventTypes(hoversCanvasContext)).toEqual(expect.arrayContaining(['beginPath', 'arc', 'fill']));
|
|
129
129
|
expect(hoversCanvasContext.arc).toBeCalledTimes(1);
|
|
130
|
-
expect(hoversCanvasContext.arc).toHaveBeenCalledWith(150, 100,
|
|
130
|
+
expect(hoversCanvasContext.arc).toHaveBeenCalledWith(150, 100, 2.8, 0, 2 * Math.PI);
|
|
131
131
|
expect(drawLabel).toBeCalledTimes(1);
|
|
132
132
|
expect(drawLabel).toHaveBeenCalledWith(hoversCanvasContext, { label: '1', size: 4, x: 150, y: 100 }, { labelColor: 'black', labelSize: 12 * 1.2 }, { backgroundColor: 'rgba(250, 250, 250, 1)' });
|
|
133
133
|
});
|
|
@@ -11,6 +11,6 @@ export { NodeBorderProgram } from './rendering/webgl/node.border';
|
|
|
11
11
|
export { NodeDashedBorderProgram } from './rendering/webgl/node.dashed.border';
|
|
12
12
|
export { WebGLImageLoader } from './rendering/webgl/image';
|
|
13
13
|
export { getCanvasMousePos } from './rendering/canvas/utils';
|
|
14
|
-
export type { GraphNodeAttributes, GraphEdgeAttributes } from './types/graphDataTypes';
|
|
14
|
+
export type { GraphNodeAttributes, GraphEdgeAttributes, DataModelGraphNodeAttributes, DataModelGraphEdgeAttributes } from './types/graphDataTypes';
|
|
15
15
|
export { DataModelGraphNodeType } from './types/graphDataTypes';
|
|
16
16
|
export type { Canvas } from './types/sigmaCustomRenderersTypes';
|
|
@@ -6,6 +6,7 @@ export var drawLabel = function (context, data, settings, _a) {
|
|
|
6
6
|
return;
|
|
7
7
|
var size = settings.labelSize, font = settings.labelFont, weight = settings.labelWeight, marginLeft = data.selected ? 6 : 2, lineHeight = size * 1.2;
|
|
8
8
|
var PERMANENT_MARGIN_LEFT = 9;
|
|
9
|
+
context.font = "".concat(weight, " ").concat(size, "px ").concat(font);
|
|
9
10
|
var labelBackgroundPath = drawLabelBackground(context, data, settings, {
|
|
10
11
|
backgroundColor: data.selected ? '#FFF' : backgroundColor,
|
|
11
12
|
marginLeft: marginLeft,
|
|
@@ -15,7 +16,6 @@ export var drawLabel = function (context, data, settings, _a) {
|
|
|
15
16
|
context.fillStyle = ((_b = settings.labelColor) === null || _b === void 0 ? void 0 : _b.attribute)
|
|
16
17
|
? data[settings.labelColor.attribute] || settings.labelColor.color || '#000'
|
|
17
18
|
: settings.labelColor.color;
|
|
18
|
-
context.font = "".concat(weight, " ").concat(size, "px ").concat(font);
|
|
19
19
|
var y = data.secondaryLabel ? data.y - size / (3 * 1.25) : data.y + size / 3;
|
|
20
20
|
context.fillText(data.label, data.x + data.size + PERMANENT_MARGIN_LEFT + marginLeft, y);
|
|
21
21
|
if (data.secondaryLabel) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Graph from 'graphology';
|
|
2
2
|
import { NodeDisplayData, EdgeDisplayData } from 'sigma/types';
|
|
3
3
|
import { Settings } from 'sigma/settings';
|
|
4
|
+
import { TRelationType } from '@reltio/mdm-sdk';
|
|
4
5
|
export type GraphEdgeAttributes = EdgeDisplayData & {
|
|
5
6
|
loop: boolean;
|
|
6
7
|
arrowSizeRatio?: number;
|
|
@@ -21,7 +22,7 @@ export declare enum DataModelGraphNodeType {
|
|
|
21
22
|
interactionType = "interactionType"
|
|
22
23
|
}
|
|
23
24
|
export type DataModelGraphEdgeAttributes = GraphEdgeAttributes & {
|
|
24
|
-
|
|
25
|
+
relationTypes: TRelationType[];
|
|
25
26
|
};
|
|
26
27
|
export type DataModelGraphNodeAttributes = GraphNodeAttributes & {
|
|
27
28
|
nodeType: DataModelGraphNodeType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FacetFilter } from '@reltio/mdm-sdk';
|
|
2
2
|
import { ColumnData, ColumnFilter } from '../types/basicTable';
|
|
3
3
|
export declare const defaultGetRowCellHeight: ({ columnData, cell }: {
|
|
4
4
|
columnData: any;
|
|
@@ -9,10 +9,5 @@ export declare const defaultRenderRowCell: ({ cell, CellValueRenderer, ...otherP
|
|
|
9
9
|
cell: any;
|
|
10
10
|
CellValueRenderer: any;
|
|
11
11
|
}) => any;
|
|
12
|
-
export declare const columnFilterToMdmFilter: (columnData: Pick<ColumnData, 'id' | 'dataTypeDefinition'>, columnFilter?: ColumnFilter) =>
|
|
13
|
-
fieldName: string;
|
|
14
|
-
filter: string;
|
|
15
|
-
values: import("@reltio/mdm-sdk").SearchValue[];
|
|
16
|
-
type: DataTypes;
|
|
17
|
-
};
|
|
12
|
+
export declare const columnFilterToMdmFilter: (columnData: Pick<ColumnData, 'id' | 'dataTypeDefinition'>, columnFilter?: ColumnFilter) => FacetFilter;
|
|
18
13
|
export declare const buildColumnsFilter: (columnsData: ColumnData[], filters?: Record<string, ColumnFilter>) => string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ConnectionRelation, TRelationType } from '@reltio/mdm-sdk';
|
|
2
|
+
import { RelationOption } from '../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
reversedContextLabels?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const useRelationTypeSelector: ({ reversedContextLabels }: Props) => {
|
|
7
|
+
getRelationTypesOptions: (inRelations: TRelationType[], outRelations: TRelationType[]) => RelationOption[];
|
|
8
|
+
fromEditorValue: (inRelationTypes: TRelationType[], outRelationTypes: TRelationType[]) => (relation: RelationOption) => {
|
|
9
|
+
type: TRelationType;
|
|
10
|
+
direction: string;
|
|
8
11
|
};
|
|
9
|
-
toEditorValue: (relation:
|
|
12
|
+
toEditorValue: (relation: ConnectionRelation, relationsTypesOptions: RelationOption[]) => RelationOption | undefined;
|
|
10
13
|
};
|
|
14
|
+
export {};
|
|
@@ -10,7 +10,9 @@ export var useRelationTypeSelector = function (_a) {
|
|
|
10
10
|
var byLabel = ascend(prop('label'));
|
|
11
11
|
var prepareRelation = curry(function (direction, _a) {
|
|
12
12
|
var uri = _a.uri, label = _a.label, startObject = _a.startObject, endObject = _a.endObject;
|
|
13
|
-
var dirObject = direction === (reversedContextLabels ? Directions.OUT : Directions.IN)
|
|
13
|
+
var dirObject = direction === (reversedContextLabels ? Directions.OUT : Directions.IN)
|
|
14
|
+
? startObject
|
|
15
|
+
: endObject;
|
|
14
16
|
return {
|
|
15
17
|
label: { directionalLabel: getDirectionalLabel(dirObject), typeLabel: label },
|
|
16
18
|
value: "".concat(uri, ",").concat(direction),
|
package/esm/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeType, Crosswalk, RelationCrosswalk, SearchFilter, SearchOperator } from '@reltio/mdm-sdk';
|
|
2
|
+
import { AttributeType, AttributeValue, ConnectionRelationType, Crosswalk, RelationCrosswalk, SearchFilter, SearchOperator } from '@reltio/mdm-sdk';
|
|
3
3
|
import { Layout as LayoutItem } from 'react-grid-layout';
|
|
4
4
|
export type ReactGridLayoutItem = LayoutItem;
|
|
5
5
|
export type ReltioGridLayoutOptions = {
|
|
@@ -25,7 +25,7 @@ export type QueryBuilderAttributeData = {
|
|
|
25
25
|
filterOptions: Array<string>;
|
|
26
26
|
};
|
|
27
27
|
export type QueryBuilderAttribute = {
|
|
28
|
-
id: string;
|
|
28
|
+
id: string | number;
|
|
29
29
|
values: Array<unknown>;
|
|
30
30
|
data: QueryBuilderAttributeData;
|
|
31
31
|
filter: string;
|
|
@@ -161,3 +161,20 @@ export type ImageAttributeSize = ImageSize & {
|
|
|
161
161
|
imageHeight: number;
|
|
162
162
|
imageMargin: number;
|
|
163
163
|
};
|
|
164
|
+
export type RelationOption = {
|
|
165
|
+
label: string;
|
|
166
|
+
value: string;
|
|
167
|
+
} & Pick<ConnectionRelationType, 'startObject' | 'endObject'>;
|
|
168
|
+
export type DropDownEntryType = {
|
|
169
|
+
label?: string;
|
|
170
|
+
value: string;
|
|
171
|
+
};
|
|
172
|
+
export type DropDownGroupEntryType = {
|
|
173
|
+
label?: string;
|
|
174
|
+
values: DropDownEntryType[];
|
|
175
|
+
isGroup?: boolean;
|
|
176
|
+
};
|
|
177
|
+
export type AdditionalControlsRenderer<T extends AttributeValue> = {
|
|
178
|
+
attributeType: AttributeType;
|
|
179
|
+
attributeValue: T;
|
|
180
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1854",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
10
|
"@react-sigma/core": "3.4.0",
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1802",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|