@reltio/components 1.4.1836 → 1.4.1838

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.
Files changed (23) hide show
  1. package/cjs/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
  2. package/cjs/CollaborationItem/components/RepliedComment/styles.d.ts +1 -1
  3. package/cjs/CollaborationItem/components/RepliedComment/styles.js +3 -0
  4. package/cjs/CollaborationItem/components/SendMessageArea/styles.js +1 -1
  5. package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.d.ts +1 -1
  6. package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.js +9 -7
  7. package/cjs/CollaborationItem/components/TextFieldWithMentions/constants.d.ts +1 -0
  8. package/cjs/CollaborationItem/components/TextFieldWithMentions/constants.js +4 -0
  9. package/cjs/CollaborationItem/components/TextFieldWithMentions/styles.d.ts +5 -1
  10. package/cjs/CollaborationItem/components/TextFieldWithMentions/styles.js +58 -48
  11. package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +62 -36
  12. package/esm/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
  13. package/esm/CollaborationItem/components/RepliedComment/styles.d.ts +1 -1
  14. package/esm/CollaborationItem/components/RepliedComment/styles.js +3 -0
  15. package/esm/CollaborationItem/components/SendMessageArea/styles.js +1 -1
  16. package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.d.ts +1 -1
  17. package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.js +9 -7
  18. package/esm/CollaborationItem/components/TextFieldWithMentions/constants.d.ts +1 -0
  19. package/esm/CollaborationItem/components/TextFieldWithMentions/constants.js +1 -0
  20. package/esm/CollaborationItem/components/TextFieldWithMentions/styles.d.ts +5 -1
  21. package/esm/CollaborationItem/components/TextFieldWithMentions/styles.js +58 -48
  22. package/esm/ReadOnlyAttributesView/ReadOnlyAttributesView.test.js +62 -36
  23. package/package.json +2 -2
@@ -68,7 +68,7 @@ var RepliedComment = function (_a) {
68
68
  var sendMessageArea = (react_1.default.createElement(SendMessageArea_1.SendMessageArea, { inputRef: inputRef, popperRef: popperRef, uri: uri, onCancel: function () { return updateIsEditingReply(false); }, isEditingReply: isEditing, reply: reply, comment: comment }));
69
69
  return (react_1.default.createElement(Box_1.default, { className: (0, classnames_1.default)(styles.root, className) },
70
70
  react_1.default.createElement(Avatar_1.Avatar, { classes: { root: styles.avatar } }, createdBy),
71
- react_1.default.createElement(Box_1.default, { flexGrow: 1 },
71
+ react_1.default.createElement(Box_1.default, { className: styles.replyArea },
72
72
  react_1.default.createElement(Box_1.default, { className: styles.header },
73
73
  react_1.default.createElement(Typography_1.default, { className: styles.username }, createdBy),
74
74
  action === 'resolve' && (react_1.default.createElement(Typography_1.default, { className: styles.marked }, ui_i18n_1.default.text('Marked as resolved'))),
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "marked">;
1
+ export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "replyArea" | "marked">;
@@ -12,6 +12,9 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
12
12
  avatar: {
13
13
  marginRight: '8px'
14
14
  },
15
+ replyArea: {
16
+ width: 'calc(100% - 60px)'
17
+ },
15
18
  header: {
16
19
  display: 'flex',
17
20
  marginBottom: '8px'
@@ -14,7 +14,7 @@ exports.useStyles = (0, styles_1.makeStyles)({
14
14
  textField: function (_a) {
15
15
  var isEditing = _a.isEditing;
16
16
  return ({
17
- maxWidth: isEditing ? '100%' : 'calc(100% - 40px)'
17
+ width: isEditing ? '100%' : 'calc(100% - 40px)'
18
18
  });
19
19
  },
20
20
  form: {
@@ -2,5 +2,5 @@ import { MentionsInputProps } from 'react-mentions';
2
2
  type Props = Omit<MentionsInputProps, 'children' | 'onChange'> & {
3
3
  onChange?: (value: string, plainTextValue: string, mentions: string[]) => void;
4
4
  };
5
- export declare const TextFieldWithMentions: ({ onChange, className, ...props }: Props) => JSX.Element;
5
+ export declare const TextFieldWithMentions: ({ onChange, className, value, placeholder, ...props }: Props) => JSX.Element;
6
6
  export {};
@@ -55,9 +55,10 @@ var ramda_1 = require("ramda");
55
55
  var react_mentions_1 = require("react-mentions");
56
56
  var UsersContext_1 = require("../../../contexts/UsersContext");
57
57
  var styles_1 = require("./styles");
58
+ var constants_1 = require("./constants");
58
59
  var TextFieldWithMentions = function (_a) {
59
- var onChange = _a.onChange, className = _a.className, props = __rest(_a, ["onChange", "className"]);
60
- var styles = (0, styles_1.useStyles)();
60
+ var onChange = _a.onChange, className = _a.className, value = _a.value, placeholder = _a.placeholder, props = __rest(_a, ["onChange", "className", "value", "placeholder"]);
61
+ var styles = (0, styles_1.useStyles)({ placeholder: value ? '' : placeholder });
61
62
  var users = (0, react_1.useContext)(UsersContext_1.UsersContext);
62
63
  var handleChange = function (_, value, plainTextValue, mentions) {
63
64
  onChange(value, plainTextValue, (0, ramda_1.uniq)(mentions.map(function (_a) {
@@ -65,10 +66,11 @@ var TextFieldWithMentions = function (_a) {
65
66
  return display.slice(1);
66
67
  })));
67
68
  };
68
- return (react_1.default.createElement(react_mentions_1.MentionsInput, __assign({}, props, { onChange: handleChange, className: (0, classnames_1.default)(styles.root, className), suggestionsPortalHost: document.body }),
69
- react_1.default.createElement(react_mentions_1.Mention, { trigger: "+", data: users.map(function (_a) {
70
- var username = _a.username;
71
- return ({ id: username, display: username });
72
- }), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention })));
69
+ return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, className) },
70
+ react_1.default.createElement(react_mentions_1.MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: (0, classnames_1.default)(constants_1.MENTIONS_TEXTAREA_CLASSNAME), suggestionsPortalHost: document.body }),
71
+ react_1.default.createElement(react_mentions_1.Mention, { trigger: "+", data: users.map(function (_a) {
72
+ var username = _a.username;
73
+ return ({ id: username, display: username });
74
+ }), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention }))));
73
75
  };
74
76
  exports.TextFieldWithMentions = TextFieldWithMentions;
@@ -0,0 +1 @@
1
+ export declare const MENTIONS_TEXTAREA_CLASSNAME = "mentionsTextArea";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MENTIONS_TEXTAREA_CLASSNAME = void 0;
4
+ exports.MENTIONS_TEXTAREA_CLASSNAME = 'mentionsTextArea';
@@ -1 +1,5 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "mention">;
1
+ type StylesProps = {
2
+ placeholder?: string;
3
+ };
4
+ export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"root" | "mention">;
5
+ export {};
@@ -3,53 +3,63 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useStyles = void 0;
4
4
  var styles_1 = require("@mui/styles");
5
5
  var constants_1 = require("../../../constants");
6
+ var constants_2 = require("./constants");
6
7
  var suggestionsZIndex = constants_1.POPUP_Z_INDEX + 1;
7
- exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
8
- root: {
9
- width: '100%',
10
- backgroundColor: '#fff',
11
- fontFamily: 'Roboto',
12
- '&__control': {
13
- fontSize: '13px'
14
- },
15
- '&__highlighter': {
16
- padding: '10px 22px',
17
- border: '1px solid transparent !important'
18
- },
19
- '&__input': {
20
- borderRadius: '2px',
21
- border: '1px solid rgba(0,0,0,0.12)',
22
- padding: '10px 22px',
23
- outline: 0,
24
- overflow: 'auto !important'
25
- },
26
- '&__suggestions': {
27
- padding: '8px 0',
28
- zIndex: suggestionsZIndex + '!important',
29
- borderRadius: '4px',
30
- backgroundColor: '#fafafa !important',
31
- 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)',
32
- transform: 'translateY(-100%)'
33
- },
34
- '&__suggestions__list': {
35
- maxHeight: '200px',
36
- overflowY: 'scroll'
37
- },
38
- '&__suggestions__item': {
39
- padding: '6px 12px',
40
- color: theme.palette.text.primary,
41
- fontSize: '13px',
42
- transition: theme.transitions.create(['background-color']),
43
- '&:hover, &--focused': {
44
- backgroundColor: 'rgba(0,0,0,0.04)'
45
- }
8
+ exports.useStyles = (0, styles_1.makeStyles)(function (theme) {
9
+ var _a;
10
+ return ({
11
+ root: (_a = {
12
+ backgroundColor: '#fff',
13
+ fontFamily: 'Roboto'
14
+ },
15
+ _a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__control")] = {
16
+ fontSize: '13px'
17
+ },
18
+ _a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__highlighter")] = {
19
+ padding: '10px 22px',
20
+ border: '1px solid transparent !important',
21
+ '&::before': {
22
+ content: function (_a) {
23
+ var placeholder = _a.placeholder;
24
+ return placeholder && "\"".concat(placeholder, "\"");
25
+ }
26
+ }
27
+ },
28
+ _a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__input")] = {
29
+ borderRadius: '2px',
30
+ border: '1px solid rgba(0,0,0,0.12)',
31
+ padding: '10px 22px',
32
+ outline: 0,
33
+ overflow: 'auto !important'
34
+ },
35
+ _a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__suggestions")] = {
36
+ padding: '8px 0',
37
+ zIndex: suggestionsZIndex + '!important',
38
+ borderRadius: '4px',
39
+ backgroundColor: '#fafafa !important',
40
+ 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)',
41
+ transform: 'translateY(-100%)'
42
+ },
43
+ _a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__list")] = {
44
+ maxHeight: '200px',
45
+ overflowY: 'scroll'
46
+ },
47
+ _a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__item")] = {
48
+ padding: '6px 12px',
49
+ color: theme.palette.text.primary,
50
+ fontSize: '13px',
51
+ transition: theme.transitions.create(['background-color']),
52
+ '&:hover, &--focused': {
53
+ backgroundColor: 'rgba(0,0,0,0.04)'
54
+ }
55
+ },
56
+ _a),
57
+ mention: {
58
+ position: 'relative',
59
+ zIndex: 1,
60
+ color: theme.palette.primary.main,
61
+ textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
62
+ pointerEvents: 'none'
46
63
  }
47
- },
48
- mention: {
49
- position: 'relative',
50
- zIndex: 1,
51
- color: theme.palette.primary.main,
52
- textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
53
- pointerEvents: 'none'
54
- }
55
- }); });
64
+ });
65
+ });
@@ -258,9 +258,7 @@ describe('ReadOnlyAttributesView tests', function () {
258
258
  type: 'Dynamic',
259
259
  controlFunction: {
260
260
  expression: "listEquals(attributes.Category1.value, 'category1_value1')",
261
- showAttributeURI: [
262
- 'configuration/entityTypes/HCP/attributes/Category2'
263
- ]
261
+ showAttributeURI: ['configuration/entityTypes/HCP/attributes/Category2']
264
262
  }
265
263
  },
266
264
  {
@@ -271,9 +269,7 @@ describe('ReadOnlyAttributesView tests', function () {
271
269
  type: 'Dynamic',
272
270
  controlFunction: {
273
271
  expression: "listEquals(attributes.Category1.value, 'category1_value2')",
274
- showAttributeURI: [
275
- 'configuration/entityTypes/HCP/attributes/Category4'
276
- ]
272
+ showAttributeURI: ['configuration/entityTypes/HCP/attributes/Category4']
277
273
  }
278
274
  }
279
275
  ]
@@ -291,18 +287,30 @@ describe('ReadOnlyAttributesView tests', function () {
291
287
  type: 'configuration/entityTypes/HCP',
292
288
  uri: 'entities/uri_e',
293
289
  attributes: {
294
- Category1: [{
295
- uri: 'entities/uri_e/attributes/uri1', value: 'category1_value1_diff'
296
- }],
297
- Category2: [{
298
- uri: 'entities/uri_e/attributes/uri2', value: 'category2_value1_diff'
299
- }],
300
- Category3: [{
301
- uri: 'entities/uri_e/attributes/uri3', value: 'category3_value1'
302
- }],
303
- Category4: [{
304
- uri: 'entities/uri_e/attributes/uri4', value: 'category4_value1'
305
- }]
290
+ Category1: [
291
+ {
292
+ uri: 'entities/uri_e/attributes/uri1',
293
+ value: 'category1_value1_diff'
294
+ }
295
+ ],
296
+ Category2: [
297
+ {
298
+ uri: 'entities/uri_e/attributes/uri2',
299
+ value: 'category2_value1_diff'
300
+ }
301
+ ],
302
+ Category3: [
303
+ {
304
+ uri: 'entities/uri_e/attributes/uri3',
305
+ value: 'category3_value1'
306
+ }
307
+ ],
308
+ Category4: [
309
+ {
310
+ uri: 'entities/uri_e/attributes/uri4',
311
+ value: 'category4_value1'
312
+ }
313
+ ]
306
314
  }
307
315
  };
308
316
  setUp({ entity: entity });
@@ -316,18 +324,30 @@ describe('ReadOnlyAttributesView tests', function () {
316
324
  type: 'configuration/entityTypes/HCP',
317
325
  uri: 'entities/uri_e',
318
326
  attributes: {
319
- Category1: [{
320
- uri: 'entities/uri_e/attributes/uri1', value: 'category1_value1'
321
- }],
322
- Category2: [{
323
- uri: 'entities/uri_e/attributes/uri2', value: 'category2_value1'
324
- }],
325
- Category3: [{
326
- uri: 'entities/uri_e/attributes/uri3', value: 'category3_value1'
327
- }],
328
- Category4: [{
329
- uri: 'entities/uri_e/attributes/uri4', value: 'category4_value1'
330
- }]
327
+ Category1: [
328
+ {
329
+ uri: 'entities/uri_e/attributes/uri1',
330
+ value: 'category1_value1'
331
+ }
332
+ ],
333
+ Category2: [
334
+ {
335
+ uri: 'entities/uri_e/attributes/uri2',
336
+ value: 'category2_value1'
337
+ }
338
+ ],
339
+ Category3: [
340
+ {
341
+ uri: 'entities/uri_e/attributes/uri3',
342
+ value: 'category3_value1'
343
+ }
344
+ ],
345
+ Category4: [
346
+ {
347
+ uri: 'entities/uri_e/attributes/uri4',
348
+ value: 'category4_value1'
349
+ }
350
+ ]
331
351
  }
332
352
  };
333
353
  setUp({ entity: entity });
@@ -341,12 +361,18 @@ describe('ReadOnlyAttributesView tests', function () {
341
361
  type: 'configuration/entityTypes/HCP',
342
362
  uri: 'entities/uri_e',
343
363
  attributes: {
344
- Category1: [{
345
- uri: 'entities/uri_e/attributes/uri1', value: 'category1_value2'
346
- }],
347
- Category4: [{
348
- uri: 'entities/uri_e/attributes/uri4', value: 'category4_value1'
349
- }]
364
+ Category1: [
365
+ {
366
+ uri: 'entities/uri_e/attributes/uri1',
367
+ value: 'category1_value2'
368
+ }
369
+ ],
370
+ Category4: [
371
+ {
372
+ uri: 'entities/uri_e/attributes/uri4',
373
+ value: 'category4_value1'
374
+ }
375
+ ]
350
376
  }
351
377
  };
352
378
  setUp({ entity: entity });
@@ -39,7 +39,7 @@ export var RepliedComment = function (_a) {
39
39
  var sendMessageArea = (React.createElement(SendMessageArea, { inputRef: inputRef, popperRef: popperRef, uri: uri, onCancel: function () { return updateIsEditingReply(false); }, isEditingReply: isEditing, reply: reply, comment: comment }));
40
40
  return (React.createElement(Box, { className: classnames(styles.root, className) },
41
41
  React.createElement(Avatar, { classes: { root: styles.avatar } }, createdBy),
42
- React.createElement(Box, { flexGrow: 1 },
42
+ React.createElement(Box, { className: styles.replyArea },
43
43
  React.createElement(Box, { className: styles.header },
44
44
  React.createElement(Typography, { className: styles.username }, createdBy),
45
45
  action === 'resolve' && (React.createElement(Typography, { className: styles.marked }, i18n.text('Marked as resolved'))),
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "marked">;
1
+ export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "replyArea" | "marked">;
@@ -9,6 +9,9 @@ export var useStyles = makeStyles(function (theme) { return ({
9
9
  avatar: {
10
10
  marginRight: '8px'
11
11
  },
12
+ replyArea: {
13
+ width: 'calc(100% - 60px)'
14
+ },
12
15
  header: {
13
16
  display: 'flex',
14
17
  marginBottom: '8px'
@@ -11,7 +11,7 @@ export var useStyles = makeStyles({
11
11
  textField: function (_a) {
12
12
  var isEditing = _a.isEditing;
13
13
  return ({
14
- maxWidth: isEditing ? '100%' : 'calc(100% - 40px)'
14
+ width: isEditing ? '100%' : 'calc(100% - 40px)'
15
15
  });
16
16
  },
17
17
  form: {
@@ -2,5 +2,5 @@ import { MentionsInputProps } from 'react-mentions';
2
2
  type Props = Omit<MentionsInputProps, 'children' | 'onChange'> & {
3
3
  onChange?: (value: string, plainTextValue: string, mentions: string[]) => void;
4
4
  };
5
- export declare const TextFieldWithMentions: ({ onChange, className, ...props }: Props) => JSX.Element;
5
+ export declare const TextFieldWithMentions: ({ onChange, className, value, placeholder, ...props }: Props) => JSX.Element;
6
6
  export {};
@@ -26,9 +26,10 @@ import { uniq } from 'ramda';
26
26
  import { MentionsInput, Mention } from 'react-mentions';
27
27
  import { UsersContext } from '../../../contexts/UsersContext';
28
28
  import { useStyles } from './styles';
29
+ import { MENTIONS_TEXTAREA_CLASSNAME } from './constants';
29
30
  export var TextFieldWithMentions = function (_a) {
30
- var onChange = _a.onChange, className = _a.className, props = __rest(_a, ["onChange", "className"]);
31
- var styles = useStyles();
31
+ var onChange = _a.onChange, className = _a.className, value = _a.value, placeholder = _a.placeholder, props = __rest(_a, ["onChange", "className", "value", "placeholder"]);
32
+ var styles = useStyles({ placeholder: value ? '' : placeholder });
32
33
  var users = useContext(UsersContext);
33
34
  var handleChange = function (_, value, plainTextValue, mentions) {
34
35
  onChange(value, plainTextValue, uniq(mentions.map(function (_a) {
@@ -36,9 +37,10 @@ export var TextFieldWithMentions = function (_a) {
36
37
  return display.slice(1);
37
38
  })));
38
39
  };
39
- return (React.createElement(MentionsInput, __assign({}, props, { onChange: handleChange, className: classnames(styles.root, className), suggestionsPortalHost: document.body }),
40
- React.createElement(Mention, { trigger: "+", data: users.map(function (_a) {
41
- var username = _a.username;
42
- return ({ id: username, display: username });
43
- }), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention })));
40
+ return (React.createElement("div", { className: classnames(styles.root, className) },
41
+ React.createElement(MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: classnames(MENTIONS_TEXTAREA_CLASSNAME), suggestionsPortalHost: document.body }),
42
+ React.createElement(Mention, { trigger: "+", data: users.map(function (_a) {
43
+ var username = _a.username;
44
+ return ({ id: username, display: username });
45
+ }), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention }))));
44
46
  };
@@ -0,0 +1 @@
1
+ export declare const MENTIONS_TEXTAREA_CLASSNAME = "mentionsTextArea";
@@ -0,0 +1 @@
1
+ export var MENTIONS_TEXTAREA_CLASSNAME = 'mentionsTextArea';
@@ -1 +1,5 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "mention">;
1
+ type StylesProps = {
2
+ placeholder?: string;
3
+ };
4
+ export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"root" | "mention">;
5
+ export {};
@@ -1,52 +1,62 @@
1
1
  import { makeStyles } from '@mui/styles';
2
2
  import { POPUP_Z_INDEX } from '../../../constants';
3
+ import { MENTIONS_TEXTAREA_CLASSNAME } from './constants';
3
4
  var suggestionsZIndex = POPUP_Z_INDEX + 1;
4
- export var useStyles = makeStyles(function (theme) { return ({
5
- root: {
6
- width: '100%',
7
- backgroundColor: '#fff',
8
- fontFamily: 'Roboto',
9
- '&__control': {
10
- fontSize: '13px'
11
- },
12
- '&__highlighter': {
13
- padding: '10px 22px',
14
- border: '1px solid transparent !important'
15
- },
16
- '&__input': {
17
- borderRadius: '2px',
18
- border: '1px solid rgba(0,0,0,0.12)',
19
- padding: '10px 22px',
20
- outline: 0,
21
- overflow: 'auto !important'
22
- },
23
- '&__suggestions': {
24
- padding: '8px 0',
25
- zIndex: suggestionsZIndex + '!important',
26
- borderRadius: '4px',
27
- backgroundColor: '#fafafa !important',
28
- 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)',
29
- transform: 'translateY(-100%)'
30
- },
31
- '&__suggestions__list': {
32
- maxHeight: '200px',
33
- overflowY: 'scroll'
34
- },
35
- '&__suggestions__item': {
36
- padding: '6px 12px',
37
- color: theme.palette.text.primary,
38
- fontSize: '13px',
39
- transition: theme.transitions.create(['background-color']),
40
- '&:hover, &--focused': {
41
- backgroundColor: 'rgba(0,0,0,0.04)'
42
- }
5
+ export var useStyles = makeStyles(function (theme) {
6
+ var _a;
7
+ return ({
8
+ root: (_a = {
9
+ backgroundColor: '#fff',
10
+ fontFamily: 'Roboto'
11
+ },
12
+ _a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__control")] = {
13
+ fontSize: '13px'
14
+ },
15
+ _a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__highlighter")] = {
16
+ padding: '10px 22px',
17
+ border: '1px solid transparent !important',
18
+ '&::before': {
19
+ content: function (_a) {
20
+ var placeholder = _a.placeholder;
21
+ return placeholder && "\"".concat(placeholder, "\"");
22
+ }
23
+ }
24
+ },
25
+ _a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__input")] = {
26
+ borderRadius: '2px',
27
+ border: '1px solid rgba(0,0,0,0.12)',
28
+ padding: '10px 22px',
29
+ outline: 0,
30
+ overflow: 'auto !important'
31
+ },
32
+ _a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__suggestions")] = {
33
+ padding: '8px 0',
34
+ zIndex: suggestionsZIndex + '!important',
35
+ borderRadius: '4px',
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%)'
39
+ },
40
+ _a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__list")] = {
41
+ maxHeight: '200px',
42
+ overflowY: 'scroll'
43
+ },
44
+ _a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__item")] = {
45
+ padding: '6px 12px',
46
+ color: theme.palette.text.primary,
47
+ fontSize: '13px',
48
+ transition: theme.transitions.create(['background-color']),
49
+ '&:hover, &--focused': {
50
+ backgroundColor: 'rgba(0,0,0,0.04)'
51
+ }
52
+ },
53
+ _a),
54
+ mention: {
55
+ position: 'relative',
56
+ zIndex: 1,
57
+ color: theme.palette.primary.main,
58
+ textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
59
+ pointerEvents: 'none'
43
60
  }
44
- },
45
- mention: {
46
- position: 'relative',
47
- zIndex: 1,
48
- color: theme.palette.primary.main,
49
- textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
50
- pointerEvents: 'none'
51
- }
52
- }); });
61
+ });
62
+ });
@@ -253,9 +253,7 @@ describe('ReadOnlyAttributesView tests', function () {
253
253
  type: 'Dynamic',
254
254
  controlFunction: {
255
255
  expression: "listEquals(attributes.Category1.value, 'category1_value1')",
256
- showAttributeURI: [
257
- 'configuration/entityTypes/HCP/attributes/Category2'
258
- ]
256
+ showAttributeURI: ['configuration/entityTypes/HCP/attributes/Category2']
259
257
  }
260
258
  },
261
259
  {
@@ -266,9 +264,7 @@ describe('ReadOnlyAttributesView tests', function () {
266
264
  type: 'Dynamic',
267
265
  controlFunction: {
268
266
  expression: "listEquals(attributes.Category1.value, 'category1_value2')",
269
- showAttributeURI: [
270
- 'configuration/entityTypes/HCP/attributes/Category4'
271
- ]
267
+ showAttributeURI: ['configuration/entityTypes/HCP/attributes/Category4']
272
268
  }
273
269
  }
274
270
  ]
@@ -286,18 +282,30 @@ describe('ReadOnlyAttributesView tests', function () {
286
282
  type: 'configuration/entityTypes/HCP',
287
283
  uri: 'entities/uri_e',
288
284
  attributes: {
289
- Category1: [{
290
- uri: 'entities/uri_e/attributes/uri1', value: 'category1_value1_diff'
291
- }],
292
- Category2: [{
293
- uri: 'entities/uri_e/attributes/uri2', value: 'category2_value1_diff'
294
- }],
295
- Category3: [{
296
- uri: 'entities/uri_e/attributes/uri3', value: 'category3_value1'
297
- }],
298
- Category4: [{
299
- uri: 'entities/uri_e/attributes/uri4', value: 'category4_value1'
300
- }]
285
+ Category1: [
286
+ {
287
+ uri: 'entities/uri_e/attributes/uri1',
288
+ value: 'category1_value1_diff'
289
+ }
290
+ ],
291
+ Category2: [
292
+ {
293
+ uri: 'entities/uri_e/attributes/uri2',
294
+ value: 'category2_value1_diff'
295
+ }
296
+ ],
297
+ Category3: [
298
+ {
299
+ uri: 'entities/uri_e/attributes/uri3',
300
+ value: 'category3_value1'
301
+ }
302
+ ],
303
+ Category4: [
304
+ {
305
+ uri: 'entities/uri_e/attributes/uri4',
306
+ value: 'category4_value1'
307
+ }
308
+ ]
301
309
  }
302
310
  };
303
311
  setUp({ entity: entity });
@@ -311,18 +319,30 @@ describe('ReadOnlyAttributesView tests', function () {
311
319
  type: 'configuration/entityTypes/HCP',
312
320
  uri: 'entities/uri_e',
313
321
  attributes: {
314
- Category1: [{
315
- uri: 'entities/uri_e/attributes/uri1', value: 'category1_value1'
316
- }],
317
- Category2: [{
318
- uri: 'entities/uri_e/attributes/uri2', value: 'category2_value1'
319
- }],
320
- Category3: [{
321
- uri: 'entities/uri_e/attributes/uri3', value: 'category3_value1'
322
- }],
323
- Category4: [{
324
- uri: 'entities/uri_e/attributes/uri4', value: 'category4_value1'
325
- }]
322
+ Category1: [
323
+ {
324
+ uri: 'entities/uri_e/attributes/uri1',
325
+ value: 'category1_value1'
326
+ }
327
+ ],
328
+ Category2: [
329
+ {
330
+ uri: 'entities/uri_e/attributes/uri2',
331
+ value: 'category2_value1'
332
+ }
333
+ ],
334
+ Category3: [
335
+ {
336
+ uri: 'entities/uri_e/attributes/uri3',
337
+ value: 'category3_value1'
338
+ }
339
+ ],
340
+ Category4: [
341
+ {
342
+ uri: 'entities/uri_e/attributes/uri4',
343
+ value: 'category4_value1'
344
+ }
345
+ ]
326
346
  }
327
347
  };
328
348
  setUp({ entity: entity });
@@ -336,12 +356,18 @@ describe('ReadOnlyAttributesView tests', function () {
336
356
  type: 'configuration/entityTypes/HCP',
337
357
  uri: 'entities/uri_e',
338
358
  attributes: {
339
- Category1: [{
340
- uri: 'entities/uri_e/attributes/uri1', value: 'category1_value2'
341
- }],
342
- Category4: [{
343
- uri: 'entities/uri_e/attributes/uri4', value: 'category4_value1'
344
- }]
359
+ Category1: [
360
+ {
361
+ uri: 'entities/uri_e/attributes/uri1',
362
+ value: 'category1_value2'
363
+ }
364
+ ],
365
+ Category4: [
366
+ {
367
+ uri: 'entities/uri_e/attributes/uri4',
368
+ value: 'category4_value1'
369
+ }
370
+ ]
345
371
  }
346
372
  };
347
373
  setUp({ entity: entity });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1836",
3
+ "version": "1.4.1838",
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
  "@fluentui/react-context-selector": "^9.1.26",
9
9
  "@react-google-maps/api": "2.7.0",
10
- "@reltio/mdm-sdk": "^1.4.1791",
10
+ "@reltio/mdm-sdk": "^1.4.1792",
11
11
  "classnames": "^2.2.5",
12
12
  "d3-cloud": "^1.2.5",
13
13
  "d3-geo": "^2.0.1",