@reltio/components 1.4.1068 → 1.4.1073

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 (163) hide show
  1. package/cjs/components/AttributeGroupIcon/AttributeGroupIcon.d.ts +11 -0
  2. package/cjs/components/AttributeGroupIcon/AttributeGroupIcon.js +20 -0
  3. package/cjs/components/AttributeGroupIcon/styles.d.ts +1 -0
  4. package/cjs/components/AttributeGroupIcon/styles.js +11 -0
  5. package/cjs/components/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +9 -0
  6. package/cjs/components/AttributesFiltersBuilder/AttributesFiltersBuilder.js +112 -0
  7. package/cjs/components/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.d.ts +9 -0
  8. package/cjs/components/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.js +53 -0
  9. package/cjs/components/AttributesFiltersBuilder/components/FilterSelector/FilterSelector.d.ts +7 -0
  10. package/cjs/components/AttributesFiltersBuilder/components/FilterSelector/FilterSelector.js +56 -0
  11. package/cjs/components/AttributesFiltersBuilder/components/FilterSelector/styles.d.ts +2 -0
  12. package/cjs/components/AttributesFiltersBuilder/components/FilterSelector/styles.js +9 -0
  13. package/cjs/components/AttributesFiltersBuilder/components/RowActions/RowActions.d.ts +4 -0
  14. package/cjs/components/AttributesFiltersBuilder/components/RowActions/RowActions.js +51 -0
  15. package/cjs/components/AttributesFiltersBuilder/components/RowActions/styles.d.ts +1 -0
  16. package/cjs/components/AttributesFiltersBuilder/components/RowActions/styles.js +23 -0
  17. package/cjs/components/AttributesFiltersBuilder/components/ValueEditor/ValueEditor.d.ts +4 -0
  18. package/cjs/components/AttributesFiltersBuilder/components/ValueEditor/ValueEditor.js +60 -0
  19. package/cjs/components/AttributesFiltersBuilder/components/ValueEditor/styles.d.ts +1 -0
  20. package/cjs/components/AttributesFiltersBuilder/components/ValueEditor/styles.js +25 -0
  21. package/cjs/components/AttributesFiltersBuilder/helpers.d.ts +12 -0
  22. package/cjs/components/AttributesFiltersBuilder/helpers.js +77 -0
  23. package/cjs/components/AttributesFiltersBuilder/styles.d.ts +1 -0
  24. package/cjs/components/AttributesFiltersBuilder/styles.js +21 -0
  25. package/cjs/components/AttributesFiltersBuilder/types.d.ts +24 -0
  26. package/cjs/components/AttributesFiltersBuilder/types.js +2 -0
  27. package/cjs/components/AttributesFiltersButton/ActionButtons/ActionButtons.d.ts +8 -0
  28. package/cjs/components/AttributesFiltersButton/ActionButtons/ActionButtons.js +18 -0
  29. package/cjs/components/AttributesFiltersButton/ActionButtons/styles.d.ts +1 -0
  30. package/cjs/components/AttributesFiltersButton/ActionButtons/styles.js +26 -0
  31. package/cjs/components/AttributesFiltersButton/AttributesFiltersButton.d.ts +9 -0
  32. package/cjs/components/AttributesFiltersButton/AttributesFiltersButton.js +82 -0
  33. package/cjs/components/AttributesFiltersButton/styles.d.ts +1 -0
  34. package/cjs/components/AttributesFiltersButton/styles.js +30 -0
  35. package/cjs/components/BasicAttributeSelector/AttributeTitle/AttributeTitle.d.ts +14 -0
  36. package/cjs/components/BasicAttributeSelector/AttributeTitle/AttributeTitle.js +27 -0
  37. package/cjs/components/BasicAttributeSelector/AttributeTitle/styles.d.ts +2 -0
  38. package/cjs/components/BasicAttributeSelector/AttributeTitle/styles.js +44 -0
  39. package/cjs/components/BasicAttributeSelector/BasicAttributeSelector.d.ts +4 -0
  40. package/cjs/components/BasicAttributeSelector/BasicAttributeSelector.js +99 -0
  41. package/cjs/components/BasicAttributeSelector/helpers.d.ts +22 -0
  42. package/cjs/components/BasicAttributeSelector/helpers.js +80 -0
  43. package/cjs/components/BasicAttributeSelector/styles.d.ts +2 -0
  44. package/cjs/components/BasicAttributeSelector/styles.js +14 -0
  45. package/cjs/components/ConnectionEditor/ConnectionEditor.d.ts +12 -3
  46. package/cjs/components/ConnectionEditor/ConnectionEditor.js +72 -5
  47. package/cjs/components/ConnectionEditor/styles.d.ts +1 -0
  48. package/cjs/components/ConnectionEditor/styles.js +12 -0
  49. package/cjs/components/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +3 -2
  50. package/cjs/components/Image/ImageActionsOverlay/styles.d.ts +1 -1
  51. package/cjs/components/ImageDetailsView/MetaInfoForm/styles.d.ts +1 -1
  52. package/cjs/components/QueryBuilderRow/QueryBuilderRow.d.ts +2 -2
  53. package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +2 -2
  54. package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +1 -1
  55. package/cjs/components/SelectAttributesList/SelectAttributesList.d.ts +14 -0
  56. package/cjs/components/SelectAttributesList/SelectAttributesList.js +75 -0
  57. package/cjs/components/SelectAttributesList/styles.d.ts +1 -0
  58. package/cjs/components/SelectAttributesList/styles.js +16 -0
  59. package/cjs/components/SelectionPopup/SelectionPopup.d.ts +1 -1
  60. package/cjs/components/SidePanel/SidePanelContentHeader/SidePanelContentHeader.d.ts +2 -2
  61. package/cjs/components/activityLog/activities/SearchActivity.js +2 -2
  62. package/cjs/components/attributes/editMode/EntitySelector/EntitySelector.d.ts +1 -1
  63. package/cjs/components/attributes/editMode/EntitySelector/EntitySelector.js +13 -6
  64. package/cjs/components/index.d.ts +4 -0
  65. package/cjs/components/index.js +9 -1
  66. package/cjs/components/workflow/hooks/useWorkflowAssignee.d.ts +1 -1
  67. package/cjs/components/workflow/hooks/useWorkflowAssignee.js +2 -2
  68. package/cjs/constants/prop-types.d.ts +1 -1
  69. package/cjs/constants/prop-types.js +1 -1
  70. package/cjs/hooks/index.d.ts +1 -0
  71. package/cjs/hooks/index.js +3 -1
  72. package/cjs/hooks/useEditableConnection.d.ts +10 -4
  73. package/cjs/hooks/useEditableConnection.js +27 -3
  74. package/cjs/hooks/useReadableSearchState.d.ts +2 -0
  75. package/cjs/{components/activityLog/hooks → hooks}/useReadableSearchState.js +0 -0
  76. package/cjs/icons/Duplicate.d.ts +3 -0
  77. package/cjs/icons/Duplicate.js +28 -0
  78. package/cjs/icons/index.d.ts +6 -3
  79. package/cjs/icons/index.js +14 -7
  80. package/cjs/types/index.d.ts +40 -0
  81. package/esm/components/AttributeGroupIcon/AttributeGroupIcon.d.ts +11 -0
  82. package/esm/components/AttributeGroupIcon/AttributeGroupIcon.js +15 -0
  83. package/esm/components/AttributeGroupIcon/styles.d.ts +1 -0
  84. package/esm/components/AttributeGroupIcon/styles.js +8 -0
  85. package/esm/components/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +9 -0
  86. package/esm/components/AttributesFiltersBuilder/AttributesFiltersBuilder.js +88 -0
  87. package/esm/components/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.d.ts +9 -0
  88. package/esm/components/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.js +29 -0
  89. package/esm/components/AttributesFiltersBuilder/components/FilterSelector/FilterSelector.d.ts +7 -0
  90. package/esm/components/AttributesFiltersBuilder/components/FilterSelector/FilterSelector.js +32 -0
  91. package/esm/components/AttributesFiltersBuilder/components/FilterSelector/styles.d.ts +2 -0
  92. package/esm/components/AttributesFiltersBuilder/components/FilterSelector/styles.js +7 -0
  93. package/esm/components/AttributesFiltersBuilder/components/RowActions/RowActions.d.ts +4 -0
  94. package/esm/components/AttributesFiltersBuilder/components/RowActions/RowActions.js +27 -0
  95. package/esm/components/AttributesFiltersBuilder/components/RowActions/styles.d.ts +1 -0
  96. package/esm/components/AttributesFiltersBuilder/components/RowActions/styles.js +20 -0
  97. package/esm/components/AttributesFiltersBuilder/components/ValueEditor/ValueEditor.d.ts +4 -0
  98. package/esm/components/AttributesFiltersBuilder/components/ValueEditor/ValueEditor.js +36 -0
  99. package/esm/components/AttributesFiltersBuilder/components/ValueEditor/styles.d.ts +1 -0
  100. package/esm/components/AttributesFiltersBuilder/components/ValueEditor/styles.js +22 -0
  101. package/esm/components/AttributesFiltersBuilder/helpers.d.ts +12 -0
  102. package/esm/components/AttributesFiltersBuilder/helpers.js +70 -0
  103. package/esm/components/AttributesFiltersBuilder/styles.d.ts +1 -0
  104. package/esm/components/AttributesFiltersBuilder/styles.js +18 -0
  105. package/esm/components/AttributesFiltersBuilder/types.d.ts +24 -0
  106. package/esm/components/AttributesFiltersBuilder/types.js +1 -0
  107. package/esm/components/AttributesFiltersButton/ActionButtons/ActionButtons.d.ts +8 -0
  108. package/esm/components/AttributesFiltersButton/ActionButtons/ActionButtons.js +13 -0
  109. package/esm/components/AttributesFiltersButton/ActionButtons/styles.d.ts +1 -0
  110. package/esm/components/AttributesFiltersButton/ActionButtons/styles.js +23 -0
  111. package/esm/components/AttributesFiltersButton/AttributesFiltersButton.d.ts +9 -0
  112. package/esm/components/AttributesFiltersButton/AttributesFiltersButton.js +58 -0
  113. package/esm/components/AttributesFiltersButton/styles.d.ts +1 -0
  114. package/esm/components/AttributesFiltersButton/styles.js +27 -0
  115. package/esm/components/BasicAttributeSelector/AttributeTitle/AttributeTitle.d.ts +14 -0
  116. package/esm/components/BasicAttributeSelector/AttributeTitle/AttributeTitle.js +22 -0
  117. package/esm/components/BasicAttributeSelector/AttributeTitle/styles.d.ts +2 -0
  118. package/esm/components/BasicAttributeSelector/AttributeTitle/styles.js +42 -0
  119. package/esm/components/BasicAttributeSelector/BasicAttributeSelector.d.ts +4 -0
  120. package/esm/components/BasicAttributeSelector/BasicAttributeSelector.js +75 -0
  121. package/esm/components/BasicAttributeSelector/helpers.d.ts +22 -0
  122. package/esm/components/BasicAttributeSelector/helpers.js +72 -0
  123. package/esm/components/BasicAttributeSelector/styles.d.ts +2 -0
  124. package/esm/components/BasicAttributeSelector/styles.js +12 -0
  125. package/esm/components/ConnectionEditor/ConnectionEditor.d.ts +12 -3
  126. package/esm/components/ConnectionEditor/ConnectionEditor.js +74 -7
  127. package/esm/components/ConnectionEditor/styles.d.ts +1 -0
  128. package/esm/components/ConnectionEditor/styles.js +9 -0
  129. package/esm/components/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +3 -2
  130. package/esm/components/Image/ImageActionsOverlay/styles.d.ts +1 -1
  131. package/esm/components/ImageDetailsView/MetaInfoForm/styles.d.ts +1 -1
  132. package/esm/components/QueryBuilderRow/QueryBuilderRow.d.ts +2 -2
  133. package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +2 -2
  134. package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +1 -1
  135. package/esm/components/SelectAttributesList/SelectAttributesList.d.ts +14 -0
  136. package/esm/components/SelectAttributesList/SelectAttributesList.js +51 -0
  137. package/esm/components/SelectAttributesList/styles.d.ts +1 -0
  138. package/esm/components/SelectAttributesList/styles.js +13 -0
  139. package/esm/components/SelectionPopup/SelectionPopup.d.ts +1 -1
  140. package/esm/components/SidePanel/SidePanelContentHeader/SidePanelContentHeader.d.ts +2 -2
  141. package/esm/components/activityLog/activities/SearchActivity.js +1 -1
  142. package/esm/components/attributes/editMode/EntitySelector/EntitySelector.d.ts +1 -1
  143. package/esm/components/attributes/editMode/EntitySelector/EntitySelector.js +13 -6
  144. package/esm/components/index.d.ts +4 -0
  145. package/esm/components/index.js +4 -0
  146. package/esm/components/workflow/hooks/useWorkflowAssignee.d.ts +1 -1
  147. package/esm/components/workflow/hooks/useWorkflowAssignee.js +1 -1
  148. package/esm/constants/prop-types.d.ts +1 -1
  149. package/esm/constants/prop-types.js +1 -1
  150. package/esm/hooks/index.d.ts +1 -0
  151. package/esm/hooks/index.js +1 -0
  152. package/esm/hooks/useEditableConnection.d.ts +10 -4
  153. package/esm/hooks/useEditableConnection.js +24 -3
  154. package/esm/hooks/useReadableSearchState.d.ts +2 -0
  155. package/esm/{components/activityLog/hooks → hooks}/useReadableSearchState.js +0 -0
  156. package/esm/icons/Duplicate.d.ts +3 -0
  157. package/esm/icons/Duplicate.js +23 -0
  158. package/esm/icons/index.d.ts +6 -3
  159. package/esm/icons/index.js +6 -3
  160. package/esm/types/index.d.ts +40 -0
  161. package/package.json +3 -3
  162. package/cjs/components/activityLog/hooks/useReadableSearchState.d.ts +0 -1
  163. package/esm/components/activityLog/hooks/useReadableSearchState.d.ts +0 -1
@@ -0,0 +1,51 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React, { memo } from 'react';
24
+ import { useSelector } from 'react-redux';
25
+ import ListItem from '@material-ui/core/ListItem';
26
+ import mdmModule from '@reltio/mdm-module';
27
+ import AttributeListItem from '../AttributeListItem/AttributeListItem';
28
+ import VirtualGroupedList from '../VirtualGroupedList/VirtualGroupedList';
29
+ import Highlighter from '../Highlighter/Highlighter';
30
+ import AttributeGroupIcon from '../AttributeGroupIcon/AttributeGroupIcon';
31
+ import { checkAttributeIncludes } from '../BasicAttributeSelector/helpers';
32
+ import { useStyles } from './styles';
33
+ var ITEM_HEIGHT = 28;
34
+ var ITEM_GROUP_TITLE_HEIGHT = 40;
35
+ var SelectAttributesList = function (_a) {
36
+ var selectedAttributes = _a.selectedAttributes, onItemClick = _a.onItemClick, focusIndex = _a.focusIndex, hideCheckBox = _a.hideCheckBox, otherProps = __rest(_a, ["selectedAttributes", "onItemClick", "focusIndex", "hideCheckBox"]);
37
+ var styles = useStyles();
38
+ var metadata = useSelector(mdmModule.selectors.getMetadata);
39
+ var getItemSize = function (i, item) { return (item.items ? ITEM_GROUP_TITLE_HEIGHT : ITEM_HEIGHT); };
40
+ var renderGroupTitle = function (style, item) { return (React.createElement(ListItem, { component: 'div', className: styles.subHeader, style: style, key: "group-" + item.item.id },
41
+ item.item.needGroupIcon && React.createElement(AttributeGroupIcon, { group: item.item, metadata: metadata }),
42
+ item.item.title)); };
43
+ var renderItem = function (style, _a, index) {
44
+ var item = _a.item, level = _a.level, groupId = _a.groupId, groupName = _a.groupName;
45
+ var checked = checkAttributeIncludes(item, selectedAttributes);
46
+ var isFocused = index === focusIndex;
47
+ return (React.createElement(AttributeListItem, { key: "item-" + groupId + "-" + item.fieldName, onClick: onItemClick, checked: checked, data: __assign(__assign({}, item), { groupName: groupName }), notSelectable: item.notSelectable, hideCheckBox: hideCheckBox, label: React.createElement(Highlighter, { text: item.title, highlight: item.filterText }), labelInText: item.title, level: level, style: style, isFocused: isFocused, groupId: groupId, LogoIcon: item.LogoIcon }));
48
+ };
49
+ return (React.createElement(VirtualGroupedList, __assign({ getItemSize: getItemSize, renderItem: renderItem, renderGroupTitle: renderGroupTitle, focusIndex: focusIndex }, otherProps)));
50
+ };
51
+ export default memo(SelectAttributesList);
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"subHeader">;
@@ -0,0 +1,13 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles({
3
+ subHeader: {
4
+ backgroundColor: '#f5f5f5',
5
+ padding: '0 16px',
6
+ margin: 0,
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ color: 'rgba(0,0,0,0.84)',
10
+ fontSize: '14px',
11
+ fontWeight: 500
12
+ }
13
+ });
@@ -5,7 +5,7 @@ declare type Props = {
5
5
  containerWidth: number;
6
6
  containerHeight: number;
7
7
  children: React.ReactNode;
8
- PaperProps: Record<string, unknown>;
8
+ PaperProps?: Record<string, unknown>;
9
9
  searchInputOnKeyDown: (event: React.KeyboardEvent) => void;
10
10
  onSearch: (value?: string) => void;
11
11
  className?: string;
@@ -1,4 +1,4 @@
1
- import { ReactNode, VFC } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  declare type HeaderProps = {
3
3
  mainTitle?: string;
4
4
  secondTitle?: string;
@@ -8,5 +8,5 @@ declare type HeaderProps = {
8
8
  declare type Props = HeaderProps & {
9
9
  onClose: () => void;
10
10
  };
11
- export declare const SidePanelContentHeader: VFC<Props>;
11
+ export declare const SidePanelContentHeader: ({ onClose, mainTitle, secondTitle, content, rightContent }: Props) => JSX.Element;
12
12
  export {};
@@ -4,7 +4,7 @@ import { ui } from '@reltio/mdm-module';
4
4
  import ActivityTitle from './ActivityTitle/ActivityTitle';
5
5
  import { always, pipe } from 'ramda';
6
6
  import { parseJSON } from '../../../core';
7
- import { useReadableSearchState } from '../hooks/useReadableSearchState';
7
+ import { useReadableSearchState } from '../../../hooks';
8
8
  import i18n from 'ui-i18n';
9
9
  import { useStyles } from './styles';
10
10
  var SearchActivity = function (_a) {
@@ -10,7 +10,7 @@ declare function EntitySelector({ entity, entityTypesUris, mode, max, onChange,
10
10
  metadata: any;
11
11
  globalSearchRequestOptions: any;
12
12
  attributeTypesSelectionStrategy: any;
13
- disableLinkClick: any;
13
+ disableLinkClick?: boolean;
14
14
  }): JSX.Element;
15
15
  declare namespace EntitySelector {
16
16
  namespace propTypes {
@@ -33,7 +33,7 @@ import EntityCreator from '../EntityCreator';
33
33
  import { EmptyStub } from '../../../../core';
34
34
  import Group from './components/Group';
35
35
  import { useStyles } from './styles';
36
- var buildEntityOptions = function (entityTypes) { return function (entities) {
36
+ var buildEntityOptions = function (entityTypes, onCreate) { return function (entities) {
37
37
  var newOptions = entities.map(function (entity) { return (__assign(__assign({}, entity), { label: getLabel(entity.label), entityType: entityTypes.find(function (_a) {
38
38
  var uri = _a.uri;
39
39
  return uri === entity.type;
@@ -49,8 +49,13 @@ var buildEntityOptions = function (entityTypes) { return function (entities) {
49
49
  ]
50
50
  : options;
51
51
  };
52
- return entityTypes.length > 1
53
- ? entityTypes.map(function (type) {
52
+ var filteredEntityTypes = onCreate
53
+ ? entityTypes
54
+ : entityTypes.filter(function (type) {
55
+ return newOptions.some(function (option) { return option.type === type.uri; });
56
+ });
57
+ return filteredEntityTypes.length > 1
58
+ ? filteredEntityTypes.map(function (type) {
54
59
  return {
55
60
  label: type.label,
56
61
  entityType: type.uri,
@@ -60,9 +65,9 @@ var buildEntityOptions = function (entityTypes) { return function (entities) {
60
65
  : addDummyOptionToEmptyOptionList(newOptions);
61
66
  }; };
62
67
  var EntitySelector = function (_a) {
63
- var _b = _a.entity, entity = _b === void 0 ? {} : _b, _c = _a.entityTypesUris, entityTypesUris = _c === void 0 ? [] : _c, mode = _a.mode, max = _a.max, onChange = _a.onChange, onCreate = _a.onCreate, metadata = _a.metadata, globalSearchRequestOptions = _a.globalSearchRequestOptions, attributeTypesSelectionStrategy = _a.attributeTypesSelectionStrategy, disableLinkClick = _a.disableLinkClick, otherProps = __rest(_a, ["entity", "entityTypesUris", "mode", "max", "onChange", "onCreate", "metadata", "globalSearchRequestOptions", "attributeTypesSelectionStrategy", "disableLinkClick"]);
68
+ var _b = _a.entity, entity = _b === void 0 ? {} : _b, _c = _a.entityTypesUris, entityTypesUris = _c === void 0 ? [] : _c, mode = _a.mode, max = _a.max, onChange = _a.onChange, onCreate = _a.onCreate, metadata = _a.metadata, globalSearchRequestOptions = _a.globalSearchRequestOptions, attributeTypesSelectionStrategy = _a.attributeTypesSelectionStrategy, _d = _a.disableLinkClick, disableLinkClick = _d === void 0 ? false : _d, otherProps = __rest(_a, ["entity", "entityTypesUris", "mode", "max", "onChange", "onCreate", "metadata", "globalSearchRequestOptions", "attributeTypesSelectionStrategy", "disableLinkClick"]);
64
69
  var styles = useStyles();
65
- var _d = useState(''), inputValue = _d[0], setInputValue = _d[1];
70
+ var _e = useState(''), inputValue = _e[0], setInputValue = _e[1];
66
71
  var entityTypes = useMemo(function () { return entityTypesUris.map(function (type) { return getEntityType(metadata, type); }); }, [
67
72
  entityTypesUris,
68
73
  metadata
@@ -94,7 +99,9 @@ var EntitySelector = function (_a) {
94
99
  handleChange({});
95
100
  };
96
101
  var groupMode = useMemo(function () { return entityTypes.length !== 1; }, [entityTypes]);
97
- var getOptions = function (value) { return getFilteredEntities(filters, options, value).then(buildEntityOptions(entityTypes)); };
102
+ var getOptions = function (value) {
103
+ return getFilteredEntities(filters, options, value).then(buildEntityOptions(entityTypes, onCreate));
104
+ };
98
105
  var currentEntityType = (isEmpty(entity) ? entityTypes[0] : getEntityType(metadata, entity.entityType)) || {};
99
106
  var createLabel = onCreate && i18n.text("Create " + (inputValue ? "\"" + inputValue + "\" as " : '') + "new " + currentEntityType.label);
100
107
  var label = i18n.text("Select " + (entityTypes.length === 1 ? entityTypes[0].label + " " : '') + "profile");
@@ -126,4 +126,8 @@ export { MergeButton } from './MergeButton/MergeButton';
126
126
  export { NotMatchButton } from './NotMatchButton/NotMatchButton';
127
127
  export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
128
128
  export { default as ProfilesList } from './ProfilesList';
129
+ export { default as BasicAttributeSelector } from './BasicAttributeSelector/BasicAttributeSelector';
130
+ export { default as AttributeGroupIcon } from './AttributeGroupIcon/AttributeGroupIcon';
131
+ export { default as AttributesFiltersButton } from './AttributesFiltersButton/AttributesFiltersButton';
132
+ export { default as AttributesFiltersBuilder } from './AttributesFiltersBuilder/AttributesFiltersBuilder';
129
133
  export { ConnectionEditor } from './ConnectionEditor';
@@ -126,4 +126,8 @@ export { MergeButton } from './MergeButton/MergeButton';
126
126
  export { NotMatchButton } from './NotMatchButton/NotMatchButton';
127
127
  export { ActionButton, ActionButtonMode } from './ActionButton/ActionButton';
128
128
  export { default as ProfilesList } from './ProfilesList';
129
+ export { default as BasicAttributeSelector } from './BasicAttributeSelector/BasicAttributeSelector';
130
+ export { default as AttributeGroupIcon } from './AttributeGroupIcon/AttributeGroupIcon';
131
+ export { default as AttributesFiltersButton } from './AttributesFiltersButton/AttributesFiltersButton';
132
+ export { default as AttributesFiltersBuilder } from './AttributesFiltersBuilder/AttributesFiltersBuilder';
129
133
  export { ConnectionEditor } from './ConnectionEditor';
@@ -3,7 +3,7 @@ declare type AssigneeOption = {
3
3
  label: string;
4
4
  value: string;
5
5
  };
6
- export declare const useWorkflowAssignee: ({ assignee, taskId, isOpen }: Pick<WorkflowTaskData, 'taskId' | 'assignee' | 'isOpen'>) => {
6
+ export declare const useWorkflowAssignee: ({ assignee, taskId, isOpen }: Partial<Pick<WorkflowTaskData, 'taskId' | 'assignee' | 'isOpen'>>) => {
7
7
  assignee: AssigneeOption;
8
8
  getAssignees: (text: any) => Promise<void | unknown[]>;
9
9
  updateAssignee: (newValue: AssigneeOption) => void;
@@ -4,7 +4,7 @@ import { useSelector } from 'react-redux';
4
4
  import { getAssigneeForTask, updateAssigneeForTask, utils } from '@reltio/mdm-sdk';
5
5
  import mdmModule from '@reltio/mdm-module';
6
6
  import { useSafePromise } from '../../../hooks';
7
- import { WorkflowTasksContext } from '../../../contexts/WorkflowTasksContext';
7
+ import { WorkflowTasksContext } from '../../../contexts';
8
8
  import { showWorkflowError } from '../helpers/errors';
9
9
  import { useWorkflowCheckPermission } from './useWorkflowCheckPermission';
10
10
  import { isOpenTask } from '../helpers';
@@ -90,7 +90,7 @@ export const QueryBuilderAttributeDataType: PropTypes.Requireable<PropTypes.Infe
90
90
  groupName: PropTypes.Requireable<string>;
91
91
  }>>;
92
92
  export const QueryBuilderAttributeType: PropTypes.Requireable<PropTypes.InferProps<{
93
- id: PropTypes.Requireable<string>;
93
+ id: PropTypes.Requireable<string | number>;
94
94
  values: PropTypes.Requireable<any[]>;
95
95
  data: PropTypes.Requireable<PropTypes.InferProps<{
96
96
  title: PropTypes.Requireable<string>;
@@ -55,7 +55,7 @@ var QueryBuilderAttributeDataType = PropTypes.shape({
55
55
  groupName: PropTypes.string
56
56
  });
57
57
  var QueryBuilderAttributeType = PropTypes.shape({
58
- id: PropTypes.string,
58
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
59
59
  values: PropTypes.array,
60
60
  data: QueryBuilderAttributeDataType,
61
61
  filter: PropTypes.string,
@@ -16,3 +16,4 @@ export { usePagingSimulator } from './usePagingSimulator';
16
16
  export { useMergeAllRequest } from './useMergeAllRequest';
17
17
  export { useMarkAsNotMatchRequest } from './useMarkAsNotMatchRequest';
18
18
  export { useEditableConnection } from './useEditableConnection';
19
+ export { useReadableSearchState } from './useReadableSearchState';
@@ -16,3 +16,4 @@ export { usePagingSimulator } from './usePagingSimulator';
16
16
  export { useMergeAllRequest } from './useMergeAllRequest';
17
17
  export { useMarkAsNotMatchRequest } from './useMarkAsNotMatchRequest';
18
18
  export { useEditableConnection } from './useEditableConnection';
19
+ export { useReadableSearchState } from './useReadableSearchState';
@@ -1,12 +1,18 @@
1
- import { EditingConnection, AttributeItem } from '@reltio/mdm-sdk';
1
+ import { EditingConnection, AttributeItem, Entity } from '@reltio/mdm-sdk';
2
2
  declare type EditRelationActions = {
3
3
  onChangeAttribute: (attribute: AttributeItem) => void;
4
4
  onAddAttributes: (attributes: AttributeItem[]) => void;
5
- onRemoveAttribute: (attrbutes: AttributeItem) => void;
5
+ onRemoveAttribute: (attributes: AttributeItem) => void;
6
+ onChangeEntity: (entity: Entity) => void;
7
+ onChangeRelationType: (value: {
8
+ type: string;
9
+ direction: string;
10
+ }) => void;
6
11
  };
7
12
  declare type Props = {
8
13
  connection: EditingConnection;
9
- onConnectionChange: (newConnection: EditingConnection) => void;
14
+ onConnectionChange: (connection: EditingConnection) => void;
15
+ relatedEntity?: Entity;
10
16
  };
11
- export declare const useEditableConnection: ({ connection, onConnectionChange }: Props) => EditRelationActions;
17
+ export declare const useEditableConnection: ({ connection, onConnectionChange, relatedEntity }: Props) => EditRelationActions;
12
18
  export {};
@@ -10,10 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { useCallback } from 'react';
13
+ import { isAvailableRelationBetweenEntities, Directions, getRelationType, removeEntityAttribute, addEntityAttributes, changeEntityAttribute } from '@reltio/mdm-sdk';
13
14
  import { pipe } from 'ramda';
14
- import { removeEntityAttribute, addEntityAttributes, changeEntityAttribute } from '@reltio/mdm-sdk';
15
+ import { useSelector } from 'react-redux';
16
+ import mdmModule from '@reltio/mdm-module';
15
17
  export var useEditableConnection = function (_a) {
16
- var connection = _a.connection, onConnectionChange = _a.onConnectionChange;
18
+ var connection = _a.connection, onConnectionChange = _a.onConnectionChange, relatedEntity = _a.relatedEntity;
19
+ var metadata = useSelector(mdmModule.selectors.getMetadata);
17
20
  var onRelationChange = useCallback(function (relation) { return onConnectionChange(__assign(__assign({}, connection), { relation: relation })); }, [
18
21
  connection,
19
22
  onConnectionChange
@@ -30,9 +33,27 @@ export var useEditableConnection = function (_a) {
30
33
  connection.relation,
31
34
  onRelationChange
32
35
  ]);
36
+ var handleChangeRelationType = useCallback(function (_a) {
37
+ var type = _a.type, direction = _a.direction;
38
+ var newConnection = {
39
+ entity: connection.entity &&
40
+ isAvailableRelationBetweenEntities(direction === Directions.OUT, connection.entity, relatedEntity, metadata, getRelationType(metadata, type))
41
+ ? connection.entity
42
+ : null,
43
+ relation: __assign(__assign({}, connection.relation), { attributes: {}, type: type,
44
+ direction: direction })
45
+ };
46
+ onConnectionChange(newConnection);
47
+ }, [connection, onConnectionChange, relatedEntity, metadata]);
48
+ var handleChangeEntity = useCallback(function (entity) { return onConnectionChange(__assign(__assign({}, connection), { entity: entity })); }, [
49
+ connection,
50
+ onConnectionChange
51
+ ]);
33
52
  return {
34
53
  onAddAttributes: handleAddAttributes,
35
54
  onChangeAttribute: handleChangeAttribute,
36
- onRemoveAttribute: handleRemoveAttribute
55
+ onRemoveAttribute: handleRemoveAttribute,
56
+ onChangeEntity: handleChangeEntity,
57
+ onChangeRelationType: handleChangeRelationType
37
58
  };
38
59
  };
@@ -0,0 +1,2 @@
1
+ import { SearchState } from '@reltio/mdm-sdk';
2
+ export declare const useReadableSearchState: (searchState: SearchState) => string;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const SvgDuplicate: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ export default SvgDuplicate;
@@ -0,0 +1,23 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ var SvgDuplicate = function (props) {
14
+ return (React.createElement("svg", __assign({ width: 20, height: 20, viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", focusable: "false" }, props),
15
+ React.createElement("defs", null,
16
+ React.createElement("path", { d: "M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM8 8v12h12V8H8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z", id: "Duplicate_svg__a" })),
17
+ React.createElement("g", { transform: "translate(-2 -2)", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" },
18
+ React.createElement("mask", { id: "Duplicate_svg__b", fill: "#fff" },
19
+ React.createElement("use", { xlinkHref: "#Duplicate_svg__a" })),
20
+ React.createElement("g", { mask: "url(#Duplicate_svg__b)", fill: "#000", fillOpacity: 0.54 },
21
+ React.createElement("path", { d: "M0 0h24v24H0z" })))));
22
+ };
23
+ export default SvgDuplicate;
@@ -14,6 +14,7 @@ export { default as DeleteRequestTaskIcon } from './DeleteRequestTaskIcon';
14
14
  export { default as Details } from './Details';
15
15
  export { default as Download } from './Download';
16
16
  export { default as Draw } from './Draw';
17
+ export { default as Duplicate } from './Duplicate';
17
18
  export { default as EmptySearchResults } from './EmptySearchResults';
18
19
  export { default as Error } from './Error';
19
20
  export { default as Filter } from './Filter';
@@ -21,17 +22,19 @@ export { default as Ignored } from './Ignored';
21
22
  export { default as IgnoredOutlined } from './IgnoredOutlined';
22
23
  export { default as LogIn } from './LogIn';
23
24
  export { default as LogOut } from './LogOut';
24
- export { default as Merge } from './Merge';
25
25
  export { default as MlMatch } from './MlMatch';
26
+ export { default as Merge } from './Merge';
27
+ export { default as MergeDark } from './MergeDark';
26
28
  export { default as NestedAttribute } from './NestedAttribute';
27
29
  export { default as NoData } from './NoData';
28
30
  export { default as NoDataSearch } from './NoDataSearch';
29
31
  export { default as NoMatches } from './NoMatches';
32
+ export { default as NotMatchDark } from './NotMatchDark';
33
+ export { default as PmIcon } from './PmIcon';
34
+ export { default as PmTaskIcon } from './PmTaskIcon';
30
35
  export { default as Pin } from './Pin';
31
36
  export { default as PinOutlined } from './PinOutlined';
32
37
  export { default as PivotingIcon } from './PivotingIcon';
33
- export { default as PmIcon } from './PmIcon';
34
- export { default as PmTaskIcon } from './PmTaskIcon';
35
38
  export { default as Polygon } from './Polygon';
36
39
  export { default as PotentialMatch } from './PotentialMatch';
37
40
  export { default as Profile } from './Profile';
@@ -14,6 +14,7 @@ export { default as DeleteRequestTaskIcon } from './DeleteRequestTaskIcon';
14
14
  export { default as Details } from './Details';
15
15
  export { default as Download } from './Download';
16
16
  export { default as Draw } from './Draw';
17
+ export { default as Duplicate } from './Duplicate';
17
18
  export { default as EmptySearchResults } from './EmptySearchResults';
18
19
  export { default as Error } from './Error';
19
20
  export { default as Filter } from './Filter';
@@ -21,17 +22,19 @@ export { default as Ignored } from './Ignored';
21
22
  export { default as IgnoredOutlined } from './IgnoredOutlined';
22
23
  export { default as LogIn } from './LogIn';
23
24
  export { default as LogOut } from './LogOut';
24
- export { default as Merge } from './Merge';
25
25
  export { default as MlMatch } from './MlMatch';
26
+ export { default as Merge } from './Merge';
27
+ export { default as MergeDark } from './MergeDark';
26
28
  export { default as NestedAttribute } from './NestedAttribute';
27
29
  export { default as NoData } from './NoData';
28
30
  export { default as NoDataSearch } from './NoDataSearch';
29
31
  export { default as NoMatches } from './NoMatches';
32
+ export { default as NotMatchDark } from './NotMatchDark';
33
+ export { default as PmIcon } from './PmIcon';
34
+ export { default as PmTaskIcon } from './PmTaskIcon';
30
35
  export { default as Pin } from './Pin';
31
36
  export { default as PinOutlined } from './PinOutlined';
32
37
  export { default as PivotingIcon } from './PivotingIcon';
33
- export { default as PmIcon } from './PmIcon';
34
- export { default as PmTaskIcon } from './PmTaskIcon';
35
38
  export { default as Polygon } from './Polygon';
36
39
  export { default as PotentialMatch } from './PotentialMatch';
37
40
  export { default as Profile } from './Profile';
@@ -57,6 +57,46 @@ export declare type QueryBuilderAttribute = {
57
57
  filter: string;
58
58
  operator: string;
59
59
  };
60
+ export declare type AttributeSelectorItem = {
61
+ attrType: AttributeType;
62
+ entityTypeUri: string;
63
+ fieldName: string;
64
+ groupName: string;
65
+ title: string;
66
+ uri: string;
67
+ children?: AttributeSelectorItem[];
68
+ pathToTitle?: string[];
69
+ };
70
+ export declare type AttributeSelectorItemsGroup = {
71
+ id?: string;
72
+ title: string;
73
+ attributes: AttributeSelectorItem[];
74
+ };
75
+ export declare type AttributeSelectionInfo = {
76
+ index: number;
77
+ checked: boolean;
78
+ attribute: AttributeSelectorItem;
79
+ selectedAttributes: AttributeSelectorItem[];
80
+ };
81
+ export declare type BasicAttributeSelectorProps = {
82
+ className?: string;
83
+ itemsGroups: AttributeSelectorItemsGroup[];
84
+ value: AttributeSelectorItem;
85
+ onSelect: (selectInfo: AttributeSelectionInfo) => void;
86
+ onRestoreFocus?: () => void;
87
+ onOpenPopup?: () => void;
88
+ getLabel?: (value: {
89
+ fieldName?: string;
90
+ pathToTitle?: string[];
91
+ title: string;
92
+ }) => string;
93
+ disableRestoreFocus?: boolean;
94
+ disableEnforceFocus?: boolean;
95
+ single?: boolean;
96
+ ungroup?: boolean;
97
+ disabled?: boolean;
98
+ hideCheckBox?: boolean;
99
+ };
60
100
  export declare enum RequestStates {
61
101
  INIT = "init",
62
102
  LOADING = "loading",
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1068",
3
+ "version": "1.4.1073",
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.1068",
11
- "@reltio/mdm-sdk": "^1.4.1068",
10
+ "@reltio/mdm-module": "^1.4.1073",
11
+ "@reltio/mdm-sdk": "^1.4.1073",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",
@@ -1 +0,0 @@
1
- export declare const useReadableSearchState: (searchState: any) => string;
@@ -1 +0,0 @@
1
- export declare const useReadableSearchState: (searchState: any) => string;