@reltio/components 1.4.2071 → 1.4.2072
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AttributesView/AttributesView.js +1 -1
- package/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
- package/ColumnsSettings/helpers.d.ts +3 -1
- package/ColumnsSettings/types.d.ts +8 -0
- package/CommentsContainer/CommentsContainer.js +1 -1
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
- package/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
- package/EditModeAttributesList/EditModeAttributesList.js +1 -1
- package/EditModeAttributesPager/EditModeAttributesPager.test.js +1 -1
- package/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +1 -1
- package/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
- package/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
- package/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
- package/ReadOnlyAttributesList/ReadOnlyAttributesList.js +1 -1
- package/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +1 -1
- package/ReadOnlyAttributesView/ReadOnlyAttributesView.js +1 -1
- package/ScrollableTabs/ScrollableTabs.test.js +69 -19
- package/SearchHighlighter/SearchHighlighter.test.js +18 -7
- package/SelectAttributesList/SelectAttributesList.d.ts +11 -6
- package/SelectAttributesList/SelectAttributesList.js +5 -2
- package/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
- package/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
- package/SidePanelContentHeader/SidePanelContentHeader.test.js +104 -0
- package/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
- package/SidePanelEmptyState/SidePanelEmptyState.test.js +24 -0
- package/SimpleAttribute/SimpleAttribute.js +1 -1
- package/SimpleAttribute/SimpleAttribute.test.js +155 -80
- package/SimpleAttributeEditor/SimpleAttributeEditor.test.js +339 -330
- package/SimpleAttributeEditor/useAttributeValuePermissions.js +1 -1
- package/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
- package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
- package/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +128 -32
- package/SmallIconButton/SmallIconButton.test.js +98 -25
- package/TableWithBars/TableWithBars.test.js +98 -60
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/Tags/Tags.d.ts +0 -1
- package/Tags/Tags.test.js +8 -7
- package/TransitiveMatchBlock/TransitiveMatchBlock.test.js +78 -22
- package/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
- package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
- package/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
- package/UploadFileButton/UploadFileButton.d.ts +2 -2
- package/UploadFileButton/UploadFileButton.test.js +199 -0
- package/UploadImageDialog/UploadImageDialog.test.js +1 -0
- package/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
- package/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
- package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
- package/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
- package/ValueChip/ValueChip.test.js +7 -23
- package/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
- package/VirtualGroupedList/VirtualGroupedList.js +11 -36
- package/VirtualGroupedList/VirtualGroupedList.test.js +224 -0
- package/VirtualGroupedList/helpers.d.ts +7 -2
- package/VirtualGroupedList/helpers.js +3 -1
- package/VirtualGroupedList/index.d.ts +1 -1
- package/VirtualGroupedList/types.d.ts +10 -6
- package/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
- package/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
- package/cjs/AttributesView/AttributesView.js +2 -2
- package/cjs/ColumnsSettings/components/ColumnsSettingsPopup/ColumnsSettingsPopup.d.ts +2 -3
- package/cjs/ColumnsSettings/helpers.d.ts +3 -1
- package/cjs/ColumnsSettings/types.d.ts +8 -0
- package/cjs/ColumnsSettings/types.js +2 -0
- package/cjs/CommentsContainer/CommentsContainer.js +1 -1
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.d.ts +23 -40
- package/cjs/ConfigureColumnsPopup/ConfigureColumnsPopup.js +6 -26
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +2 -2
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.test.js +2 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.js +2 -2
- package/cjs/MetadataTypesSelector/MetadataTypesSelector.d.ts +2 -1
- package/cjs/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts +5 -6
- package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +1 -1
- package/cjs/ReadOnlyAttributesList/ReadOnlyAttributesList.js +2 -2
- package/cjs/ReadOnlyAttributesPager/ReadOnlyAttributesPager.js +2 -2
- package/cjs/ReadOnlyAttributesView/ReadOnlyAttributesView.js +2 -2
- package/cjs/ScrollableTabs/ScrollableTabs.test.js +69 -19
- package/cjs/SearchHighlighter/SearchHighlighter.test.js +18 -7
- package/cjs/SelectAttributesList/SelectAttributesList.d.ts +11 -6
- package/cjs/SelectAttributesList/SelectAttributesList.js +5 -2
- package/cjs/SelectorWithOnlyOptionAutoSelect/SelectorWithOnlyOptionAutoSelect.test.js +109 -60
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.js +2 -2
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.test.js +109 -0
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.js +1 -1
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.test.js +29 -0
- package/cjs/SimpleAttribute/SimpleAttribute.js +1 -1
- package/cjs/SimpleAttribute/SimpleAttribute.test.js +155 -80
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.test.js +338 -352
- package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.js +2 -2
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.test.js +86 -10
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.js +1 -1
- package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -1
- package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.test.js +127 -31
- package/cjs/SmallIconButton/SmallIconButton.test.js +98 -25
- package/cjs/TableWithBars/TableWithBars.test.js +98 -60
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.js +1 -1
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/cjs/Tags/Tags.d.ts +0 -1
- package/cjs/Tags/Tags.test.js +8 -7
- package/cjs/TransitiveMatchBlock/TransitiveMatchBlock.test.js +77 -21
- package/cjs/TransitiveMatchRule/TransitiveMatchRule.test.js +78 -37
- package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.js +1 -1
- package/cjs/TransitiveMatchRulesTooltip/TransitiveMatchRulesTooltip.test.js +12 -18
- package/cjs/UploadFileButton/UploadFileButton.d.ts +2 -2
- package/cjs/UploadFileButton/UploadFileButton.test.js +204 -0
- package/cjs/UploadImageDialog/UploadImageDialog.test.js +1 -0
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.js +1 -1
- package/cjs/UploadImageDialog/components/ErrorSnackbar/ErrorSnackbar.test.js +80 -22
- package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.js +1 -1
- package/cjs/UploadImageDialog/components/ImageByUrlField/ImageByUrlField.test.js +162 -49
- package/cjs/ValueChip/ValueChip.test.js +7 -23
- package/cjs/VirtualGroupedList/VirtualGroupedList.d.ts +19 -31
- package/cjs/VirtualGroupedList/VirtualGroupedList.js +11 -36
- package/cjs/VirtualGroupedList/VirtualGroupedList.test.js +252 -0
- package/cjs/VirtualGroupedList/helpers.d.ts +7 -2
- package/cjs/VirtualGroupedList/helpers.js +3 -1
- package/cjs/VirtualGroupedList/index.d.ts +1 -1
- package/cjs/VirtualGroupedList/types.d.ts +10 -6
- package/cjs/VirtualGroupedList/useScrollToFocusItem.d.ts +8 -5
- package/cjs/WhiteSearchInput/{WhiteSearchInput.spec.js → WhiteSearchInput.test.js} +3 -8
- package/cjs/features/crosswalks/hooks/useAttributeActions.test.js +24 -25
- package/cjs/features/crosswalks/hooks/useCrosswalkActions.test.js +10 -11
- package/cjs/features/workflow/hooks/useChangeRequest.test.js +5 -6
- package/cjs/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +8 -9
- package/cjs/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
- package/features/crosswalks/hooks/useAttributeActions.test.js +1 -2
- package/features/crosswalks/hooks/useCrosswalkActions.test.js +1 -2
- package/features/workflow/hooks/useChangeRequest.test.js +1 -2
- package/hooks/useCommentsEntitiesMap/useCommentsEntitiesMap.test.js +1 -2
- package/hooks/useKeyboardNavigation/useKeyboardNavigation.d.ts +9 -13
- package/package.json +1 -1
- package/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -49
- package/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -24
- package/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -103
- package/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -13
- package/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -21
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -20
- package/UploadFileButton/UploadFileButton.spec.js +0 -219
- package/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -9
- package/VirtualGroupedList/VirtualGroupedList.spec.js +0 -282
- package/cjs/SidePanelContentHeader/SidePanelContentHeader.spec.js +0 -54
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.d.ts +0 -1
- package/cjs/SidePanelEmptyState/SidePanelEmptyState.spec.js +0 -29
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts +0 -1
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.js +0 -108
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts +0 -1
- package/cjs/SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.js +0 -18
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts +0 -1
- package/cjs/TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.js +0 -26
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts +0 -1
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.js +0 -25
- package/cjs/UploadFileButton/UploadFileButton.spec.d.ts +0 -1
- package/cjs/UploadFileButton/UploadFileButton.spec.js +0 -224
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts +0 -1
- package/cjs/UploadImageDialog/components/DividerWithText/DividerWithText.test.js +0 -14
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.d.ts +0 -1
- package/cjs/VirtualGroupedList/VirtualGroupedList.spec.js +0 -287
- package/cjs/WhiteSearchInput/WhiteSearchInput.spec.d.ts +0 -1
- /package/{SidePanelContentHeader/SidePanelContentHeader.spec.d.ts → ColumnsSettings/types.js} +0 -0
- /package/{SidePanelEmptyState/SidePanelEmptyState.spec.d.ts → SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
- /package/{SimpleAttributeEditor/SimpleAttributeEditorWithoutPermissions.test.d.ts → SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
- /package/{SimpleDropDownSelector/components/DropDownPlaceholder/DropDownPlaceholder.test.d.ts → UploadFileButton/UploadFileButton.test.d.ts} +0 -0
- /package/{TableWithBars/components/AttributeCellRenderer/AttributeCellRenderer.test.d.ts → VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
- /package/{TableWithBars/components/HeadCellRenderer/HeadCellRenderer.test.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
- /package/{UploadFileButton/UploadFileButton.spec.d.ts → cjs/SidePanelContentHeader/SidePanelContentHeader.test.d.ts} +0 -0
- /package/{UploadImageDialog/components/DividerWithText/DividerWithText.test.d.ts → cjs/SidePanelEmptyState/SidePanelEmptyState.test.d.ts} +0 -0
- /package/{VirtualGroupedList/VirtualGroupedList.spec.d.ts → cjs/UploadFileButton/UploadFileButton.test.d.ts} +0 -0
- /package/{WhiteSearchInput/WhiteSearchInput.spec.d.ts → cjs/VirtualGroupedList/VirtualGroupedList.test.d.ts} +0 -0
- /package/cjs/{SidePanelContentHeader/SidePanelContentHeader.spec.d.ts → WhiteSearchInput/WhiteSearchInput.test.d.ts} +0 -0
- /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
- /package/cjs/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
- /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.d.ts +0 -0
- /package/contexts/{AllwaysVisibleAttributesContext → AlwaysVisibleAttributesContext}/index.js +0 -0
|
@@ -26,7 +26,7 @@ import { ReadOnlyAttributesView } from '../ReadOnlyAttributesView';
|
|
|
26
26
|
import { EditModeAttributesView } from '../EditModeAttributesView';
|
|
27
27
|
import { EntityContext } from '../contexts/EntityContext';
|
|
28
28
|
import { useMdmEntityWithDiff, useMdmMode } from '../contexts/MdmModuleContext';
|
|
29
|
-
import { AlwaysVisibleAttributesContext } from '../contexts/
|
|
29
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
|
|
30
30
|
export var AttributesView = function (_a) {
|
|
31
31
|
var attributesCount = _a.attributesCount, pinnedAttributes = _a.pinnedAttributes, _b = _a.alwaysVisible, alwaysVisible = _b === void 0 ? [] : _b, restProps = __rest(_a, ["attributesCount", "pinnedAttributes", "alwaysVisible"]);
|
|
32
32
|
var mdmEntity = useMdmEntityWithDiff();
|
|
@@ -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) =>
|
|
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 };
|
|
@@ -53,7 +53,7 @@ export var CommentsContainer = function (_a) {
|
|
|
53
53
|
var allRelatedObjectUris = useMemo(function () {
|
|
54
54
|
return additionalRelatedObjectUris ? __spreadArray(__spreadArray([], relatedObjectUris, true), additionalRelatedObjectUris, true) : relatedObjectUris;
|
|
55
55
|
}, [additionalRelatedObjectUris, relatedObjectUris]);
|
|
56
|
-
return (showComments && (React.createElement("div", { className: classnames(styles.root, className) },
|
|
56
|
+
return (showComments && (React.createElement("div", { "data-reltio-id": "comments-container", className: classnames(styles.root, className) },
|
|
57
57
|
shouldShowAddCommentButton && (React.createElement(AddCommentButton, { className: classnames(styles.addButton, (_b = {},
|
|
58
58
|
_b[styles.showAlways] = showAlways || isOpenPopupWithNewComment,
|
|
59
59
|
_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
|
|
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 {};
|
|
@@ -30,22 +30,21 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
30
30
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
31
|
};
|
|
32
32
|
import React, { useCallback, useMemo, useRef } from 'react';
|
|
33
|
-
import PropTypes from 'prop-types';
|
|
34
33
|
import i18n from 'ui-i18n';
|
|
35
34
|
import classnames from 'classnames';
|
|
36
35
|
import { chain, curry, map } from 'ramda';
|
|
37
36
|
import { getMaxItemWidth } from '@reltio/mdm-sdk';
|
|
37
|
+
import { Highlighter } from '../Highlighter';
|
|
38
38
|
import { SelectionPopup } from '../SelectionPopup';
|
|
39
|
+
import { AttributeListItem } from '../AttributeListItem';
|
|
39
40
|
import { VirtualGroupedList, flattenGroupedItemsData } from '../VirtualGroupedList';
|
|
40
41
|
import { useKeyboardNavigation } from '../hooks/useKeyboardNavigation';
|
|
41
|
-
import { AttributeListItem } from '../AttributeListItem';
|
|
42
|
-
import { Highlighter } from '../Highlighter';
|
|
43
42
|
import { useStyles } from './styles';
|
|
44
43
|
var ITEM_HEIGHT = 32;
|
|
45
44
|
var LIST_CONTAINER_HEIGHT = 300;
|
|
46
45
|
var DEFAULT_MIN_CONTAINER_WIDTH = 308;
|
|
47
46
|
export var ConfigureColumnsPopup = function (_a) {
|
|
48
|
-
var open = _a.open, anchorEl = _a.anchorEl,
|
|
47
|
+
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 ? i18n.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"]);
|
|
49
48
|
var filterItem = useCallback(function (item) {
|
|
50
49
|
return item.label.toLowerCase().includes(filterText.toLowerCase());
|
|
51
50
|
}, [filterText]);
|
|
@@ -82,12 +81,12 @@ export var ConfigureColumnsPopup = function (_a) {
|
|
|
82
81
|
}, [onListItemClick, selected]);
|
|
83
82
|
var groupedItems = useMemo(function () { return (renderGroupTitle ? getGroupsData : getAttributesData)(data); }, [data, renderGroupTitle, getGroupsData, getAttributesData]);
|
|
84
83
|
var items = useMemo(function () { return flattenGroupedItemsData(groupedItems); }, [groupedItems]);
|
|
85
|
-
var
|
|
84
|
+
var _f = useKeyboardNavigation({
|
|
86
85
|
items: items,
|
|
87
86
|
open: open,
|
|
88
87
|
onSelectFocusedItem: handleSearchOnEnter,
|
|
89
88
|
selectedItems: selected
|
|
90
|
-
}), focusIndex =
|
|
89
|
+
}), focusIndex = _f.focusIndex, handleKeyDown = _f.handleKeyDown;
|
|
91
90
|
var focusIndexRef = useRef(null);
|
|
92
91
|
focusIndexRef.current = focusIndex;
|
|
93
92
|
var renderListItem = useCallback(function (style, _a, index) {
|
|
@@ -99,24 +98,5 @@ export var ConfigureColumnsPopup = function (_a) {
|
|
|
99
98
|
var containerWidth = getMaxItemWidth('label')(groupedItems) || DEFAULT_MIN_CONTAINER_WIDTH;
|
|
100
99
|
var classes = useStyles();
|
|
101
100
|
return (React.createElement(SelectionPopup, __assign({ open: open, className: classnames(classes.container, classes.popupContainer), anchorEl: anchorEl, onClose: onClose, onSearch: onSearch, title: titleText, containerWidth: containerWidth, searchInputOnKeyDown: handleKeyDown }, otherProps),
|
|
102
|
-
React.createElement(VirtualGroupedList, { height: LIST_CONTAINER_HEIGHT, renderItem: renderListItem, items: items, hideSubtitles: true, getItemSize: getItemSize,
|
|
103
|
-
};
|
|
104
|
-
ConfigureColumnsPopup.propTypes = {
|
|
105
|
-
open: PropTypes.bool,
|
|
106
|
-
hideCheckBox: PropTypes.bool,
|
|
107
|
-
anchorEl: PropTypes.any,
|
|
108
|
-
selected: PropTypes.array,
|
|
109
|
-
data: PropTypes.array,
|
|
110
|
-
filterText: PropTypes.string,
|
|
111
|
-
titleText: PropTypes.string,
|
|
112
|
-
onClose: PropTypes.func,
|
|
113
|
-
onListItemClick: PropTypes.func,
|
|
114
|
-
onSearch: PropTypes.func,
|
|
115
|
-
renderGroupTitle: PropTypes.func
|
|
116
|
-
};
|
|
117
|
-
ConfigureColumnsPopup.defaultProps = {
|
|
118
|
-
data: [],
|
|
119
|
-
selected: [],
|
|
120
|
-
titleText: i18n.text('Show/hide columns'),
|
|
121
|
-
filterText: ''
|
|
101
|
+
React.createElement(VirtualGroupedList, { height: LIST_CONTAINER_HEIGHT, renderItem: renderListItem, items: items, hideSubtitles: true, getItemSize: getItemSize, focusIndex: focusIndex, renderGroupTitle: renderGroupTitle })));
|
|
122
102
|
};
|
|
@@ -25,7 +25,7 @@ import { withContext } from '../HOCs/withContext';
|
|
|
25
25
|
import { ConfigPermissionsContext } from '../contexts/ConfigPermissionsContext';
|
|
26
26
|
import { ScrollType, ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
27
27
|
import { HiddenAttributesContext } from '../contexts/HiddenAttributesContext';
|
|
28
|
-
import { AlwaysVisibleAttributesContext } from '../contexts/
|
|
28
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
|
|
29
29
|
var EditModeAttributesList = function (_a) {
|
|
30
30
|
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 ? FIXED_TYPE_URIS : _b, onAddAttributes = _a.onAddAttributes, onChangeAttribute = _a.onChangeAttribute, onDeleteAttribute = _a.onDeleteAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, showNonOv = _a.showNonOv, highlightAttribute = _a.highlightAttribute;
|
|
31
31
|
var hiddenAttributes = useContext(HiddenAttributesContext);
|
|
@@ -59,7 +59,7 @@ import React from 'react';
|
|
|
59
59
|
import { mockResizeObserver } from 'jsdom-testing-mocks';
|
|
60
60
|
import { act, render, screen, within } from '@testing-library/react';
|
|
61
61
|
import userEvent from '@testing-library/user-event';
|
|
62
|
-
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
62
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
63
63
|
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
64
64
|
import { DataTypes, EntityAttrTypes, ErrorSource, ErrorType, Mode } from '@reltio/mdm-sdk';
|
|
65
65
|
import { MdmModuleProvider } from '../contexts/MdmModuleContext';
|
|
@@ -11,7 +11,7 @@ import { ShowMore } from '../../../ShowMore';
|
|
|
11
11
|
import { EditModeAttribute } from '../../../EditModeAttributesFactory';
|
|
12
12
|
import { CardinalityMessage } from '../../../CardinalityMessage';
|
|
13
13
|
import { PinnedAttributesContext } from '../../../contexts/PinnedAttributesContext';
|
|
14
|
-
import { AlwaysVisibleAttributesContext } from '../../../contexts/
|
|
14
|
+
import { AlwaysVisibleAttributesContext } from '../../../contexts/AlwaysVisibleAttributesContext';
|
|
15
15
|
import { DescriptionIcon } from '../../../DescriptionIcon';
|
|
16
16
|
import { ControlAttributeIcon } from '../../../ControlAttributeIcon';
|
|
17
17
|
import { useScrollToAttribute } from '../../../hooks/useScrollToAttribute';
|
|
@@ -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:
|
|
13
|
+
items: Item[];
|
|
13
14
|
selectedItemsUris: string[];
|
|
14
15
|
onChange: (values: string[]) => void;
|
|
15
16
|
label: string;
|
package/MetadataTypesSelector/components/SelectMetadataTypesList/SelectMetadataTypesList.d.ts
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
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:
|
|
17
|
+
items: import("../VirtualGroupedList").VirtualGroupedListMainItem<Item>[];
|
|
18
18
|
hasGroups: boolean;
|
|
19
19
|
parentGroupLength: number;
|
|
20
20
|
attributesGroupLength: number;
|
|
@@ -19,7 +19,7 @@ import { ShowLess } from '../ShowLess';
|
|
|
19
19
|
import { FIXED_TYPE_URIS } from '../constants';
|
|
20
20
|
import { splitPagersData } from '../helpers/attributesView';
|
|
21
21
|
import { HiddenAttributesContext } from '../contexts/HiddenAttributesContext';
|
|
22
|
-
import { AlwaysVisibleAttributesContext } from '../contexts/
|
|
22
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
|
|
23
23
|
var ReadOnlyAttributesList = function (_a) {
|
|
24
24
|
var _b = _a.attrTypes, attrTypes = _b === void 0 ? [] : _b, entity = _a.entity, parentUri = _a.parentUri, drawLines = _a.drawLines, children = _a.children, className = _a.className, max = _a.max, _c = _a.fixedTypeUris, fixedTypeUris = _c === void 0 ? FIXED_TYPE_URIS : _c, showNonOv = _a.showNonOv, classes = _a.classes;
|
|
25
25
|
var hiddenAttributes = useContext(HiddenAttributesContext);
|
|
@@ -20,7 +20,7 @@ import { SpecialRenderer } from './components/SpecialRenderer';
|
|
|
20
20
|
import { ImageLineRenderer } from './components/ImageLineRenderer';
|
|
21
21
|
import { EmptyRenderer } from './components/EmptyRenderer';
|
|
22
22
|
import { useMdmAction, useMdmMaxValuesInResponse } from '../contexts/MdmModuleContext';
|
|
23
|
-
import { AlwaysVisibleAttributesContext } from '../contexts/
|
|
23
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
|
|
24
24
|
import { useStyles } from './styles';
|
|
25
25
|
var RENDERER_TYPES = {
|
|
26
26
|
oneLine: 'oneLine',
|
|
@@ -6,7 +6,7 @@ import Box from '@mui/material/Box';
|
|
|
6
6
|
import Typography from '@mui/material/Typography';
|
|
7
7
|
import { PivotingAttributeContext } from '../contexts/PivotingAttributeContext';
|
|
8
8
|
import { useMdmMetadata, useMdmPivotingAttributes } from '../contexts/MdmModuleContext';
|
|
9
|
-
import { AlwaysVisibleAttributesContext } from '../contexts/
|
|
9
|
+
import { AlwaysVisibleAttributesContext } from '../contexts/AlwaysVisibleAttributesContext';
|
|
10
10
|
import { BasicView } from '../BasicView';
|
|
11
11
|
import { FacetViewHeader } from '../FacetViewHeader';
|
|
12
12
|
import { ReadOnlyAttributesList } from '../ReadOnlyAttributesList';
|
|
@@ -9,13 +9,47 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
import React from 'react';
|
|
13
|
-
import { mount, shallow } from 'enzyme';
|
|
14
49
|
import { range } from 'ramda';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
50
|
+
import { render, screen, within } from '@testing-library/react';
|
|
51
|
+
import userEvent from '@testing-library/user-event';
|
|
17
52
|
import { ScrollableTabs } from './ScrollableTabs';
|
|
18
|
-
import { ExpandedValueTooltip } from '../ExpandedValueTooltip';
|
|
19
53
|
describe('ScrollableTabs', function () {
|
|
20
54
|
var generateTabs = function (count, additionalLabel) {
|
|
21
55
|
if (additionalLabel === void 0) { additionalLabel = false; }
|
|
@@ -26,23 +60,39 @@ describe('ScrollableTabs', function () {
|
|
|
26
60
|
tabs: generateTabs(3),
|
|
27
61
|
onChange: jest.fn()
|
|
28
62
|
};
|
|
63
|
+
var setUp = function (props) {
|
|
64
|
+
if (props === void 0) { props = {}; }
|
|
65
|
+
var user = userEvent.setup();
|
|
66
|
+
return __assign({ user: user }, render(React.createElement(ScrollableTabs, __assign({}, defaultProps, props))));
|
|
67
|
+
};
|
|
29
68
|
it('should render main parts', function () {
|
|
30
|
-
|
|
31
|
-
expect(
|
|
32
|
-
|
|
33
|
-
expect(
|
|
34
|
-
expect(
|
|
69
|
+
setUp();
|
|
70
|
+
expect(screen.getByRole('tablist')).toBeInTheDocument();
|
|
71
|
+
var tabs = screen.getAllByRole('tab');
|
|
72
|
+
expect(tabs).toHaveLength(3);
|
|
73
|
+
expect(tabs[0]).toHaveTextContent('label0');
|
|
74
|
+
expect(tabs[1]).toHaveTextContent('label1');
|
|
75
|
+
expect(tabs[2]).toHaveTextContent('label2');
|
|
35
76
|
});
|
|
36
77
|
it('should render additional label', function () {
|
|
37
|
-
var additionalLabel = React.createElement("div", {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var wrapper = shallow(React.createElement(ScrollableTabs, __assign({}, defaultProps)));
|
|
43
|
-
var event = {};
|
|
44
|
-
var value = 'value2';
|
|
45
|
-
wrapper.find(Tabs).prop('onChange')(event, value);
|
|
46
|
-
expect(defaultProps.onChange).toHaveBeenCalledWith(value);
|
|
78
|
+
var additionalLabel = React.createElement("div", { "data-reltio-id": "additional-label" });
|
|
79
|
+
setUp({ tabs: generateTabs(1, additionalLabel) });
|
|
80
|
+
var tab = screen.getByRole('tab');
|
|
81
|
+
expect(tab).toHaveTextContent('label0');
|
|
82
|
+
expect(within(tab).getByTestId('additional-label')).toBeInTheDocument();
|
|
47
83
|
});
|
|
84
|
+
it('should call prop onChange', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var user;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
user = setUp().user;
|
|
90
|
+
return [4 /*yield*/, user.click(screen.getByText('label2'))];
|
|
91
|
+
case 1:
|
|
92
|
+
_a.sent();
|
|
93
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith('value2');
|
|
94
|
+
return [2 /*return*/];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); });
|
|
48
98
|
});
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { SearchValueContext } from '../contexts/SearchValueContext';
|
|
4
4
|
import { SearchHighlighter } from './SearchHighlighter';
|
|
5
|
-
import { Highlighter } from '../Highlighter';
|
|
6
5
|
describe('SearchHighlighter test', function () {
|
|
7
6
|
it('should render SearchHighlighter as well', function () {
|
|
8
7
|
var highlightedValue = '1';
|
|
9
8
|
var attributeValue = 'Attribute 1 Label';
|
|
10
|
-
var
|
|
11
|
-
React.createElement(SearchHighlighter, { text: attributeValue })));
|
|
12
|
-
|
|
13
|
-
expect(
|
|
14
|
-
expect(
|
|
9
|
+
var container = render(React.createElement(SearchValueContext.Provider, { value: highlightedValue },
|
|
10
|
+
React.createElement(SearchHighlighter, { text: attributeValue }))).container;
|
|
11
|
+
var highlightedText = screen.getByText(highlightedValue);
|
|
12
|
+
expect(highlightedText).toBeInTheDocument();
|
|
13
|
+
expect(highlightedText).toHaveClass('highlightedText');
|
|
14
|
+
expect(container).toHaveTextContent(attributeValue);
|
|
15
|
+
});
|
|
16
|
+
it('should work without SearchValueContext', function () {
|
|
17
|
+
render(React.createElement(SearchHighlighter, { text: 'Attribute text' }));
|
|
18
|
+
expect(screen.getByText('Attribute text')).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
it('should work without highlighted value', function () {
|
|
21
|
+
var attributeValue = 'Attribute 1 Label';
|
|
22
|
+
var container = render(React.createElement(SearchValueContext.Provider, { value: undefined },
|
|
23
|
+
React.createElement(SearchHighlighter, { text: attributeValue }))).container;
|
|
24
|
+
expect(container).toHaveTextContent(attributeValue);
|
|
25
|
+
expect(container.querySelector('.highlightedText')).toBeNull();
|
|
15
26
|
});
|
|
16
27
|
});
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { VirtualGroupedList } from '../VirtualGroupedList';
|
|
3
3
|
import { AttributeSelectorItem } from '../types';
|
|
4
|
-
type Data = {
|
|
5
|
-
|
|
4
|
+
type Data = AttributeSelectorItem & {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
filterText?: string;
|
|
8
|
+
notSelectable?: boolean;
|
|
9
|
+
needGroupIcon?: boolean;
|
|
10
|
+
LogoIcon?: React.ElementType;
|
|
6
11
|
};
|
|
7
|
-
type Props = {
|
|
12
|
+
type Props = Omit<React.ComponentProps<typeof VirtualGroupedList>, 'renderItem' | 'getItemSize'> & {
|
|
8
13
|
selectedAttributes: AttributeSelectorItem[];
|
|
9
14
|
focusIndex: number;
|
|
10
15
|
hideCheckBox: boolean;
|
|
11
16
|
onItemClick: (data: Data, checked: boolean, groupId: string) => void;
|
|
12
|
-
}
|
|
13
|
-
declare const _default:
|
|
17
|
+
};
|
|
18
|
+
declare const _default: ({ selectedAttributes, onItemClick, focusIndex, hideCheckBox, ...otherProps }: Props) => React.JSX.Element;
|
|
14
19
|
export default _default;
|
|
@@ -34,7 +34,9 @@ var ITEM_GROUP_TITLE_HEIGHT = 40;
|
|
|
34
34
|
var SelectAttributesList = function (_a) {
|
|
35
35
|
var selectedAttributes = _a.selectedAttributes, onItemClick = _a.onItemClick, focusIndex = _a.focusIndex, hideCheckBox = _a.hideCheckBox, otherProps = __rest(_a, ["selectedAttributes", "onItemClick", "focusIndex", "hideCheckBox"]);
|
|
36
36
|
var metadata = useMdmMetadata();
|
|
37
|
-
var getItemSize = function (i, item) {
|
|
37
|
+
var getItemSize = function (i, item) {
|
|
38
|
+
return item.items ? ITEM_GROUP_TITLE_HEIGHT : ITEM_HEIGHT;
|
|
39
|
+
};
|
|
38
40
|
var renderGroupTitle = function (style, item) { return (React.createElement(ListItem, { component: 'div', className: styles.subHeader, style: style, key: "group-".concat(item.item.id) },
|
|
39
41
|
item.item.needGroupIcon && React.createElement(AttributeGroupIcon, { group: item.item, metadata: metadata }),
|
|
40
42
|
React.createElement("div", { className: styles.subHeaderTitle }, item.item.title))); };
|
|
@@ -46,4 +48,5 @@ var SelectAttributesList = function (_a) {
|
|
|
46
48
|
};
|
|
47
49
|
return (React.createElement(VirtualGroupedList, __assign({ getItemSize: getItemSize, renderItem: renderItem, renderGroupTitle: renderGroupTitle, focusIndex: focusIndex }, otherProps)));
|
|
48
50
|
};
|
|
49
|
-
|
|
51
|
+
var typedMemo = memo;
|
|
52
|
+
export default typedMemo(SelectAttributesList);
|