@reltio/components 1.4.1857 → 1.4.1859

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.
@@ -68,7 +68,7 @@ var TextFieldWithMentions = function (_a) {
68
68
  })));
69
69
  };
70
70
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, className) },
71
- react_1.default.createElement(react_mentions_1.MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: MENTIONS_TEXTAREA_CLASSNAME, suggestionsPortalHost: document.body, classNames: (_b = {},
71
+ react_1.default.createElement(react_mentions_1.MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: MENTIONS_TEXTAREA_CLASSNAME, suggestionsPortalHost: document.body, allowSuggestionsAboveCursor: true, classNames: (_b = {},
72
72
  _b["".concat(MENTIONS_TEXTAREA_CLASSNAME, "__input")] = styles.mentionsInput,
73
73
  _b["".concat(MENTIONS_TEXTAREA_CLASSNAME, "__highlighter")] = styles.mentionsHighlighter,
74
74
  _b["".concat(MENTIONS_TEXTAREA_CLASSNAME, "__control")] = styles.mentionsControl,
@@ -34,8 +34,7 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
34
34
  zIndex: suggestionsZIndex + '!important',
35
35
  borderRadius: '4px',
36
36
  backgroundColor: '#fafafa !important',
37
- boxShadow: '0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)',
38
- transform: 'translateY(-100%)'
37
+ boxShadow: '0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)'
39
38
  },
40
39
  mentionsSuggestionsList: {
41
40
  maxHeight: '200px',
@@ -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;
@@ -115,7 +115,7 @@ var SaveSegmentDialog = function (_a) {
115
115
  }
116
116
  }, [isOpen, data]);
117
117
  return (react_1.default.createElement(Dialog_1.default, { onClose: onClose, open: isOpen, PaperProps: { classes: { root: styles.root } } },
118
- react_1.default.createElement(DialogTitle_1.default, null, shouldSaveAsNew ? ui_i18n_1.default.text('Save as new segment') : ui_i18n_1.default.text('Save segment')),
118
+ react_1.default.createElement(DialogTitle_1.default, null, shouldSaveAsNew ? ui_i18n_1.default.text('Save as a new segment') : ui_i18n_1.default.text('Save segment')),
119
119
  react_1.default.createElement(DialogContent_1.default, { className: styles.dialogContent },
120
120
  react_1.default.createElement(TextEditor_1.TextEditor, { label: ui_i18n_1.default.text('Name'), required: true, variant: "filled", onInput: handleChangeName, value: name, size: "small", autoFocus: true }),
121
121
  react_1.default.createElement(TextEditor_1.TextEditor, { label: ui_i18n_1.default.text('Description (optional)'), multiline: true, variant: "filled", value: description, onInput: handleChangeDescription, size: "small", rows: 5 }),
@@ -39,7 +39,7 @@ export var TextFieldWithMentions = function (_a) {
39
39
  })));
40
40
  };
41
41
  return (React.createElement("div", { className: classnames(styles.root, className) },
42
- React.createElement(MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: MENTIONS_TEXTAREA_CLASSNAME, suggestionsPortalHost: document.body, classNames: (_b = {},
42
+ React.createElement(MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: MENTIONS_TEXTAREA_CLASSNAME, suggestionsPortalHost: document.body, allowSuggestionsAboveCursor: true, classNames: (_b = {},
43
43
  _b["".concat(MENTIONS_TEXTAREA_CLASSNAME, "__input")] = styles.mentionsInput,
44
44
  _b["".concat(MENTIONS_TEXTAREA_CLASSNAME, "__highlighter")] = styles.mentionsHighlighter,
45
45
  _b["".concat(MENTIONS_TEXTAREA_CLASSNAME, "__control")] = styles.mentionsControl,
@@ -31,8 +31,7 @@ export var useStyles = makeStyles(function (theme) { return ({
31
31
  zIndex: suggestionsZIndex + '!important',
32
32
  borderRadius: '4px',
33
33
  backgroundColor: '#fafafa !important',
34
- boxShadow: '0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)',
35
- transform: 'translateY(-100%)'
34
+ boxShadow: '0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)'
36
35
  },
37
36
  mentionsSuggestionsList: {
38
37
  maxHeight: '200px',
@@ -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;
@@ -86,7 +86,7 @@ export var SaveSegmentDialog = function (_a) {
86
86
  }
87
87
  }, [isOpen, data]);
88
88
  return (React.createElement(Dialog, { onClose: onClose, open: isOpen, PaperProps: { classes: { root: styles.root } } },
89
- React.createElement(DialogTitle, null, shouldSaveAsNew ? i18n.text('Save as new segment') : i18n.text('Save segment')),
89
+ React.createElement(DialogTitle, null, shouldSaveAsNew ? i18n.text('Save as a new segment') : i18n.text('Save segment')),
90
90
  React.createElement(DialogContent, { className: styles.dialogContent },
91
91
  React.createElement(TextEditor, { label: i18n.text('Name'), required: true, variant: "filled", onInput: handleChangeName, value: name, size: "small", autoFocus: true }),
92
92
  React.createElement(TextEditor, { label: i18n.text('Description (optional)'), multiline: true, variant: "filled", value: description, onInput: handleChangeDescription, size: "small", rows: 5 }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1857",
3
+ "version": "1.4.1859",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",