@reltio/components 1.4.1857 → 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 attrTypes = _a.attrTypes, entity = _a.entity, parentUri = _a.parentUri, drawLines = _a.drawLines, children = _a.children, className = _a.className, max = _a.max, _b = _a.alwaysVisibleTypeUris, alwaysVisibleTypeUris = _b === void 0 ? constants_1.ALWAYS_VISIBLE_TYPE_URIS : _b, showNonOv = _a.showNonOv;
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 _c = (0, react_1.useState)(max || Infinity), visibleValuesCount = _c[0], setVisibleValuesCount = _c[1];
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 _d = (0, react_1.useMemo)(function () { return (0, attributesView_1.splitPagersData)(alwaysVisibleTypeUris, pagersData); }, [pagersData, alwaysVisibleTypeUris]), alwaysVisiblePagersData = _d[0], regularPagersData = _d[1];
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 attrTypes = _a.attrTypes, entity = _a.entity, parentUri = _a.parentUri, drawLines = _a.drawLines, children = _a.children, className = _a.className, max = _a.max, _b = _a.alwaysVisibleTypeUris, alwaysVisibleTypeUris = _b === void 0 ? ALWAYS_VISIBLE_TYPE_URIS : _b, showNonOv = _a.showNonOv;
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 _c = useState(max || Infinity), visibleValuesCount = _c[0], setVisibleValuesCount = _c[1];
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 _d = useMemo(function () { return splitPagersData(alwaysVisibleTypeUris, pagersData); }, [pagersData, alwaysVisibleTypeUris]), alwaysVisiblePagersData = _d[0], regularPagersData = _d[1];
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.1857",
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",