@reltio/components 1.4.1243 → 1.4.1246
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/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.d.ts +5 -1
- package/cjs/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.js +2 -2
- package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.d.ts +4 -2
- package/cjs/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +5 -5
- package/cjs/components/editors/TimestampEditor/TimestampEditor.js +1 -1
- package/esm/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.d.ts +5 -1
- package/esm/components/attributes/readMode/AttributeValuesBlock/AttributeValuesBlock.js +2 -2
- package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.d.ts +4 -2
- package/esm/components/attributes/readMode/ComplexAttribute/ComplexAttribute.js +6 -6
- package/esm/components/editors/TimestampEditor/TimestampEditor.js +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,11 @@ declare type Props = {
|
|
|
9
9
|
attributeType: any;
|
|
10
10
|
attributeValue: any;
|
|
11
11
|
}) => JSX.Element;
|
|
12
|
+
RightSlot?: ({ attributeType: AttributeType, attributeValue: AttributeValue }: {
|
|
13
|
+
attributeType: any;
|
|
14
|
+
attributeValue: any;
|
|
15
|
+
}) => JSX.Element;
|
|
12
16
|
showNonOv?: boolean;
|
|
13
17
|
};
|
|
14
|
-
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, ...props }: Props) => JSX.Element>;
|
|
18
|
+
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, RightSlot, ...props }: Props) => JSX.Element>;
|
|
15
19
|
export default _default;
|
|
@@ -54,12 +54,12 @@ var renderAttributesList = function (_a) {
|
|
|
54
54
|
react_1.default.createElement(__1.ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))); })));
|
|
55
55
|
};
|
|
56
56
|
var AttributeValuesBlock = function (_a) {
|
|
57
|
-
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, props = __rest(_a, ["expanded", "LabelRenderer"]);
|
|
57
|
+
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, RightSlot = _a.RightSlot, props = __rest(_a, ["expanded", "LabelRenderer", "RightSlot"]);
|
|
58
58
|
var attributeType = props.attributeType, values = props.values, valueContainerClassName = props.valueContainerClassName;
|
|
59
59
|
switch (attributeType.type) {
|
|
60
60
|
case mdm_sdk_1.DataTypes.TYPE_NESTED:
|
|
61
61
|
case mdm_sdk_1.DataTypes.TYPE_REFERENCE: {
|
|
62
|
-
return renderAttributesList(__assign({ expanded: expanded, LabelRenderer: LabelRenderer }, props));
|
|
62
|
+
return renderAttributesList(__assign({ expanded: expanded, LabelRenderer: LabelRenderer, RightSlot: RightSlot }, props));
|
|
63
63
|
}
|
|
64
64
|
case mdm_sdk_1.DataTypes.TYPE_IMAGE: {
|
|
65
65
|
return (react_1.default.createElement("div", { className: valueContainerClassName },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ComplexAttribute;
|
|
2
|
-
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType, LabelRenderer }: {
|
|
2
|
+
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType, LabelRenderer, RightSlot }: {
|
|
3
3
|
attributeTypesList: any;
|
|
4
4
|
attributeValue: any;
|
|
5
5
|
label: any;
|
|
@@ -8,6 +8,7 @@ declare function ComplexAttribute({ attributeTypesList, attributeValue, label, e
|
|
|
8
8
|
showNonOv: any;
|
|
9
9
|
attributeType: any;
|
|
10
10
|
LabelRenderer: any;
|
|
11
|
+
RightSlot: any;
|
|
11
12
|
}): JSX.Element;
|
|
12
13
|
declare namespace ComplexAttribute {
|
|
13
14
|
namespace propTypes {
|
|
@@ -37,7 +38,8 @@ declare namespace ComplexAttribute {
|
|
|
37
38
|
export const expanded: PropTypes.Requireable<boolean>;
|
|
38
39
|
export const showNonOv: PropTypes.Requireable<boolean>;
|
|
39
40
|
export { AttributeTypeType as attributeType };
|
|
40
|
-
export const LabelRenderer: PropTypes.Requireable<
|
|
41
|
+
export const LabelRenderer: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
42
|
+
export const RightSlot: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
import PropTypes from "prop-types";
|
|
@@ -47,7 +47,7 @@ var contexts_1 = require("../../../../contexts");
|
|
|
47
47
|
var commonStyles_1 = require("../helpers/commonStyles");
|
|
48
48
|
var ComplexAttribute = function (_a) {
|
|
49
49
|
var _b;
|
|
50
|
-
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType, LabelRenderer = _a.LabelRenderer;
|
|
50
|
+
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType, LabelRenderer = _a.LabelRenderer, RightSlot = _a.RightSlot;
|
|
51
51
|
var styles = styles_1.useStyles();
|
|
52
52
|
var ovValueStyles = commonStyles_1.useOvValueStyles();
|
|
53
53
|
var uri = attributeValue.uri;
|
|
@@ -66,12 +66,11 @@ var ComplexAttribute = function (_a) {
|
|
|
66
66
|
react_1.default.createElement(ArrowExpandButton_1.default, { onClick: function () { return setExpanded(function (value) { return !value; }); }, expanded: expanded }),
|
|
67
67
|
LabelRenderer ? (react_1.default.createElement(LabelRenderer, { attributeType: attributeType, attributeValue: attributeValue })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
68
68
|
react_1.default.createElement(Typography_1.default, { component: "span", variant: "body2", classes: { body2: styles.label }, className: classnames_1.default((_b = {},
|
|
69
|
-
_b[highlightedClassName] = highlightedValuesUris.
|
|
70
|
-
return mdm_sdk_1.areOneHierarchyUris(uri, attributeValue.uri);
|
|
71
|
-
}),
|
|
69
|
+
_b[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
|
|
72
70
|
_b[ovValueStyles.ovFalse] = !mdm_sdk_1.isOv(attributeValue),
|
|
73
71
|
_b)), "data-reltio-id": "reltio-attribute-complex-label" }, label),
|
|
74
72
|
react_1.default.createElement("div", { className: styles.spacer }),
|
|
73
|
+
RightSlot && react_1.default.createElement(RightSlot, { attributeType: attributeType, attributeValue: attributeValue }),
|
|
75
74
|
react_1.default.createElement(CommentsContainer_1.default, { uri: attributeValue.uri, relatedObjectUris: mdm_sdk_1.createRelatedObjectUris(objectType, {
|
|
76
75
|
uri: attributeValue.uri
|
|
77
76
|
}), objectType: objectType })))),
|
|
@@ -85,6 +84,7 @@ ComplexAttribute.propTypes = {
|
|
|
85
84
|
expanded: prop_types_1.default.bool,
|
|
86
85
|
showNonOv: prop_types_1.default.bool,
|
|
87
86
|
attributeType: mdm_sdk_1.AttributeTypeType,
|
|
88
|
-
LabelRenderer: prop_types_1.default.
|
|
87
|
+
LabelRenderer: prop_types_1.default.elementType,
|
|
88
|
+
RightSlot: prop_types_1.default.elementType
|
|
89
89
|
};
|
|
90
90
|
exports.default = ComplexAttribute;
|
|
@@ -71,7 +71,7 @@ var TimestampEditor = function (_a) {
|
|
|
71
71
|
views: ['year', 'date', 'hours', 'minutes', 'seconds'], autoOk: true, InputAdornmentProps: { position: 'end' }, KeyboardButtonProps: {
|
|
72
72
|
classes: { root: styles.iconButtonRoot },
|
|
73
73
|
onKeyPress: ramda_1.invoker(0, 'stopPropagation')
|
|
74
|
-
}, keyboardIcon: react_1.default.createElement(DateRange_1.default, null), onChange: ramda_1.when(mdm_sdk_1.utils.dates.isValidMomentDateOrNull, ramda_1.pipe(mdm_sdk_1.utils.dates.momentToDate, onChange)), label: label, "aria-label": label, value: value, placeholder: ui_i18n_1.default.text((dateFormat + " HH:MM").toUpperCase()), ampm:
|
|
74
|
+
}, keyboardIcon: react_1.default.createElement(DateRange_1.default, null), onChange: ramda_1.when(mdm_sdk_1.utils.dates.isValidMomentDateOrNull, ramda_1.pipe(mdm_sdk_1.utils.dates.momentToDate, onChange)), label: label, "aria-label": label, value: value, placeholder: ui_i18n_1.default.text((dateFormat + " HH:MM").toUpperCase()), ampm: isAmPmFormat, onClose: function () { return setIsCalendarOpen(false); }, onOpen: function () { return setIsCalendarOpen(true); }, InputProps: __assign({ classes: {
|
|
75
75
|
root: styles.inputRoot,
|
|
76
76
|
underline: classnames_1.default((_b = {}, _b[styles.underline] = isCalendarOpen, _b)),
|
|
77
77
|
adornedEnd: styles.adornedEnd
|
|
@@ -9,7 +9,11 @@ declare type Props = {
|
|
|
9
9
|
attributeType: any;
|
|
10
10
|
attributeValue: any;
|
|
11
11
|
}) => JSX.Element;
|
|
12
|
+
RightSlot?: ({ attributeType: AttributeType, attributeValue: AttributeValue }: {
|
|
13
|
+
attributeType: any;
|
|
14
|
+
attributeValue: any;
|
|
15
|
+
}) => JSX.Element;
|
|
12
16
|
showNonOv?: boolean;
|
|
13
17
|
};
|
|
14
|
-
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, ...props }: Props) => JSX.Element>;
|
|
18
|
+
declare const _default: React.MemoExoticComponent<({ expanded, LabelRenderer, RightSlot, ...props }: Props) => JSX.Element>;
|
|
15
19
|
export default _default;
|
|
@@ -30,12 +30,12 @@ var renderAttributesList = function (_a) {
|
|
|
30
30
|
React.createElement(ReadOnlyAttribute, __assign({ attributeValue: attributeValue }, props)))); })));
|
|
31
31
|
};
|
|
32
32
|
var AttributeValuesBlock = function (_a) {
|
|
33
|
-
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, props = __rest(_a, ["expanded", "LabelRenderer"]);
|
|
33
|
+
var expanded = _a.expanded, LabelRenderer = _a.LabelRenderer, RightSlot = _a.RightSlot, props = __rest(_a, ["expanded", "LabelRenderer", "RightSlot"]);
|
|
34
34
|
var attributeType = props.attributeType, values = props.values, valueContainerClassName = props.valueContainerClassName;
|
|
35
35
|
switch (attributeType.type) {
|
|
36
36
|
case DataTypes.TYPE_NESTED:
|
|
37
37
|
case DataTypes.TYPE_REFERENCE: {
|
|
38
|
-
return renderAttributesList(__assign({ expanded: expanded, LabelRenderer: LabelRenderer }, props));
|
|
38
|
+
return renderAttributesList(__assign({ expanded: expanded, LabelRenderer: LabelRenderer, RightSlot: RightSlot }, props));
|
|
39
39
|
}
|
|
40
40
|
case DataTypes.TYPE_IMAGE: {
|
|
41
41
|
return (React.createElement("div", { className: valueContainerClassName },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ComplexAttribute;
|
|
2
|
-
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType, LabelRenderer }: {
|
|
2
|
+
declare function ComplexAttribute({ attributeTypesList, attributeValue, label, expanded: expandedProp, children, showNonOv, attributeType, LabelRenderer, RightSlot }: {
|
|
3
3
|
attributeTypesList: any;
|
|
4
4
|
attributeValue: any;
|
|
5
5
|
label: any;
|
|
@@ -8,6 +8,7 @@ declare function ComplexAttribute({ attributeTypesList, attributeValue, label, e
|
|
|
8
8
|
showNonOv: any;
|
|
9
9
|
attributeType: any;
|
|
10
10
|
LabelRenderer: any;
|
|
11
|
+
RightSlot: any;
|
|
11
12
|
}): JSX.Element;
|
|
12
13
|
declare namespace ComplexAttribute {
|
|
13
14
|
namespace propTypes {
|
|
@@ -37,7 +38,8 @@ declare namespace ComplexAttribute {
|
|
|
37
38
|
export const expanded: PropTypes.Requireable<boolean>;
|
|
38
39
|
export const showNonOv: PropTypes.Requireable<boolean>;
|
|
39
40
|
export { AttributeTypeType as attributeType };
|
|
40
|
-
export const LabelRenderer: PropTypes.Requireable<
|
|
41
|
+
export const LabelRenderer: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
42
|
+
export const RightSlot: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
import PropTypes from "prop-types";
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import classnames from 'classnames';
|
|
15
|
-
import { AttributeTypeType,
|
|
15
|
+
import { AttributeTypeType, isAnalyticAttribute, NestedAttributeValueType, ReferenceAttributeValueType, CollaborationObjectTypes, createRelatedObjectUris, isOv, isRelationAttrType, isSpecialAttribute } from '@reltio/mdm-sdk';
|
|
16
16
|
import Typography from '@material-ui/core/Typography';
|
|
17
17
|
import AttributesList from '../AttributesList/AttributesList';
|
|
18
18
|
import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
|
|
@@ -23,7 +23,7 @@ import { HighlightedValuesContext } from '../../../../contexts';
|
|
|
23
23
|
import { useOvValueStyles } from '../helpers/commonStyles';
|
|
24
24
|
var ComplexAttribute = function (_a) {
|
|
25
25
|
var _b;
|
|
26
|
-
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType, LabelRenderer = _a.LabelRenderer;
|
|
26
|
+
var attributeTypesList = _a.attributeTypesList, attributeValue = _a.attributeValue, label = _a.label, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c, children = _a.children, showNonOv = _a.showNonOv, attributeType = _a.attributeType, LabelRenderer = _a.LabelRenderer, RightSlot = _a.RightSlot;
|
|
27
27
|
var styles = useStyles();
|
|
28
28
|
var ovValueStyles = useOvValueStyles();
|
|
29
29
|
var uri = attributeValue.uri;
|
|
@@ -42,12 +42,11 @@ var ComplexAttribute = function (_a) {
|
|
|
42
42
|
React.createElement(ArrowExpandButton, { onClick: function () { return setExpanded(function (value) { return !value; }); }, expanded: expanded }),
|
|
43
43
|
LabelRenderer ? (React.createElement(LabelRenderer, { attributeType: attributeType, attributeValue: attributeValue })) : (React.createElement(React.Fragment, null,
|
|
44
44
|
React.createElement(Typography, { component: "span", variant: "body2", classes: { body2: styles.label }, className: classnames((_b = {},
|
|
45
|
-
_b[highlightedClassName] = highlightedValuesUris.
|
|
46
|
-
return areOneHierarchyUris(uri, attributeValue.uri);
|
|
47
|
-
}),
|
|
45
|
+
_b[highlightedClassName] = highlightedValuesUris.includes(attributeValue.uri),
|
|
48
46
|
_b[ovValueStyles.ovFalse] = !isOv(attributeValue),
|
|
49
47
|
_b)), "data-reltio-id": "reltio-attribute-complex-label" }, label),
|
|
50
48
|
React.createElement("div", { className: styles.spacer }),
|
|
49
|
+
RightSlot && React.createElement(RightSlot, { attributeType: attributeType, attributeValue: attributeValue }),
|
|
51
50
|
React.createElement(CommentsContainer, { uri: attributeValue.uri, relatedObjectUris: createRelatedObjectUris(objectType, {
|
|
52
51
|
uri: attributeValue.uri
|
|
53
52
|
}), objectType: objectType })))),
|
|
@@ -61,6 +60,7 @@ ComplexAttribute.propTypes = {
|
|
|
61
60
|
expanded: PropTypes.bool,
|
|
62
61
|
showNonOv: PropTypes.bool,
|
|
63
62
|
attributeType: AttributeTypeType,
|
|
64
|
-
LabelRenderer: PropTypes.
|
|
63
|
+
LabelRenderer: PropTypes.elementType,
|
|
64
|
+
RightSlot: PropTypes.elementType
|
|
65
65
|
};
|
|
66
66
|
export default ComplexAttribute;
|
|
@@ -47,7 +47,7 @@ var TimestampEditor = function (_a) {
|
|
|
47
47
|
views: ['year', 'date', 'hours', 'minutes', 'seconds'], autoOk: true, InputAdornmentProps: { position: 'end' }, KeyboardButtonProps: {
|
|
48
48
|
classes: { root: styles.iconButtonRoot },
|
|
49
49
|
onKeyPress: invoker(0, 'stopPropagation')
|
|
50
|
-
}, keyboardIcon: React.createElement(DateRangeIcon, null), onChange: when(utils.dates.isValidMomentDateOrNull, pipe(utils.dates.momentToDate, onChange)), label: label, "aria-label": label, value: value, placeholder: i18n.text((dateFormat + " HH:MM").toUpperCase()), ampm:
|
|
50
|
+
}, keyboardIcon: React.createElement(DateRangeIcon, null), onChange: when(utils.dates.isValidMomentDateOrNull, pipe(utils.dates.momentToDate, onChange)), label: label, "aria-label": label, value: value, placeholder: i18n.text((dateFormat + " HH:MM").toUpperCase()), ampm: isAmPmFormat, onClose: function () { return setIsCalendarOpen(false); }, onOpen: function () { return setIsCalendarOpen(true); }, InputProps: __assign({ classes: {
|
|
51
51
|
root: styles.inputRoot,
|
|
52
52
|
underline: classnames((_b = {}, _b[styles.underline] = isCalendarOpen, _b)),
|
|
53
53
|
adornedEnd: styles.adornedEnd
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1246",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1246",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1246",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|