@reltio/components 1.4.1856 → 1.4.1858
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AttributeType, Entity, Relation } from '@reltio/mdm-sdk';
|
|
3
3
|
type Props = {
|
|
4
|
-
attrTypes: AttributeType[];
|
|
5
4
|
entity: Partial<Entity> | Partial<Relation>;
|
|
5
|
+
attrTypes?: AttributeType[];
|
|
6
6
|
parentUri?: string;
|
|
7
7
|
drawLines?: boolean;
|
|
8
8
|
children?: React.ReactNode;
|
|
@@ -45,12 +45,12 @@ var constants_1 = require("../constants");
|
|
|
45
45
|
var attributesView_1 = require("../helpers/attributesView");
|
|
46
46
|
var contexts_1 = require("../contexts");
|
|
47
47
|
var ReadOnlyAttributesList = function (_a) {
|
|
48
|
-
var
|
|
48
|
+
var _b = _a.attrTypes, attrTypes = _b === void 0 ? [] : _b, entity = _a.entity, parentUri = _a.parentUri, drawLines = _a.drawLines, children = _a.children, className = _a.className, max = _a.max, _c = _a.alwaysVisibleTypeUris, alwaysVisibleTypeUris = _c === void 0 ? constants_1.ALWAYS_VISIBLE_TYPE_URIS : _c, showNonOv = _a.showNonOv;
|
|
49
49
|
var hiddenAttributes = (0, contexts_1.useMdmHiddenAttributes)();
|
|
50
50
|
var filteredAttrTypes = (0, react_1.useMemo)(function () { return attrTypes.filter(function (attrType) { return !hiddenAttributes.includes(attrType.uri); }); }, [attrTypes, hiddenAttributes]);
|
|
51
|
-
var
|
|
51
|
+
var _d = (0, react_1.useState)(max || Infinity), visibleValuesCount = _d[0], setVisibleValuesCount = _d[1];
|
|
52
52
|
var pagersData = (0, react_1.useMemo)(function () { return (0, mdm_sdk_1.getAttributesListForReadMode)(filteredAttrTypes, entity, showNonOv); }, [filteredAttrTypes, entity, showNonOv]);
|
|
53
|
-
var
|
|
53
|
+
var _e = (0, react_1.useMemo)(function () { return (0, attributesView_1.splitPagersData)(alwaysVisibleTypeUris, pagersData); }, [pagersData, alwaysVisibleTypeUris]), alwaysVisiblePagersData = _e[0], regularPagersData = _e[1];
|
|
54
54
|
var visibleAttributePagersData = regularPagersData.slice(0, visibleValuesCount);
|
|
55
55
|
var showMore = max && visibleAttributePagersData.length < regularPagersData.length;
|
|
56
56
|
var showLess = max && visibleAttributePagersData.length >= regularPagersData.length && max < visibleAttributePagersData.length;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AttributeType, Entity, Relation } from '@reltio/mdm-sdk';
|
|
3
3
|
type Props = {
|
|
4
|
-
attrTypes: AttributeType[];
|
|
5
4
|
entity: Partial<Entity> | Partial<Relation>;
|
|
5
|
+
attrTypes?: AttributeType[];
|
|
6
6
|
parentUri?: string;
|
|
7
7
|
drawLines?: boolean;
|
|
8
8
|
children?: React.ReactNode;
|
|
@@ -20,12 +20,12 @@ import { ALWAYS_VISIBLE_TYPE_URIS } from '../constants';
|
|
|
20
20
|
import { splitPagersData } from '../helpers/attributesView';
|
|
21
21
|
import { useMdmHiddenAttributes } from '../contexts';
|
|
22
22
|
var ReadOnlyAttributesList = function (_a) {
|
|
23
|
-
var
|
|
23
|
+
var _b = _a.attrTypes, attrTypes = _b === void 0 ? [] : _b, entity = _a.entity, parentUri = _a.parentUri, drawLines = _a.drawLines, children = _a.children, className = _a.className, max = _a.max, _c = _a.alwaysVisibleTypeUris, alwaysVisibleTypeUris = _c === void 0 ? ALWAYS_VISIBLE_TYPE_URIS : _c, showNonOv = _a.showNonOv;
|
|
24
24
|
var hiddenAttributes = useMdmHiddenAttributes();
|
|
25
25
|
var filteredAttrTypes = useMemo(function () { return attrTypes.filter(function (attrType) { return !hiddenAttributes.includes(attrType.uri); }); }, [attrTypes, hiddenAttributes]);
|
|
26
|
-
var
|
|
26
|
+
var _d = useState(max || Infinity), visibleValuesCount = _d[0], setVisibleValuesCount = _d[1];
|
|
27
27
|
var pagersData = useMemo(function () { return getAttributesListForReadMode(filteredAttrTypes, entity, showNonOv); }, [filteredAttrTypes, entity, showNonOv]);
|
|
28
|
-
var
|
|
28
|
+
var _e = useMemo(function () { return splitPagersData(alwaysVisibleTypeUris, pagersData); }, [pagersData, alwaysVisibleTypeUris]), alwaysVisiblePagersData = _e[0], regularPagersData = _e[1];
|
|
29
29
|
var visibleAttributePagersData = regularPagersData.slice(0, visibleValuesCount);
|
|
30
30
|
var showMore = max && visibleAttributePagersData.length < regularPagersData.length;
|
|
31
31
|
var showLess = max && visibleAttributePagersData.length >= regularPagersData.length && max < visibleAttributePagersData.length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1858",
|
|
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.1805",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|