@reltio/components 1.4.2071 → 1.4.2073

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 (196) hide show
  1. package/AttributesView/AttributesView.js +1 -1
  2. package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
  3. package/ColumnsSettings/helpers.d.ts +3 -1
  4. package/ColumnsSettings/types.d.ts +8 -0
  5. package/CommentsContainer/CommentsContainer.js +1 -1
  6. package/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
  7. package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
  8. package/EditModeAttributesList/EditModeAttributesList.js +1 -1
  9. package/EditModeAttributesPager/EditModeAttributesPager.test.js +1 -1
  10. package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +1 -1
  11. package/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
  12. package/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
  13. package/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
  14. package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +1 -1
  15. package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +1 -1
  16. package/ReadOnlyAttributesView/ReadOnlyAttributesView.js +1 -1
  17. package/ScrollableTabs/ScrollableTabs.test.js +69 -19
  18. package/SearchHighlighter/SearchHighlighter.test.js +18 -7
  19. package/SelectAttributesList/SelectAttributesList.d.ts +11 -6
  20. package/SelectAttributesList/SelectAttributesList.js +5 -2
  21. package/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
  22. package/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
  23. package/SidePanelContentHeader/SidePanelContentHeader.test.js +104 -0
  24. package/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
  25. package/SidePanelEmptyState/SidePanelEmptyState.test.js +24 -0
  26. package/SimpleAttribute/SimpleAttribute.js +1 -1
  27. package/SimpleAttribute/SimpleAttribute.test.js +155 -80
  28. package/SimpleAttributeEditor/SimpleAttributeEditor.test.js +339 -330
  29. package/SimpleAttributeEditor/useAttributeValuePermissions.js +1 -1
  30. package/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
  31. package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
  32. package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
  33. package/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +128 -32
  34. package/SmallIconButton/SmallIconButton.test.js +98 -25
  35. package/TableWithBars/TableWithBars.test.js +98 -60
  36. package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
  37. package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
  38. package/Tags/Tags.d.ts +0 -1
  39. package/Tags/Tags.test.js +8 -7
  40. package/TransitiveMatchBlock/TransitiveMatchBlock.test.js +78 -22
  41. package/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
  42. package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
  43. package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
  44. package/UploadFileButton/UploadFileButton.d.ts +2 -2
  45. package/UploadFileButton/UploadFileButton.test.js +199 -0
  46. package/UploadImageDialog/UploadImageDialog.test.js +1 -0
  47. package/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
  48. package/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
  49. package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
  50. package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
  51. package/ValueChip/ValueChip.test.js +7 -23
  52. package/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
  53. package/VirtualGroupedList/VirtualGroupedList.js +11 -36
  54. package/VirtualGroupedList/VirtualGroupedList.test.js +224 -0
  55. package/VirtualGroupedList/helpers.d.ts +7 -2
  56. package/VirtualGroupedList/helpers.js +3 -1
  57. package/VirtualGroupedList/index.d.ts +1 -1
  58. package/VirtualGroupedList/types.d.ts +10 -6
  59. package/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
  60. package/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
  61. package/cjs/AttributesView/AttributesView.js +2 -2
  62. package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
  63. package/cjs/ColumnsSettings/helpers.d.ts +3 -1
  64. package/cjs/ColumnsSettings/types.d.ts +8 -0
  65. package/cjs/ColumnsSettings/types.js +2 -0
  66. package/cjs/CommentsContainer/CommentsContainer.js +1 -1
  67. package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
  68. package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
  69. package/cjs/EditModeAttributesList/EditModeAttributesList.js +2 -2
  70. package/cjs/EditModeAttributesPager/EditModeAttributesPager.test.js +2 -2
  71. package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +2 -2
  72. package/cjs/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
  73. package/cjs/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
  74. package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
  75. package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
  76. package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +2 -2
  77. package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.js +2 -2
  78. package/cjs/ScrollableTabs/ScrollableTabs.test.js +69 -19
  79. package/cjs/SearchHighlighter/SearchHighlighter.test.js +18 -7
  80. package/cjs/SelectAttributesList/SelectAttributesList.d.ts +11 -6
  81. package/cjs/SelectAttributesList/SelectAttributesList.js +5 -2
  82. package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
  83. package/cjs/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
  84. package/cjs/SidePanelContentHeader/SidePanelContentHeader.test.js +109 -0
  85. package/cjs/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
  86. package/cjs/SidePanelEmptyState/SidePanelEmptyState.test.js +29 -0
  87. package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
  88. package/cjs/SimpleAttribute/SimpleAttribute.test.js +155 -80
  89. package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.test.js +338 -352
  90. package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.js +2 -2
  91. package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
  92. package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
  93. package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
  94. package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +127 -31
  95. package/cjs/SmallIconButton/SmallIconButton.test.js +98 -25
  96. package/cjs/TableWithBars/TableWithBars.test.js +98 -60
  97. package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
  98. package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
  99. package/cjs/Tags/Tags.d.ts +0 -1
  100. package/cjs/Tags/Tags.test.js +8 -7
  101. package/cjs/TransitiveMatchBlock/TransitiveMatchBlock.test.js +77 -21
  102. package/cjs/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
  103. package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
  104. package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
  105. package/cjs/UploadFileButton/UploadFileButton.d.ts +2 -2
  106. package/cjs/UploadFileButton/UploadFileButton.test.js +204 -0
  107. package/cjs/UploadImageDialog/UploadImageDialog.test.js +1 -0
  108. package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
  109. package/cjs/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
  110. package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
  111. package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
  112. package/cjs/ValueChip/ValueChip.test.js +7 -23
  113. package/cjs/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
  114. package/cjs/VirtualGroupedList/VirtualGroupedList.js +11 -36
  115. package/cjs/VirtualGroupedList/VirtualGroupedList.test.js +252 -0
  116. package/cjs/VirtualGroupedList/helpers.d.ts +7 -2
  117. package/cjs/VirtualGroupedList/helpers.js +3 -1
  118. package/cjs/VirtualGroupedList/index.d.ts +1 -1
  119. package/cjs/VirtualGroupedList/types.d.ts +10 -6
  120. package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
  121. package/cjs/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
  122. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -0
  123. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +5 -0
  124. package/cjs/features/activity-log/ActivityFilterEditor/helpers.js +2 -1
  125. package/cjs/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -1
  126. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +16 -15
  127. package/cjs/features/activity-log/types.d.ts +1 -0
  128. package/cjs/features/activity-log/types.js +1 -0
  129. package/cjs/features/activity-log/utils/activities.js +1 -0
  130. package/cjs/features/activity-log/utils/filters.js +5 -1
  131. package/cjs/features/activity-log/utils/filters.test.js +4 -2
  132. package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +24 -25
  133. package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +10 -11
  134. package/cjs/features/history/types.d.ts +1 -0
  135. package/cjs/features/workflow/hooks/useChangeRequest.test.js +5 -6
  136. package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +8 -9
  137. package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
  138. package/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -0
  139. package/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +5 -0
  140. package/features/activity-log/ActivityFilterEditor/helpers.js +2 -1
  141. package/features/activity-log/ActivityFilterEditor/helpers.test.js +3 -1
  142. package/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +16 -15
  143. package/features/activity-log/types.d.ts +1 -0
  144. package/features/activity-log/types.js +1 -0
  145. package/features/activity-log/utils/activities.js +1 -0
  146. package/features/activity-log/utils/filters.js +5 -1
  147. package/features/activity-log/utils/filters.test.js +4 -2
  148. package/features/crosswalks/hooks/useAttributeActions.test.js +1 -2
  149. package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -2
  150. package/features/history/types.d.ts +1 -0
  151. package/features/workflow/hooks/useChangeRequest.test.js +1 -2
  152. package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -2
  153. package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
  154. package/package.json +1 -1
  155. package/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -49
  156. package/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -24
  157. package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -103
  158. package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -13
  159. package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -21
  160. package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -20
  161. package/UploadFileButton/UploadFileButton.spec.js +0 -219
  162. package/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -9
  163. package/VirtualGroupedList/VirtualGroupedList.spec.js +0 -282
  164. package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -54
  165. package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
  166. package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -29
  167. package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
  168. package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -108
  169. package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
  170. package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -18
  171. package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
  172. package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -26
  173. package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
  174. package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -25
  175. package/cjs/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
  176. package/cjs/UploadFileButton/UploadFileButton.spec.js +0 -224
  177. package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
  178. package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -14
  179. package/cjs/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
  180. package/cjs/VirtualGroupedList/VirtualGroupedList.spec.js +0 -287
  181. package/cjs/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
  182. /package/{SidePanelContentHeader/SidePanelContentHeader.spec.d.ts → ColumnsSettings/types.js} +0 -0
  183. /package/{SidePanelEmptyState/SidePanelEmptyState.spec.d.ts → SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
  184. /package/{SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts → SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
  185. /package/{SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts → UploadFileButton/UploadFileButton.test.d.ts} +0 -0
  186. /package/{TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts → VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
  187. /package/{TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
  188. /package/{UploadFileButton/UploadFileButton.spec.d.ts → cjs/SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
  189. /package/{UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts → cjs/SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
  190. /package/{VirtualGroupedList/VirtualGroupedList.spec.d.ts → cjs/UploadFileButton/UploadFileButton.test.d.ts} +0 -0
  191. /package/{WhiteSearchInput/WhiteSearchInput.spec.d.ts → cjs/VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
  192. /package/cjs/{SidePanelContentHeader/SidePanelContentHeader.spec.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
  193. /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
  194. /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
  195. /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
  196. /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
@@ -0,0 +1,224 @@
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
+ import { render, screen, within, fireEvent } from '@testing-library/react';
14
+ import { VariableSizeList } from 'react-window';
15
+ import * as useScrollToFocusItemImport from './useScrollToFocusItem';
16
+ import { flattenGroupedItemsData } from './helpers';
17
+ import { VirtualGroupedList } from './VirtualGroupedList';
18
+ describe('VirtualGroupedList tests', function () {
19
+ var getItems = function (type) {
20
+ var simpleItems = [
21
+ { item: { label: 'Label 1', id: 'some_id1' } },
22
+ { item: { label: 'Label 2', id: 'some_id2' } },
23
+ { item: { label: 'Label 3', id: 'some_id3' } }
24
+ ];
25
+ var newSimpleItems = [{ item: { label: 'Label 1', id: 'some_id1' } }, { item: { label: 'Label 2', id: 'some_id2' } }];
26
+ var groupedItems = [
27
+ {
28
+ item: { label: 'Label 1', id: 'some_id1' },
29
+ items: [
30
+ { item: { label: 'Label 1.1', id: 'some_id1.1' } },
31
+ { item: { label: 'Label 1.2', id: 'some_id1.2' } },
32
+ { item: { label: 'Label 1.3', id: 'some_id1.3' } }
33
+ ]
34
+ },
35
+ {
36
+ item: { label: 'Label 2', id: 'some_id2' },
37
+ items: [
38
+ { item: { label: 'Label 2.1', id: 'some_id2.1' } },
39
+ { item: { label: 'Label 2.2', id: 'some_id2.2' }, moveTo: false }
40
+ ]
41
+ }
42
+ ];
43
+ switch (type) {
44
+ case 'grouped':
45
+ return flattenGroupedItemsData(groupedItems);
46
+ case 'groupedWithMove': {
47
+ groupedItems[1].items[1].moveTo = true;
48
+ return flattenGroupedItemsData(groupedItems);
49
+ }
50
+ case 'newSimpleItems': {
51
+ return flattenGroupedItemsData(newSimpleItems);
52
+ }
53
+ case 'simple':
54
+ default:
55
+ return flattenGroupedItemsData(simpleItems);
56
+ }
57
+ };
58
+ var renderItem = function (style, _a) {
59
+ var item = _a.item;
60
+ return (React.createElement("div", { style: style, "data-reltio-id": "grouped-list-item" }, item.label));
61
+ };
62
+ var defaultProps = {
63
+ getItemSize: function () { return 50; },
64
+ renderItem: renderItem,
65
+ renderGroupTitle: renderItem,
66
+ items: getItems('simple'),
67
+ height: 500
68
+ };
69
+ var setUp = function (props) {
70
+ if (props === void 0) { props = {}; }
71
+ return render(React.createElement(VirtualGroupedList, __assign({}, defaultProps, props)));
72
+ };
73
+ afterEach(function () {
74
+ jest.restoreAllMocks();
75
+ });
76
+ it('should correct render simple items', function () {
77
+ setUp({ items: getItems('simple') });
78
+ expect(screen.getByText('Label 1')).toBeInTheDocument();
79
+ expect(screen.getByText('Label 2')).toBeInTheDocument();
80
+ expect(screen.getByText('Label 3')).toBeInTheDocument();
81
+ });
82
+ it('should correct render grouped items', function () {
83
+ setUp({ items: getItems('grouped') });
84
+ var stickyTitles = screen.getByTestId('grouped-list-sticky-titles');
85
+ expect(stickyTitles.childNodes).toHaveLength(2);
86
+ expect(within(stickyTitles).getByText('Label 1')).toHaveStyle('visibility: visible');
87
+ expect(within(stickyTitles).getByText('Label 2')).toHaveStyle('visibility: hidden');
88
+ var items = screen.getAllByTestId('grouped-list-item');
89
+ expect(items).toHaveLength(9);
90
+ expect(items.map(function (item) { return item.textContent; })).toEqual([
91
+ 'Label 1',
92
+ 'Label 2',
93
+ 'Label 1',
94
+ 'Label 1.1',
95
+ 'Label 1.2',
96
+ 'Label 1.3',
97
+ 'Label 2',
98
+ 'Label 2.1',
99
+ 'Label 2.2'
100
+ ]);
101
+ });
102
+ it('should set sticky titles width if items width changed', function () {
103
+ var _a = setUp({ items: getItems('grouped') }), container = _a.container, rerender = _a.rerender;
104
+ var stickyTitles = screen.getByTestId('grouped-list-sticky-titles');
105
+ Object.defineProperties(container.childNodes[1].firstChild, {
106
+ offsetWidth: {
107
+ get: function () {
108
+ return 200;
109
+ }
110
+ }
111
+ });
112
+ rerender(React.createElement(VirtualGroupedList, __assign({}, defaultProps, { items: getItems('grouped'), height: 100 })));
113
+ expect(stickyTitles).toHaveStyle('width: 200px');
114
+ });
115
+ it('should not render fixed group title when fixedTitle is false', function () {
116
+ setUp({ items: getItems('grouped'), fixedTitle: false });
117
+ var stickyTitles = screen.getByTestId('grouped-list-sticky-titles');
118
+ expect(stickyTitles.childNodes).toHaveLength(0);
119
+ });
120
+ it('should clear index when items is updated', function () {
121
+ var useScrollToFocusItemSpy = jest.spyOn(useScrollToFocusItemImport, 'useScrollToFocusItem');
122
+ var rerender = setUp({ items: getItems('simple') }).rerender;
123
+ var listRef = useScrollToFocusItemSpy.mock.calls[0][0].listRef;
124
+ var resetAfterIndexSpy = jest.spyOn(listRef.current, 'resetAfterIndex');
125
+ rerender(React.createElement(VirtualGroupedList, __assign({}, defaultProps, { items: getItems('simple') })));
126
+ expect(resetAfterIndexSpy).toHaveBeenCalledWith(0);
127
+ });
128
+ describe('Scroll behavior', function () {
129
+ var setHeightForNode = function (node, height, scrollHeight) {
130
+ Object.defineProperties(node, {
131
+ clientHeight: {
132
+ get: function () { return height; },
133
+ configurable: true
134
+ },
135
+ scrollHeight: {
136
+ get: function () { return scrollHeight; },
137
+ configurable: true
138
+ }
139
+ });
140
+ };
141
+ /*
142
+ Some scroll offsets for grouped items(getItems('grouped')):
143
+ First title offset: 0
144
+ First title will be showing in offset range: 0-199
145
+ Second title offset: 200
146
+ Second title will be showing in offset range: 200+
147
+ Offset range when titles is touching each other: 150-200
148
+ */
149
+ it('should scroll to moveTo item', function () {
150
+ var requestAnimationFrameMock = jest
151
+ .spyOn(window, 'requestAnimationFrame')
152
+ .mockImplementation(function (callback) {
153
+ callback(0);
154
+ return 0;
155
+ });
156
+ var scrollToSpy = jest.spyOn(VariableSizeList.prototype, 'scrollTo').mockImplementation(function () { return null; });
157
+ var rerender = setUp({ items: getItems('grouped'), height: 150 }).rerender;
158
+ rerender(React.createElement(VirtualGroupedList, __assign({}, defaultProps, { items: getItems('groupedWithMove'), height: 150 })));
159
+ expect(scrollToSpy).toHaveBeenCalledTimes(2);
160
+ expect(scrollToSpy).toHaveBeenCalledWith(200);
161
+ requestAnimationFrameMock.mockRestore();
162
+ });
163
+ it('should scroll to top of item', function () {
164
+ var scrollToSpy = jest.spyOn(VariableSizeList.prototype, 'scrollTo').mockImplementation(function () { return null; });
165
+ var rerender = setUp({ items: getItems('grouped'), height: 150 }).rerender;
166
+ var requestAnimationFrameMock = jest
167
+ .spyOn(window, 'requestAnimationFrame')
168
+ .mockImplementation(function (callback) {
169
+ callback(0);
170
+ return 0;
171
+ });
172
+ rerender(React.createElement(VirtualGroupedList, __assign({}, defaultProps, { items: getItems('newSimpleItems'), height: 150 })));
173
+ expect(scrollToSpy).toHaveBeenCalledTimes(1);
174
+ expect(scrollToSpy).toHaveBeenCalledWith(0);
175
+ requestAnimationFrameMock.mockRestore();
176
+ });
177
+ it('should change fixed title on forward scroll', function () {
178
+ var container = setUp({ items: getItems('grouped'), height: 150 }).container;
179
+ var titlesContainer = screen.getByTestId('grouped-list-sticky-titles');
180
+ var titles = within(titlesContainer).getAllByTestId('grouped-list-item');
181
+ setHeightForNode(container.childNodes[1], 150, 400);
182
+ fireEvent.scroll(container.childNodes[1], { target: { scrollTop: 210 } });
183
+ expect(titles).toHaveLength(2);
184
+ expect(titlesContainer).toHaveStyle('top: 0px');
185
+ expect(titles[0]).toHaveStyle('visibility: hidden');
186
+ expect(titles[1]).toHaveStyle('visibility: visible');
187
+ });
188
+ it('should move current fixed title on forward scroll when next title start touching the current title', function () {
189
+ var container = setUp({ items: getItems('grouped'), height: 150 }).container;
190
+ var titlesContainer = screen.getByTestId('grouped-list-sticky-titles');
191
+ var titles = within(titlesContainer).getAllByTestId('grouped-list-item');
192
+ setHeightForNode(container.childNodes[1], 150, 400);
193
+ fireEvent.scroll(container.childNodes[1], { target: { scrollTop: 151 } });
194
+ expect(titles).toHaveLength(2);
195
+ expect(titlesContainer).toHaveStyle('top: -1px');
196
+ expect(titles[0]).toHaveStyle('visibility: visible');
197
+ expect(titles[1]).toHaveStyle('visibility: hidden');
198
+ });
199
+ it('should change fixed title on backward scroll', function () {
200
+ var container = setUp({ items: getItems('grouped'), height: 150 }).container;
201
+ var titlesContainer = screen.getByTestId('grouped-list-sticky-titles');
202
+ var titles = within(titlesContainer).getAllByTestId('grouped-list-item');
203
+ setHeightForNode(container.childNodes[1], 150, 400);
204
+ fireEvent.scroll(container.childNodes[1], { target: { scrollTop: 210 } });
205
+ fireEvent.scroll(container.childNodes[1], { target: { scrollTop: 140 } });
206
+ expect(titles).toHaveLength(2);
207
+ expect(titlesContainer).toHaveStyle('top: 0px');
208
+ expect(titles[0]).toHaveStyle('visibility: visible');
209
+ expect(titles[1]).toHaveStyle('visibility: hidden');
210
+ });
211
+ it('should move current fixed title on backward scroll when previous title start touching the current title', function () {
212
+ var container = setUp({ items: getItems('grouped'), height: 150 }).container;
213
+ var titlesContainer = screen.getByTestId('grouped-list-sticky-titles');
214
+ var titles = within(titlesContainer).getAllByTestId('grouped-list-item');
215
+ setHeightForNode(container.childNodes[1], 150, 400);
216
+ fireEvent.scroll(container.childNodes[1], { target: { scrollTop: 210 } });
217
+ fireEvent.scroll(container.childNodes[1], { target: { scrollTop: 199 } });
218
+ expect(titles).toHaveLength(2);
219
+ expect(titlesContainer).toHaveStyle('top: -49px');
220
+ expect(titles[0]).toHaveStyle('visibility: visible');
221
+ expect(titles[1]).toHaveStyle('visibility: hidden');
222
+ });
223
+ });
224
+ });
@@ -1,2 +1,7 @@
1
- export function flattenGroupedItemsData(groupedItems: any): any;
2
- export function isTitleListItem(listItem: any): boolean;
1
+ import { VirtualGroupedListItem, VirtualGroupedListMainItem } from './types';
2
+ export type GroupedItem<T> = {
3
+ item: T;
4
+ items?: GroupedItem<T>[];
5
+ };
6
+ export declare const flattenGroupedItemsData: <T>(groupedItems: VirtualGroupedListItem<T>[]) => VirtualGroupedListMainItem<T>[];
7
+ export declare const isTitleListItem: <T>(listItem: VirtualGroupedListMainItem<T>) => boolean;
@@ -12,4 +12,6 @@ export var flattenGroupedItemsData = function (groupedItems) {
12
12
  });
13
13
  return items;
14
14
  };
15
- export var isTitleListItem = function (listItem) { return listItem.titleItemIndex === listItem.index; };
15
+ export var isTitleListItem = function (listItem) {
16
+ return listItem.titleItemIndex === listItem.index;
17
+ };
@@ -1,3 +1,3 @@
1
1
  export { VirtualGroupedList } from './VirtualGroupedList';
2
- export type { VirtualListGroupedItem, VirtualListItem } from './types';
2
+ export type { VirtualGroupedListItem, VirtualGroupedListMainItem, VirtualGroupedListRenderGroupTitle, VirtualGroupedListRenderItem } from './types';
3
3
  export { isTitleListItem, flattenGroupedItemsData } from './helpers';
@@ -1,10 +1,14 @@
1
- export type VirtualListItem = {
2
- item: Record<string, unknown>;
3
- moveTo?: number;
1
+ export type VirtualGroupedListItem<T, E = Record<string, unknown>> = E & {
2
+ item: T;
3
+ level?: number;
4
+ moveTo?: boolean;
5
+ items?: VirtualGroupedListItem<T, E>[];
4
6
  };
5
- export type VirtualListGroupedItem = {
6
- item: VirtualListItem;
7
+ export type VirtualGroupedListMainItem<T, E = Record<string, unknown>> = E & {
8
+ item: VirtualGroupedListItem<T, E>;
7
9
  titleItemIndex?: number;
8
10
  index: number;
9
- items?: VirtualListGroupedItem[];
11
+ moveTo?: boolean;
10
12
  };
13
+ export type VirtualGroupedListRenderItem<T, E = Record<string, unknown>> = (style: React.CSSProperties, item: VirtualGroupedListItem<T, E>, index: number, data: VirtualGroupedListMainItem<T, E>) => React.ReactElement;
14
+ export type VirtualGroupedListRenderGroupTitle<T, E = Record<string, unknown>> = (style: React.CSSProperties, item: VirtualGroupedListItem<T, E>) => React.ReactElement;
@@ -1,7 +1,10 @@
1
- export declare const useScrollToFocusItem: ({ focusIndex, listRef, items }: {
2
- focusIndex: any;
3
- listRef: any;
4
- items: any;
5
- }) => {
1
+ import { VariableSizeList } from 'react-window';
2
+ type Props<T> = {
3
+ focusIndex: number;
4
+ listRef: React.MutableRefObject<VariableSizeList>;
5
+ items: T[];
6
+ };
7
+ export declare const useScrollToFocusItem: <T>({ focusIndex, listRef, items }: Props<T>) => {
6
8
  handleOnItemsRendered: ({ visibleStartIndex, visibleStopIndex }: any) => void;
7
9
  };
10
+ export {};
@@ -10,8 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import React from 'react';
13
- import { shallow } from 'enzyme';
14
- import { SearchInput } from '../SearchInput';
13
+ import { render, screen } from '@testing-library/react';
15
14
  import { WhiteSearchInput } from './WhiteSearchInput';
16
15
  describe('WhiteSearchInput tests', function () {
17
16
  var defaultProps = {
@@ -21,11 +20,7 @@ describe('WhiteSearchInput tests', function () {
21
20
  height: 40
22
21
  };
23
22
  it('should render SearchInput with specified focused class', function () {
24
- var component = shallow(React.createElement(WhiteSearchInput, __assign({}, defaultProps)));
25
- var searchInput = component.find(SearchInput);
26
- expect(searchInput).toHaveLength(1);
27
- expect(searchInput.prop('classes')).toMatchObject({
28
- focused: 'white'
29
- });
23
+ render(React.createElement(WhiteSearchInput, __assign({}, defaultProps)));
24
+ expect(screen.getByRole('textbox').parentElement).toHaveClass('white');
30
25
  });
31
26
  });
@@ -32,7 +32,7 @@ var ReadOnlyAttributesView_1 = require("../ReadOnlyAttributesView");
32
32
  var EditModeAttributesView_1 = require("../EditModeAttributesView");
33
33
  var EntityContext_1 = require("../contexts/EntityContext");
34
34
  var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
35
- var AllwaysVisibleAttributesContext_1 = require("../contexts/AllwaysVisibleAttributesContext");
35
+ var AlwaysVisibleAttributesContext_1 = require("../contexts/AlwaysVisibleAttributesContext");
36
36
  var AttributesView = function (_a) {
37
37
  var attributesCount = _a.attributesCount, pinnedAttributes = _a.pinnedAttributes, _b = _a.alwaysVisible, alwaysVisible = _b === void 0 ? [] : _b, restProps = __rest(_a, ["attributesCount", "pinnedAttributes", "alwaysVisible"]);
38
38
  var mdmEntity = (0, MdmModuleContext_1.useMdmEntityWithDiff)();
@@ -40,6 +40,6 @@ var AttributesView = function (_a) {
40
40
  var entity = restProps.entity || mdmEntity;
41
41
  var mode = restProps.mode || mdmMode;
42
42
  return (react_1.default.createElement(EntityContext_1.EntityContext.Provider, { value: entity },
43
- react_1.default.createElement(AllwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext.Provider, { value: alwaysVisible }, (0, mdm_sdk_1.isViewMode)(mode) ? (react_1.default.createElement(ReadOnlyAttributesView_1.ReadOnlyAttributesView, __assign({}, restProps, { attributesCount: attributesCount, entity: entity }))) : (react_1.default.createElement(EditModeAttributesView_1.EditModeAttributesView, __assign({}, restProps, { mode: mode, pinnedAttributes: pinnedAttributes, entity: entity }))))));
43
+ react_1.default.createElement(AlwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext.Provider, { value: alwaysVisible }, (0, mdm_sdk_1.isViewMode)(mode) ? (react_1.default.createElement(ReadOnlyAttributesView_1.ReadOnlyAttributesView, __assign({}, restProps, { attributesCount: attributesCount, entity: entity }))) : (react_1.default.createElement(EditModeAttributesView_1.EditModeAttributesView, __assign({}, restProps, { mode: mode, pinnedAttributes: pinnedAttributes, entity: entity }))))));
44
44
  };
45
45
  exports.AttributesView = AttributesView;
@@ -1,14 +1,13 @@
1
1
  import React from 'react';
2
2
  import { GroupedColumnsData } from '../../../types/basicTable';
3
+ import { ListItem } from '../../types';
3
4
  type Props = {
4
5
  anchorEl: HTMLElement;
5
6
  onClose: () => void;
6
7
  title?: string;
7
8
  inputPlaceholder?: string;
8
9
  columnsData: GroupedColumnsData[];
9
- onColumnClick: (column: {
10
- id: string;
11
- }) => void;
10
+ onColumnClick: (column: ListItem) => void;
12
11
  selectedColumns: string[];
13
12
  hideCheckBox?: boolean;
14
13
  };
@@ -1,6 +1,8 @@
1
1
  import { ColumnData, GroupedColumnsData } from '../types/basicTable';
2
+ import { VirtualGroupedListItem } from '../VirtualGroupedList/types';
3
+ import { ListItem } from './types';
2
4
  declare const isGroupColumn: (column: ColumnData) => boolean;
3
- declare const buildColumnItems: (columnsData: GroupedColumnsData[], filterText: string) => ColumnData[];
5
+ declare const buildColumnItems: (columnsData: GroupedColumnsData[], filterText: string) => VirtualGroupedListItem<ListItem>[];
4
6
  declare const getChildColumns: (column: ColumnData) => ColumnData[];
5
7
  declare const isColumnSelected: (selectedColumns: string[], column: ColumnData) => boolean;
6
8
  export { buildColumnItems, getChildColumns, isGroupColumn, isColumnSelected };
@@ -0,0 +1,8 @@
1
+ import { DataTypeDefinition } from '@reltio/mdm-sdk';
2
+ export type ListItem = {
3
+ id: string;
4
+ label: string;
5
+ groupId?: string;
6
+ filterText?: string;
7
+ attrType?: DataTypeDefinition;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -82,7 +82,7 @@ var CommentsContainer = function (_a) {
82
82
  var allRelatedObjectUris = (0, react_1.useMemo)(function () {
83
83
  return additionalRelatedObjectUris ? __spreadArray(__spreadArray([], relatedObjectUris, true), additionalRelatedObjectUris, true) : relatedObjectUris;
84
84
  }, [additionalRelatedObjectUris, relatedObjectUris]);
85
- return (showComments && (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, className) },
85
+ return (showComments && (react_1.default.createElement("div", { "data-reltio-id": "comments-container", className: (0, classnames_1.default)(styles.root, className) },
86
86
  shouldShowAddCommentButton && (react_1.default.createElement(AddCommentButton_1.AddCommentButton, { className: (0, classnames_1.default)(styles.addButton, (_b = {},
87
87
  _b[styles.showAlways] = showAlways || isOpenPopupWithNewComment,
88
88
  _b)), onClick: handleClickAddCommentButton })),
@@ -1,41 +1,24 @@
1
- export function ConfigureColumnsPopup({ open, anchorEl, data, onSearch, onClose, titleText, filterText, onListItemClick, selected, hideCheckBox, renderGroupTitle, ...otherProps }: {
2
- [x: string]: any;
3
- open: any;
4
- anchorEl: any;
5
- data: any;
6
- onSearch: any;
7
- onClose: any;
8
- titleText: any;
9
- filterText: any;
10
- onListItemClick: any;
11
- selected: any;
12
- hideCheckBox: any;
13
- renderGroupTitle: any;
14
- }): React.JSX.Element;
15
- export namespace ConfigureColumnsPopup {
16
- namespace propTypes {
17
- let open: PropTypes.Requireable<boolean>;
18
- let hideCheckBox: PropTypes.Requireable<boolean>;
19
- let anchorEl: PropTypes.Requireable<any>;
20
- let selected: PropTypes.Requireable<any[]>;
21
- let data: PropTypes.Requireable<any[]>;
22
- let filterText: PropTypes.Requireable<string>;
23
- let titleText: PropTypes.Requireable<string>;
24
- let onClose: PropTypes.Requireable<(...args: any[]) => any>;
25
- let onListItemClick: PropTypes.Requireable<(...args: any[]) => any>;
26
- let onSearch: PropTypes.Requireable<(...args: any[]) => any>;
27
- let renderGroupTitle: PropTypes.Requireable<(...args: any[]) => any>;
28
- }
29
- namespace defaultProps {
30
- let data_1: any[];
31
- export { data_1 as data };
32
- let selected_1: any[];
33
- export { selected_1 as selected };
34
- let titleText_1: string;
35
- export { titleText_1 as titleText };
36
- let filterText_1: string;
37
- export { filterText_1 as filterText };
38
- }
39
- }
40
1
  import React from 'react';
41
- import PropTypes from 'prop-types';
2
+ import { SelectionPopup } from '../SelectionPopup';
3
+ import { VirtualGroupedListRenderGroupTitle } from '../VirtualGroupedList';
4
+ import { AttributeOption } from '../types';
5
+ type Item = AttributeOption & {
6
+ id: string;
7
+ groupId: string;
8
+ filterText?: string;
9
+ notSelectable?: boolean;
10
+ LogoIcon?: React.ElementType;
11
+ children?: Item[];
12
+ attributes?: Item[];
13
+ };
14
+ type Props = Omit<React.ComponentProps<typeof SelectionPopup>, 'title'> & {
15
+ hideCheckBox: boolean;
16
+ titleText?: string;
17
+ filterText?: string;
18
+ selected: Item[];
19
+ data: Item[];
20
+ onListItemClick: (item: Item, checked: boolean) => void;
21
+ renderGroupTitle: VirtualGroupedListRenderGroupTitle<Item>;
22
+ };
23
+ export declare const ConfigureColumnsPopup: ({ open, anchorEl, data, onSearch, onClose, titleText, filterText, onListItemClick, selected, hideCheckBox, renderGroupTitle, ...otherProps }: Props) => React.JSX.Element;
24
+ export {};
@@ -59,22 +59,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
59
59
  Object.defineProperty(exports, "__esModule", { value: true });
60
60
  exports.ConfigureColumnsPopup = void 0;
61
61
  var react_1 = __importStar(require("react"));
62
- var prop_types_1 = __importDefault(require("prop-types"));
63
62
  var ui_i18n_1 = __importDefault(require("ui-i18n"));
64
63
  var classnames_1 = __importDefault(require("classnames"));
65
64
  var ramda_1 = require("ramda");
66
65
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
66
+ var Highlighter_1 = require("../Highlighter");
67
67
  var SelectionPopup_1 = require("../SelectionPopup");
68
+ var AttributeListItem_1 = require("../AttributeListItem");
68
69
  var VirtualGroupedList_1 = require("../VirtualGroupedList");
69
70
  var useKeyboardNavigation_1 = require("../hooks/useKeyboardNavigation");
70
- var AttributeListItem_1 = require("../AttributeListItem");
71
- var Highlighter_1 = require("../Highlighter");
72
71
  var styles_1 = require("./styles");
73
72
  var ITEM_HEIGHT = 32;
74
73
  var LIST_CONTAINER_HEIGHT = 300;
75
74
  var DEFAULT_MIN_CONTAINER_WIDTH = 308;
76
75
  var ConfigureColumnsPopup = function (_a) {
77
- var open = _a.open, anchorEl = _a.anchorEl, data = _a.data, onSearch = _a.onSearch, onClose = _a.onClose, titleText = _a.titleText, filterText = _a.filterText, onListItemClick = _a.onListItemClick, selected = _a.selected, hideCheckBox = _a.hideCheckBox, renderGroupTitle = _a.renderGroupTitle, otherProps = __rest(_a, ["open", "anchorEl", "data", "onSearch", "onClose", "titleText", "filterText", "onListItemClick", "selected", "hideCheckBox", "renderGroupTitle"]);
76
+ var open = _a.open, anchorEl = _a.anchorEl, _b = _a.data, data = _b === void 0 ? [] : _b, onSearch = _a.onSearch, onClose = _a.onClose, _c = _a.titleText, titleText = _c === void 0 ? ui_i18n_1.default.text('Show/hide columns') : _c, _d = _a.filterText, filterText = _d === void 0 ? '' : _d, onListItemClick = _a.onListItemClick, _e = _a.selected, selected = _e === void 0 ? [] : _e, hideCheckBox = _a.hideCheckBox, renderGroupTitle = _a.renderGroupTitle, otherProps = __rest(_a, ["open", "anchorEl", "data", "onSearch", "onClose", "titleText", "filterText", "onListItemClick", "selected", "hideCheckBox", "renderGroupTitle"]);
78
77
  var filterItem = (0, react_1.useCallback)(function (item) {
79
78
  return item.label.toLowerCase().includes(filterText.toLowerCase());
80
79
  }, [filterText]);
@@ -111,12 +110,12 @@ var ConfigureColumnsPopup = function (_a) {
111
110
  }, [onListItemClick, selected]);
112
111
  var groupedItems = (0, react_1.useMemo)(function () { return (renderGroupTitle ? getGroupsData : getAttributesData)(data); }, [data, renderGroupTitle, getGroupsData, getAttributesData]);
113
112
  var items = (0, react_1.useMemo)(function () { return (0, VirtualGroupedList_1.flattenGroupedItemsData)(groupedItems); }, [groupedItems]);
114
- var _b = (0, useKeyboardNavigation_1.useKeyboardNavigation)({
113
+ var _f = (0, useKeyboardNavigation_1.useKeyboardNavigation)({
115
114
  items: items,
116
115
  open: open,
117
116
  onSelectFocusedItem: handleSearchOnEnter,
118
117
  selectedItems: selected
119
- }), focusIndex = _b.focusIndex, handleKeyDown = _b.handleKeyDown;
118
+ }), focusIndex = _f.focusIndex, handleKeyDown = _f.handleKeyDown;
120
119
  var focusIndexRef = (0, react_1.useRef)(null);
121
120
  focusIndexRef.current = focusIndex;
122
121
  var renderListItem = (0, react_1.useCallback)(function (style, _a, index) {
@@ -128,25 +127,6 @@ var ConfigureColumnsPopup = function (_a) {
128
127
  var containerWidth = (0, mdm_sdk_1.getMaxItemWidth)('label')(groupedItems) || DEFAULT_MIN_CONTAINER_WIDTH;
129
128
  var classes = (0, styles_1.useStyles)();
130
129
  return (react_1.default.createElement(SelectionPopup_1.SelectionPopup, __assign({ open: open, className: (0, classnames_1.default)(classes.container, classes.popupContainer), anchorEl: anchorEl, onClose: onClose, onSearch: onSearch, title: titleText, containerWidth: containerWidth, searchInputOnKeyDown: handleKeyDown }, otherProps),
131
- react_1.default.createElement(VirtualGroupedList_1.VirtualGroupedList, { height: LIST_CONTAINER_HEIGHT, renderItem: renderListItem, items: items, hideSubtitles: true, getItemSize: getItemSize, containerWidth: containerWidth, focusIndex: focusIndex, renderGroupTitle: renderGroupTitle })));
130
+ react_1.default.createElement(VirtualGroupedList_1.VirtualGroupedList, { height: LIST_CONTAINER_HEIGHT, renderItem: renderListItem, items: items, hideSubtitles: true, getItemSize: getItemSize, focusIndex: focusIndex, renderGroupTitle: renderGroupTitle })));
132
131
  };
133
132
  exports.ConfigureColumnsPopup = ConfigureColumnsPopup;
134
- exports.ConfigureColumnsPopup.propTypes = {
135
- open: prop_types_1.default.bool,
136
- hideCheckBox: prop_types_1.default.bool,
137
- anchorEl: prop_types_1.default.any,
138
- selected: prop_types_1.default.array,
139
- data: prop_types_1.default.array,
140
- filterText: prop_types_1.default.string,
141
- titleText: prop_types_1.default.string,
142
- onClose: prop_types_1.default.func,
143
- onListItemClick: prop_types_1.default.func,
144
- onSearch: prop_types_1.default.func,
145
- renderGroupTitle: prop_types_1.default.func
146
- };
147
- exports.ConfigureColumnsPopup.defaultProps = {
148
- data: [],
149
- selected: [],
150
- titleText: ui_i18n_1.default.text('Show/hide columns'),
151
- filterText: ''
152
- };
@@ -53,13 +53,13 @@ var withContext_1 = require("../HOCs/withContext");
53
53
  var ConfigPermissionsContext_1 = require("../contexts/ConfigPermissionsContext");
54
54
  var ScrollToElementContext_1 = require("../contexts/ScrollToElementContext");
55
55
  var HiddenAttributesContext_1 = require("../contexts/HiddenAttributesContext");
56
- var AllwaysVisibleAttributesContext_1 = require("../contexts/AllwaysVisibleAttributesContext");
56
+ var AlwaysVisibleAttributesContext_1 = require("../contexts/AlwaysVisibleAttributesContext");
57
57
  var EditModeAttributesList = function (_a) {
58
58
  var parentAttributeType = _a.parentAttributeType, attrTypes = _a.attrTypes, entity = _a.entity, parentUri = _a.parentUri, showEmptyEditors = _a.showEmptyEditors, mode = _a.mode, crosswalks = _a.crosswalks, drawLines = _a.drawLines, children = _a.children, className = _a.className, _b = _a.fixedTypeUris, fixedTypeUris = _b === void 0 ? constants_1.FIXED_TYPE_URIS : _b, onAddAttributes = _a.onAddAttributes, onChangeAttribute = _a.onChangeAttribute, onDeleteAttribute = _a.onDeleteAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, showNonOv = _a.showNonOv, highlightAttribute = _a.highlightAttribute;
59
59
  var hiddenAttributes = (0, react_1.useContext)(HiddenAttributesContext_1.HiddenAttributesContext);
60
60
  var entityUri = parentUri && (0, mdm_sdk_1.getBaseUri)(parentUri);
61
61
  var currentEntityHiddenAttributes = (0, react_1.useMemo)(function () { return hiddenAttributes[entityUri] || []; }, [hiddenAttributes, entityUri]);
62
- var alwaysVisibleAttributes = (0, react_1.useContext)(AllwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext);
62
+ var alwaysVisibleAttributes = (0, react_1.useContext)(AlwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext);
63
63
  var filteredAttrTypes = (0, react_1.useMemo)(function () { return attrTypes.filter(function (attrType) { return !currentEntityHiddenAttributes.includes(attrType.uri); }); }, [attrTypes, currentEntityHiddenAttributes]);
64
64
  var _c = entity.attributes, attributes = _c === void 0 ? {} : _c;
65
65
  var _d = (0, react_1.useState)({}), hasDeletionsMap = _d[0], setHasDeletionsMap = _d[1];
@@ -64,7 +64,7 @@ var react_1 = __importDefault(require("react"));
64
64
  var jsdom_testing_mocks_1 = require("jsdom-testing-mocks");
65
65
  var react_2 = require("@testing-library/react");
66
66
  var user_event_1 = __importDefault(require("@testing-library/user-event"));
67
- var x_date_pickers_1 = require("@mui/x-date-pickers");
67
+ var LocalizationProvider_1 = require("@mui/x-date-pickers/LocalizationProvider");
68
68
  var AdapterMoment_1 = require("@mui/x-date-pickers/AdapterMoment");
69
69
  var mdm_sdk_1 = require("@reltio/mdm-sdk");
70
70
  var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
@@ -114,7 +114,7 @@ var setUp = function (_a) {
114
114
  var Providers = function (_a) {
115
115
  var children = _a.children;
116
116
  return (react_1.default.createElement(CustomProviders, null,
117
- react_1.default.createElement(x_date_pickers_1.LocalizationProvider, { dateAdapter: AdapterMoment_1.AdapterMoment },
117
+ react_1.default.createElement(LocalizationProvider_1.LocalizationProvider, { dateAdapter: AdapterMoment_1.AdapterMoment },
118
118
  react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues, actions: mdmActions },
119
119
  react_1.default.createElement(HiddenAttributesContext_1.HiddenAttributesContext.Provider, { value: hiddenAttributesContextValue },
120
120
  react_1.default.createElement(PinnedAttributesContext_1.PinnedAttributesContext.Provider, { value: pinnedAttributesContextValue },
@@ -39,7 +39,7 @@ var ShowMore_1 = require("../../../ShowMore");
39
39
  var EditModeAttributesFactory_1 = require("../../../EditModeAttributesFactory");
40
40
  var CardinalityMessage_1 = require("../../../CardinalityMessage");
41
41
  var PinnedAttributesContext_1 = require("../../../contexts/PinnedAttributesContext");
42
- var AllwaysVisibleAttributesContext_1 = require("../../../contexts/AllwaysVisibleAttributesContext");
42
+ var AlwaysVisibleAttributesContext_1 = require("../../../contexts/AlwaysVisibleAttributesContext");
43
43
  var DescriptionIcon_1 = require("../../../DescriptionIcon");
44
44
  var ControlAttributeIcon_1 = require("../../../ControlAttributeIcon");
45
45
  var useScrollToAttribute_1 = require("../../../hooks/useScrollToAttribute");
@@ -57,7 +57,7 @@ var AttributeRenderer = function (_a) {
57
57
  var _d = (0, useScrollToAttributeError_1.useScrollToAttributeError)({ highlightedError: highlightedError }), errorRef = _d.ref, errorClassName = _d.errorClassName;
58
58
  var _e = (0, useScrollToAttribute_1.useScrollToAttribute)(highlightedAttribute), attributeRef = _e.ref, highlightedClassName = _e.highlightedClassName;
59
59
  var pinnedAttributes = (0, react_1.useContext)(PinnedAttributesContext_1.PinnedAttributesContext);
60
- var alwaysVisibleAttributes = (0, react_1.useContext)(AllwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext);
60
+ var alwaysVisibleAttributes = (0, react_1.useContext)(AlwaysVisibleAttributesContext_1.AlwaysVisibleAttributesContext);
61
61
  var isPinned = (0, react_1.useMemo)(function () { return pinnedAttributes === null || pinnedAttributes === void 0 ? void 0 : pinnedAttributes.includes(attributeTypeUri); }, [attributeTypeUri, pinnedAttributes]);
62
62
  var isAlwaysVisible = (0, react_1.useMemo)(function () { return alwaysVisibleAttributes === null || alwaysVisibleAttributes === void 0 ? void 0 : alwaysVisibleAttributes.includes(attributeTypeUri); }, [attributeTypeUri, alwaysVisibleAttributes]);
63
63
  var isEmptyValues = (0, mdm_sdk_1.isEmptyValue)(values);
@@ -8,8 +8,9 @@ type Classes = {
8
8
  root?: string;
9
9
  label?: string;
10
10
  };
11
+ type Item = TEntityType | TRelationType;
11
12
  type Props = {
12
- items: (TEntityType | TRelationType)[];
13
+ items: Item[];
13
14
  selectedItemsUris: string[];
14
15
  onChange: (values: string[]) => void;
15
16
  label: string;
@@ -1,18 +1,17 @@
1
1
  import React from 'react';
2
2
  import { TEntityType, TRelationType } from '@reltio/mdm-sdk';
3
3
  import { AttributeListItem } from '../../../AttributeListItem';
4
+ import { VirtualGroupedListMainItem } from '../../../VirtualGroupedList';
4
5
  type AttributeListItemProps = React.ComponentPropsWithoutRef<typeof AttributeListItem>;
5
- type Item = {
6
- item: {
7
- item: TEntityType | TRelationType;
8
- };
9
- index: number;
6
+ type Item = (TEntityType | TRelationType) & {
7
+ filterText?: string;
8
+ LogoIcon?: React.ComponentType;
10
9
  };
11
10
  type Props = {
12
11
  selectedItems: string[];
13
12
  onItemClick: AttributeListItemProps['onClick'];
14
13
  focusIndex: number;
15
- items: Item[];
14
+ items: VirtualGroupedListMainItem<Item>[];
16
15
  width: number;
17
16
  height: number;
18
17
  };
@@ -14,7 +14,7 @@ export type GroupedItem = {
14
14
  items?: GroupedItem[];
15
15
  };
16
16
  export declare const useMoreAttributesItems: ({ data, parent, filter }: Props) => {
17
- items: any;
17
+ items: import("../VirtualGroupedList").VirtualGroupedListMainItem<Item>[];
18
18
  hasGroups: boolean;
19
19
  parentGroupLength: number;
20
20
  attributesGroupLength: number;