@reltio/components 1.4.1853 → 1.4.1855
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/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
- package/cjs/ConnectionEditor/ConnectionEditor.d.ts +3 -3
- package/cjs/ConnectionEditor/ConnectionEditor.test.js +2 -2
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -20
- package/cjs/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
- package/cjs/DependentLookupEditor/DependentLookupEditor.js +3 -21
- package/cjs/DropDownEditor/DropDownEditor.d.ts +14 -15
- package/cjs/DropDownEditor/DropDownEditor.js +0 -6
- package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +0 -20
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
- package/cjs/EditModeAttributesPager/types.d.ts +7 -6
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.js +6 -17
- package/cjs/EditModeComplexAttribute/index.d.ts +1 -0
- package/cjs/EntitySelector/EntitySelector.d.ts +19 -31
- package/cjs/EntitySelector/EntitySelector.js +0 -14
- package/cjs/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
- package/cjs/EntitySelector/components/EntityOption/EntityOption.js +0 -18
- package/cjs/ErrorWrapper/ErrorWrapper.d.ts +2 -2
- package/cjs/FilterEditor/FilterEditor.d.ts +16 -23
- package/cjs/FilterEditor/FilterEditor.js +2 -14
- package/cjs/FilterValueEditor/FilterValueEditor.d.ts +14 -24
- package/cjs/FilterValueEditor/FilterValueEditor.js +0 -9
- package/cjs/HOCs/withFilter/ColumnFilter.js +1 -1
- package/cjs/LookupEditor/LookupEditor.d.ts +11 -33
- package/cjs/LookupEditor/LookupEditor.js +1 -14
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
- package/cjs/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
- package/cjs/NestedAttribute/NestedAttribute.d.ts +4 -124
- package/cjs/NestedAttribute/NestedAttribute.js +0 -1
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.js +0 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +0 -12
- package/cjs/ReadOnlyComplexAttribute/index.d.ts +1 -0
- package/cjs/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
- package/cjs/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.js +2 -3
- package/cjs/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
- package/cjs/RelationTypeSelector/RelationTypeSelector.js +2 -14
- package/cjs/SaveSegmentDialog/SaveSegmentDialog.d.ts +3 -1
- package/cjs/SaveSegmentDialog/SaveSegmentDialog.js +9 -6
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.js +0 -17
- package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
- package/cjs/components/ImageDetailsView/helpers/index.d.ts +5 -2
- package/cjs/components/ImportButton/ImportButton.d.ts +2 -1
- package/cjs/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
- package/cjs/components/MultipliableSelect/MultipliableSelect.js +0 -15
- package/cjs/components/ProfileBand/styles.d.ts +1 -1
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
- package/cjs/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
- package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
- package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
- package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
- package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -51
- package/cjs/components/ReactSelect/AsyncSelect.d.ts +0 -45
- package/cjs/components/ReactSelect/CreatableSelect.d.ts +0 -45
- package/cjs/components/ReactSelect/Select.d.ts +0 -45
- package/cjs/components/ReactSelect/withMuiSkin.d.ts +3 -48
- package/cjs/components/ReactSelect/withMuiSkin.js +0 -50
- package/cjs/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
- package/cjs/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
- package/cjs/components/SearchInput/SearchInput.d.ts +1 -1
- package/cjs/components/SelectionPopup/SelectionPopup.d.ts +1 -1
- package/cjs/constants/index.d.ts +1 -1
- package/cjs/constants/index.js +1 -4
- package/cjs/constants/prop-types.d.ts +0 -81
- package/cjs/constants/prop-types.js +17 -46
- package/cjs/constants/textField.d.ts +2 -2
- package/cjs/contexts/ScrollToElementContext/index.d.ts +1 -1
- package/cjs/helpers/basicTable.d.ts +2 -7
- package/cjs/hooks/useRelationTypeSelector.d.ts +12 -8
- package/cjs/hooks/useRelationTypeSelector.js +3 -1
- package/cjs/hooks/useSavedSearchesRequest/useSavedSearchesRequest.d.ts +1 -1
- package/cjs/hooks/useSavedSearchesRequest/useSavedSearchesRequest.js +7 -3
- package/cjs/types/index.d.ts +19 -2
- package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
- package/esm/ConnectionEditor/ConnectionEditor.d.ts +3 -3
- package/esm/ConnectionEditor/ConnectionEditor.test.js +2 -2
- package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
- package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -17
- package/esm/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
- package/esm/DependentLookupEditor/DependentLookupEditor.js +4 -22
- package/esm/DropDownEditor/DropDownEditor.d.ts +14 -15
- package/esm/DropDownEditor/DropDownEditor.js +0 -6
- package/esm/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
- package/esm/EditModeAttributesList/EditModeAttributesList.js +1 -21
- package/esm/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
- package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
- package/esm/EditModeAttributesPager/types.d.ts +7 -6
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.js +7 -18
- package/esm/EditModeComplexAttribute/index.d.ts +1 -0
- package/esm/EntitySelector/EntitySelector.d.ts +19 -31
- package/esm/EntitySelector/EntitySelector.js +1 -15
- package/esm/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
- package/esm/EntitySelector/components/EntityOption/EntityOption.js +0 -18
- package/esm/ErrorWrapper/ErrorWrapper.d.ts +2 -2
- package/esm/FilterEditor/FilterEditor.d.ts +16 -23
- package/esm/FilterEditor/FilterEditor.js +3 -15
- package/esm/FilterValueEditor/FilterValueEditor.d.ts +14 -24
- package/esm/FilterValueEditor/FilterValueEditor.js +1 -10
- package/esm/HOCs/withFilter/ColumnFilter.js +1 -1
- package/esm/LookupEditor/LookupEditor.d.ts +11 -33
- package/esm/LookupEditor/LookupEditor.js +1 -11
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
- package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
- package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
- package/esm/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
- package/esm/NestedAttribute/NestedAttribute.d.ts +4 -124
- package/esm/NestedAttribute/NestedAttribute.js +1 -2
- package/esm/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
- package/esm/NestedAttributeEditor/NestedAttributeEditor.js +1 -2
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +1 -13
- package/esm/ReadOnlyComplexAttribute/index.d.ts +1 -0
- package/esm/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
- package/esm/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.js +3 -4
- package/esm/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
- package/esm/RelationTypeSelector/RelationTypeSelector.js +2 -14
- package/esm/SaveSegmentDialog/SaveSegmentDialog.d.ts +3 -1
- package/esm/SaveSegmentDialog/SaveSegmentDialog.js +9 -6
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -18
- package/esm/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
- package/esm/components/ImageDetailsView/helpers/index.d.ts +5 -2
- package/esm/components/ImportButton/ImportButton.d.ts +2 -1
- package/esm/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
- package/esm/components/MultipliableSelect/MultipliableSelect.js +0 -15
- package/esm/components/ProfileBand/styles.d.ts +1 -1
- package/esm/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
- package/esm/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
- package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
- package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
- package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
- package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -28
- package/esm/components/ReactSelect/AsyncSelect.d.ts +0 -45
- package/esm/components/ReactSelect/CreatableSelect.d.ts +0 -45
- package/esm/components/ReactSelect/Select.d.ts +0 -45
- package/esm/components/ReactSelect/withMuiSkin.d.ts +3 -48
- package/esm/components/ReactSelect/withMuiSkin.js +0 -50
- package/esm/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
- package/esm/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
- package/esm/components/SearchInput/SearchInput.d.ts +1 -1
- package/esm/components/SelectionPopup/SelectionPopup.d.ts +1 -1
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/constants/prop-types.d.ts +0 -81
- package/esm/constants/prop-types.js +17 -38
- package/esm/constants/textField.d.ts +2 -2
- package/esm/contexts/ScrollToElementContext/index.d.ts +1 -1
- package/esm/helpers/basicTable.d.ts +2 -7
- package/esm/hooks/useRelationTypeSelector.d.ts +12 -8
- package/esm/hooks/useRelationTypeSelector.js +3 -1
- package/esm/hooks/useSavedSearchesRequest/useSavedSearchesRequest.d.ts +1 -1
- package/esm/hooks/useSavedSearchesRequest/useSavedSearchesRequest.js +8 -4
- package/esm/types/index.d.ts +19 -2
- package/package.json +2 -2
|
@@ -10,9 +10,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React, { useCallback, useContext, useMemo, useState, useEffect } from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import i18n from 'ui-i18n';
|
|
15
|
-
import { getCreatableAttributeTypes, getAttributesListForEditMode,
|
|
14
|
+
import { getCreatableAttributeTypes, getAttributesListForEditMode, getParentUri, checkCanCreateAttribute } from '@reltio/mdm-sdk';
|
|
16
15
|
import { last, path } from 'ramda';
|
|
17
16
|
import { EditModeAttributesPager } from '../EditModeAttributesPager';
|
|
18
17
|
import { BranchDecorator } from '../BranchDecorator';
|
|
@@ -72,25 +71,6 @@ var EditModeAttributesList = function (_a) {
|
|
|
72
71
|
return (React.createElement(EditModeAttributesPager, { key: "".concat(attrType.uri, "_").concat(parentUri), attributeType: attrType, drawLines: drawLines, values: values, paging: path(['paging', attrType.uri], attributes), parentUri: parentUri, showEmptyEditors: showEmptyEditors, mode: mode, crosswalks: crosswalks, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onDeleteAttribute, additionalControlsRenderer: additionalControlsRenderer, showNonOv: showNonOv }));
|
|
73
72
|
}))));
|
|
74
73
|
};
|
|
75
|
-
EditModeAttributesList.propTypes = {
|
|
76
|
-
parentAttributeType: PropTypes.object,
|
|
77
|
-
attrTypes: PropTypes.array,
|
|
78
|
-
entity: PropTypes.object,
|
|
79
|
-
parentUri: PropTypes.string,
|
|
80
|
-
children: PropTypes.node,
|
|
81
|
-
showEmptyEditors: PropTypes.bool,
|
|
82
|
-
mode: ModeType,
|
|
83
|
-
crosswalks: PropTypes.array,
|
|
84
|
-
drawLines: PropTypes.bool,
|
|
85
|
-
showNonOv: PropTypes.bool,
|
|
86
|
-
className: PropTypes.string,
|
|
87
|
-
alwaysVisibleTypeUris: PropTypes.array,
|
|
88
|
-
onAddAttributes: PropTypes.func,
|
|
89
|
-
onChangeAttribute: PropTypes.func,
|
|
90
|
-
onDeleteAttribute: PropTypes.func,
|
|
91
|
-
additionalControlsRenderer: PropTypes.func,
|
|
92
|
-
highlightAttribute: PropTypes.func
|
|
93
|
-
};
|
|
94
74
|
export default withContext(ScrollToElementContext, function (contextValue) {
|
|
95
75
|
var highlightAttribute = (contextValue || {}).highlightAttribute;
|
|
96
76
|
return { highlightAttribute: highlightAttribute };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { AttributeValue, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
2
3
|
import { EditModeAttributesPagerProps } from './types';
|
|
3
|
-
declare const _default:
|
|
4
|
+
declare const _default: <T_1 extends AttributeValue | PrimitiveValue>(props: EditModeAttributesPagerProps<T_1>) => ReactElement;
|
|
4
5
|
export default _default;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttributeValue,
|
|
2
|
+
import { AttributeValue, AttributeError, RequestNextPageOfAttributeValuesPayload, Optional } from '@reltio/mdm-sdk';
|
|
3
3
|
import { EditModeAttributesPagerProps } from '../../types';
|
|
4
|
-
type Props =
|
|
5
|
-
values?: (SimpleAttributeValue | NestedAttributeValue | ReferenceAttributeValue)[];
|
|
4
|
+
type Props = Optional<EditModeAttributesPagerProps<AttributeValue>, 'values'> & {
|
|
6
5
|
nonVisibleValues: AttributeValue[];
|
|
7
6
|
errorMessage?: string;
|
|
8
7
|
errors?: AttributeError[];
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AttributeType, Crosswalk,
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { AttributeType, Crosswalk, Mode, Paging, AttributeItem, AttributeValue, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
3
3
|
import { ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
4
|
+
import { AdditionalControlsRenderer } from '../types';
|
|
4
5
|
export declare enum RENDERER_TYPES {
|
|
5
6
|
imageLine = "imageLine",
|
|
6
7
|
special = "special",
|
|
7
8
|
default = "default"
|
|
8
9
|
}
|
|
9
|
-
export type EditModeAttributesPagerProps = {
|
|
10
|
-
values:
|
|
10
|
+
export type EditModeAttributesPagerProps<T extends AttributeValue | PrimitiveValue> = {
|
|
11
|
+
values: T[];
|
|
11
12
|
attributeType: AttributeType;
|
|
12
13
|
paging?: Paging;
|
|
13
14
|
mode?: Mode;
|
|
14
15
|
crosswalks?: Crosswalk[];
|
|
15
16
|
parentUri: string;
|
|
16
|
-
drawLines
|
|
17
|
+
drawLines?: boolean;
|
|
17
18
|
max?: number;
|
|
18
19
|
showEmptyEditors: boolean;
|
|
19
20
|
showNonOv?: boolean;
|
|
20
21
|
onAddAttributes: (params: AttributeItem[]) => void;
|
|
21
22
|
onDeleteAttribute: (param: AttributeItem) => void;
|
|
22
23
|
onChangeAttribute: (param: AttributeItem) => void;
|
|
23
|
-
additionalControlsRenderer?: (props:
|
|
24
|
+
additionalControlsRenderer?: (props: AdditionalControlsRenderer<AttributeValue>) => ReactNode;
|
|
24
25
|
highlightedError?: React.ContextType<typeof ScrollToElementContext>;
|
|
25
26
|
highlightedAttribute?: React.ContextType<typeof ScrollToElementContext>;
|
|
26
27
|
};
|
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
import React, { ContextType, ReactNode } from 'react';
|
|
2
|
+
import { Crosswalk, AttributeType, AttributeError, Mode, Metadata, ComplexAttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { ScrollToElementContext } from '../contexts/ScrollToElementContext';
|
|
4
|
+
import { AdditionalControlsRenderer } from '../types';
|
|
5
|
+
export type EditModeComplexAttributeProps<T> = {
|
|
6
|
+
label?: string;
|
|
7
|
+
attributeTypesList?: AttributeType[];
|
|
8
|
+
attributeType: AttributeType;
|
|
9
|
+
attributeValue: T;
|
|
10
|
+
errors?: AttributeError[];
|
|
11
|
+
ownError?: AttributeError;
|
|
12
|
+
mode: Mode;
|
|
13
|
+
metadata: Metadata;
|
|
14
|
+
crosswalks?: Crosswalk[];
|
|
15
|
+
lazy?: boolean;
|
|
16
|
+
showEmptyEditors?: boolean;
|
|
17
|
+
onAddOneMore?: () => void;
|
|
18
|
+
onAddAttributes: (attribute: {
|
|
19
|
+
uri: string;
|
|
20
|
+
attributeType: AttributeType;
|
|
21
|
+
}[]) => void;
|
|
22
|
+
onDeleteAttribute: (attribute: {
|
|
23
|
+
uri: string;
|
|
24
|
+
attributeType: AttributeType;
|
|
25
|
+
attributeValue: T;
|
|
26
|
+
}) => void;
|
|
27
|
+
onChangeAttribute: (attribute: {
|
|
28
|
+
uri: string;
|
|
29
|
+
attributeType: AttributeType;
|
|
30
|
+
value: T;
|
|
31
|
+
}) => void;
|
|
32
|
+
additionalControlsRenderer: (props: AdditionalControlsRenderer<ComplexAttributeValue>) => ReactNode;
|
|
33
|
+
hideDeleteButton?: boolean;
|
|
34
|
+
state?: 'deleted' | 'edited';
|
|
35
|
+
showNonOv?: boolean;
|
|
36
|
+
isHighlightedPath?: boolean;
|
|
37
|
+
highlightedError?: ContextType<typeof ScrollToElementContext>;
|
|
38
|
+
expanded?: boolean;
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
};
|
|
41
|
+
declare const _default: React.ComponentType<EditModeComplexAttributeProps<ComplexAttributeValue>>;
|
|
4
42
|
export default _default;
|
|
5
|
-
import React from 'react';
|
|
@@ -1,20 +1,8 @@
|
|
|
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
1
|
import React, { useMemo, useState, useEffect } from 'react';
|
|
13
2
|
import { pipe, propOr, pathEq, any } from 'ramda';
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
15
3
|
import classnames from 'classnames';
|
|
16
4
|
import i18n from 'ui-i18n';
|
|
17
|
-
import { checkCanDeleteAttribute, isReltioCrosswalk, isTempUri,
|
|
5
|
+
import { checkCanDeleteAttribute, isReltioCrosswalk, isTempUri, getErrorMessage, hasAttributeDescendantsWithErrors, isAnalyticAttribute } from '@reltio/mdm-sdk';
|
|
18
6
|
import Button from '@mui/material/Button';
|
|
19
7
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
20
8
|
import Typography from '@mui/material/Typography';
|
|
@@ -71,10 +59,12 @@ var EditModeComplexAttribute = function (_a) {
|
|
|
71
59
|
}
|
|
72
60
|
}, [deleted]);
|
|
73
61
|
var hasAnalyticValue = (attributeTypesList || []).some(function (attributeType) { return isAnalyticAttribute(attributeType); });
|
|
74
|
-
var attributeListEntity = useMemo(function () {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
var attributeListEntity = useMemo(function () {
|
|
63
|
+
return ({
|
|
64
|
+
attributes: hasAnalyticValue ? null : attributeValue.value,
|
|
65
|
+
analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
|
|
66
|
+
});
|
|
67
|
+
}, [attributeValue, hasAnalyticValue]);
|
|
78
68
|
var errorMessage = getErrorMessage(ownError) || (hasDescendantsWithErrors && i18n.text('Has an incorrect value')) || '';
|
|
79
69
|
return lazy ? (React.createElement(Button, { variant: "text", color: "primary", onClick: onAddOneMore }, "Create attribute")) : (React.createElement("div", { ref: ref, className: classnames(styles.complexWrapper, errorClassName) },
|
|
80
70
|
React.createElement("div", { className: styles.editor },
|
|
@@ -91,7 +81,6 @@ var EditModeComplexAttribute = function (_a) {
|
|
|
91
81
|
showDeleteButton && (React.createElement(SmallIconButton, { icon: DeleteIcon, onClick: onDeleteThis, size: "L", "data-reltio-id": "reltio-delete-complex-attribute-button" })))),
|
|
92
82
|
expanded && (React.createElement(EditModeAttributesList, { parentAttributeType: attributeType, attrTypes: attributeTypesList, entity: attributeListEntity, showEmptyEditors: showEmptyEditors || isNew, drawLines: true, parentUri: uri, mode: mode, crosswalks: crosswalks, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onDeleteAttribute, additionalControlsRenderer: additionalControlsRenderer, showNonOv: showNonOv }, children))));
|
|
93
83
|
};
|
|
94
|
-
EditModeComplexAttribute.propTypes = __assign({ label: PropTypes.string, children: PropTypes.node, attributeTypesList: PropTypes.arrayOf(AttributeTypeType), attributeValue: PropTypes.oneOfType([NestedAttributeValueType, ReferenceAttributeValueType]), highlightedError: PropTypes.object, isHighlightedPath: PropTypes.bool }, ComplexAttributeType);
|
|
95
84
|
export default withContext(ScrollToElementContext, function (contextValue, _a) {
|
|
96
85
|
var attributeValue = _a.attributeValue;
|
|
97
86
|
var _b = contextValue || {}, element = _b.element, type = _b.type;
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { ConnectionEntity, Mode, Metadata, GlobalSearchRequestOptions, TEntityType, AttributeType, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
type Props = {
|
|
4
|
+
entity?: ConnectionEntity;
|
|
5
|
+
entityTypesUris?: string[];
|
|
6
|
+
mode: Mode;
|
|
7
|
+
max: number;
|
|
8
|
+
onChange: (entity: ConnectionEntity) => void;
|
|
9
|
+
onCreate?: (entityTypeUri: string, value: PrimitiveValue) => void;
|
|
10
|
+
metadata: Metadata;
|
|
11
|
+
globalSearchRequestOptions: GlobalSearchRequestOptions;
|
|
12
|
+
attributeTypesSelectionStrategy: (entityType: TEntityType) => AttributeType[];
|
|
12
13
|
disableLinkClick?: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export let dispatch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
-
export { MetadataType as metadata };
|
|
22
|
-
export let onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
23
|
-
export let onCreate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
-
export let attributeTypesSelectionStrategy: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
|
-
export let globalSearchRequestOptions: PropTypes.Requireable<object>;
|
|
26
|
-
export let disableLinkClick: PropTypes.Requireable<boolean>;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
import { ConnectionEntityType } from '@reltio/mdm-sdk';
|
|
30
|
-
import PropTypes from 'prop-types';
|
|
31
|
-
import { ModeType } from '@reltio/mdm-sdk';
|
|
32
|
-
import { MetadataType } from '@reltio/mdm-sdk';
|
|
14
|
+
TextFieldProps?: TextFieldProps;
|
|
15
|
+
className?: string;
|
|
16
|
+
height?: number;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const EntitySelector: ({ entity, entityTypesUris, mode, max, onChange, onCreate, metadata, globalSearchRequestOptions, attributeTypesSelectionStrategy, disableLinkClick, ...otherProps }: Props) => JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -21,10 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React, { useState, useMemo } from 'react';
|
|
24
|
-
import PropTypes from 'prop-types';
|
|
25
24
|
import i18n from 'ui-i18n';
|
|
26
25
|
import { isEmpty, prop } from 'ramda';
|
|
27
|
-
import { typeAheadSearch, getEntityType,
|
|
26
|
+
import { typeAheadSearch, getEntityType, isTempUri, isAvailableEntityType } from '@reltio/mdm-sdk';
|
|
28
27
|
import { EmptyStub } from '../core';
|
|
29
28
|
import { DropDownSelector } from '../DropDownSelector';
|
|
30
29
|
import { EntityOption } from './components/EntityOption';
|
|
@@ -78,16 +77,3 @@ export var EntitySelector = function (_a) {
|
|
|
78
77
|
isTempEntity && (React.createElement("div", { className: styles.creatorWrapper },
|
|
79
78
|
React.createElement(EntityCreator, { mode: mode, attributeTypesSelectionStrategy: attributeTypesSelectionStrategy, entityType: currentEntityType, entityUri: entity.entityUri })))));
|
|
80
79
|
};
|
|
81
|
-
EntitySelector.propTypes = {
|
|
82
|
-
entity: ConnectionEntityType,
|
|
83
|
-
entityTypesUris: PropTypes.arrayOf(PropTypes.string),
|
|
84
|
-
max: PropTypes.number,
|
|
85
|
-
mode: ModeType,
|
|
86
|
-
dispatch: PropTypes.func,
|
|
87
|
-
metadata: MetadataType,
|
|
88
|
-
onChange: PropTypes.func.isRequired,
|
|
89
|
-
onCreate: PropTypes.func,
|
|
90
|
-
attributeTypesSelectionStrategy: PropTypes.func,
|
|
91
|
-
globalSearchRequestOptions: PropTypes.object,
|
|
92
|
-
disableLinkClick: PropTypes.bool
|
|
93
|
-
};
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}>>>;
|
|
19
|
-
}>>;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { ForwardedRef } from 'react';
|
|
2
|
+
import { MenuItemProps } from '@mui/material/MenuItem';
|
|
3
|
+
import { TEntityType } from '@reltio/mdm-sdk';
|
|
4
|
+
type Option = {
|
|
5
|
+
label: string;
|
|
6
|
+
uri: string;
|
|
7
|
+
entityType: TEntityType;
|
|
8
|
+
secondaryLabel?: string;
|
|
9
|
+
};
|
|
10
|
+
type Props = {
|
|
11
|
+
innerProps: MenuItemProps;
|
|
12
|
+
innerRef: ForwardedRef<HTMLLIElement>;
|
|
13
|
+
selectOption: (option: Option) => void;
|
|
14
|
+
data: Option;
|
|
15
|
+
};
|
|
16
|
+
export declare const EntityOption: ({ innerRef, innerProps, selectOption, data }: Props) => JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -10,10 +10,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import i18n from 'ui-i18n';
|
|
15
14
|
import MenuItem from '@mui/material/MenuItem';
|
|
16
|
-
import { EntityType } from '@reltio/mdm-sdk';
|
|
17
15
|
import { EntityTypeIcon } from '../../../EntityTypeIcon';
|
|
18
16
|
import { ExpandedValueTooltip } from '../../../ExpandedValueTooltip';
|
|
19
17
|
import { useStyles } from './styles';
|
|
@@ -36,19 +34,3 @@ export var EntityOption = function (_a) {
|
|
|
36
34
|
React.createElement("span", { className: styles.emptyEntityLabel }, i18n.text('No results found'))));
|
|
37
35
|
}
|
|
38
36
|
};
|
|
39
|
-
EntityOption.propTypes = {
|
|
40
|
-
innerRef: PropTypes.oneOfType([
|
|
41
|
-
PropTypes.oneOf([null]),
|
|
42
|
-
PropTypes.func,
|
|
43
|
-
PropTypes.shape({
|
|
44
|
-
current: PropTypes.any.isRequired
|
|
45
|
-
})
|
|
46
|
-
]),
|
|
47
|
-
innerProps: PropTypes.object.isRequired,
|
|
48
|
-
selectOption: PropTypes.func.isRequired,
|
|
49
|
-
data: PropTypes.shape({
|
|
50
|
-
uri: PropTypes.string.isRequired,
|
|
51
|
-
label: PropTypes.string.isRequired,
|
|
52
|
-
entityType: EntityType.isRequired
|
|
53
|
-
})
|
|
54
|
-
};
|
|
@@ -3,8 +3,8 @@ import { FormControlProps } from '@mui/material/FormControl';
|
|
|
3
3
|
type Props = FormControlProps & {
|
|
4
4
|
errorMessage?: string;
|
|
5
5
|
classes?: {
|
|
6
|
-
root
|
|
7
|
-
helperText
|
|
6
|
+
root?: string;
|
|
7
|
+
helperText?: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export declare const ErrorWrapper: React.MemoExoticComponent<({ errorMessage, children, className, classes, ...otherProps }: Props) => JSX.Element>;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export let dataTypeDefinition: PropTypes.Requireable<object>;
|
|
18
|
-
export let classes: PropTypes.Requireable<object>;
|
|
19
|
-
export let valueEditorProps: PropTypes.Requireable<object>;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
import { FilterType } from '@reltio/mdm-sdk';
|
|
23
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { DataTypeDefinition, FacetFilter } from '@reltio/mdm-sdk';
|
|
3
|
+
import { FilterValueEditor } from '../FilterValueEditor';
|
|
4
|
+
type Props = {
|
|
5
|
+
value: FacetFilter;
|
|
6
|
+
onChange: (value: FacetFilter) => void;
|
|
7
|
+
filterOptions: {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
dataTypeDefinition: DataTypeDefinition;
|
|
12
|
+
classes: Record<string, string>;
|
|
13
|
+
ValueEditorProps: Omit<ComponentProps<typeof FilterValueEditor>, 'filter' | 'onChange' | 'dataTypeDefinition'>;
|
|
14
|
+
};
|
|
15
|
+
export declare const FilterEditor: ({ value, onChange, filterOptions, dataTypeDefinition, classes, ValueEditorProps }: Props) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -10,16 +10,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import classnames from 'classnames';
|
|
15
14
|
import { __, assoc, pipe } from 'ramda';
|
|
16
|
-
import { checkIfOptionHasValues
|
|
15
|
+
import { checkIfOptionHasValues } from '@reltio/mdm-sdk';
|
|
17
16
|
import { COMMON_TEXT_FIELD_PROPS } from '../constants';
|
|
18
17
|
import { DropDownEditor } from '../DropDownEditor';
|
|
19
18
|
import { FilterValueEditor } from '../FilterValueEditor';
|
|
20
19
|
import { useStyles } from './styles';
|
|
21
20
|
export var FilterEditor = function (_a) {
|
|
22
|
-
var value = _a.value, onChange = _a.onChange, filterOptions = _a.filterOptions, dataTypeDefinition = _a.dataTypeDefinition, classes = _a.classes,
|
|
21
|
+
var value = _a.value, onChange = _a.onChange, filterOptions = _a.filterOptions, dataTypeDefinition = _a.dataTypeDefinition, classes = _a.classes, ValueEditorProps = _a.ValueEditorProps;
|
|
23
22
|
var styles = useStyles();
|
|
24
23
|
var firstOption = filterOptions[0];
|
|
25
24
|
var filterOption = value.filter || firstOption.value;
|
|
@@ -27,16 +26,5 @@ export var FilterEditor = function (_a) {
|
|
|
27
26
|
var canFilterAcceptValues = checkIfOptionHasValues(filterOption);
|
|
28
27
|
return (React.createElement(React.Fragment, null,
|
|
29
28
|
React.createElement(DropDownEditor, { TextFieldProps: COMMON_TEXT_FIELD_PROPS, className: classnames(classes.option, styles.dropDownEditor), value: filterOption, entries: filterOptions, onChange: pipe(assoc('filter', __, filter), assoc('values', []), onChange), classes: { root: classnames(styles.root, styles.selectorRoot), icon: styles.icon } }),
|
|
30
|
-
canFilterAcceptValues && (React.createElement(FilterValueEditor, __assign({ filter: filter, onChange: pipe(assoc('values', __, filter), onChange), dataTypeDefinition: dataTypeDefinition },
|
|
31
|
-
};
|
|
32
|
-
FilterEditor.propTypes = {
|
|
33
|
-
value: FilterType,
|
|
34
|
-
onChange: PropTypes.func,
|
|
35
|
-
filterOptions: PropTypes.arrayOf(PropTypes.shape({
|
|
36
|
-
value: PropTypes.string,
|
|
37
|
-
label: PropTypes.string
|
|
38
|
-
})),
|
|
39
|
-
dataTypeDefinition: PropTypes.object,
|
|
40
|
-
classes: PropTypes.object,
|
|
41
|
-
valueEditorProps: PropTypes.object
|
|
29
|
+
canFilterAcceptValues && (React.createElement(FilterValueEditor, __assign({ filter: filter, onChange: pipe(assoc('values', __, filter), onChange), dataTypeDefinition: dataTypeDefinition }, ValueEditorProps)))));
|
|
42
30
|
};
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
export { FilterType as filter };
|
|
16
|
-
export let orientation: PropTypes.Requireable<string>;
|
|
17
|
-
export let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
export let dataTypeDefinition: PropTypes.Requireable<object>;
|
|
19
|
-
export let classes: PropTypes.Requireable<object>;
|
|
20
|
-
export let TextFieldProps: PropTypes.Requireable<object>;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
import { FilterType } from '@reltio/mdm-sdk';
|
|
24
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { DataTypeDefinition, DatePeriod, SearchFilter, SearchValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
type Props = {
|
|
4
|
+
filter: SearchFilter;
|
|
5
|
+
orientation?: 'horizontal' | 'vertical';
|
|
6
|
+
onChange: (value: Array<SearchValue | DatePeriod | Date>) => void;
|
|
7
|
+
dataTypeDefinition: DataTypeDefinition;
|
|
8
|
+
classes?: Record<string, string>;
|
|
9
|
+
TextFieldProps: TextFieldProps;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
color?: 'primary' | 'secondary';
|
|
12
|
+
};
|
|
13
|
+
export declare const FilterValueEditor: ({ filter: { values, fieldName, filter }, onChange, dataTypeDefinition, orientation, TextFieldProps, ...otherProps }: Props) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -20,10 +20,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import PropTypes from 'prop-types';
|
|
24
23
|
import React from 'react';
|
|
25
24
|
import i18n from 'ui-i18n';
|
|
26
|
-
import {
|
|
25
|
+
import { isDateRangeFilterOption, isMultiValueOption, isRangeFilterOption, mapFilterValue, wrapInArray } from '@reltio/mdm-sdk';
|
|
27
26
|
import { pipe } from 'ramda';
|
|
28
27
|
import { DateRangeEditor } from '../DateRangeEditor';
|
|
29
28
|
import { DataTypeValueEditor } from '../DataTypeValueEditor';
|
|
@@ -45,11 +44,3 @@ export var FilterValueEditor = function (_a) {
|
|
|
45
44
|
return (React.createElement(DataTypeValueEditor, __assign({}, otherProps, multipleProp, { fieldName: fieldName, value: value, onChange: handleChange, dataTypeDefinition: dataTypeDefinition, TextFieldProps: TextFieldProps })));
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
|
-
FilterValueEditor.propTypes = {
|
|
49
|
-
filter: FilterType,
|
|
50
|
-
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
51
|
-
onChange: PropTypes.func,
|
|
52
|
-
dataTypeDefinition: PropTypes.object,
|
|
53
|
-
classes: PropTypes.object,
|
|
54
|
-
TextFieldProps: PropTypes.object
|
|
55
|
-
};
|
|
@@ -66,7 +66,7 @@ export var ColumnFilter = function (_a) {
|
|
|
66
66
|
vertical: 'top',
|
|
67
67
|
horizontal: 'right'
|
|
68
68
|
}, classes: { paper: styles.filterMenu }, onClose: applyChangesAndClose },
|
|
69
|
-
React.createElement(FilterEditor, { classes: { option: styles['filter-editor__option'] }, value: mdmFilter, onChange: pipe(mdmFilterToColumnFilter, setColumnFilter), filterOptions: filterOptions, dataTypeDefinition: getFilterDataTypeDefinition(mdmFilter.filter),
|
|
69
|
+
React.createElement(FilterEditor, { classes: { option: styles['filter-editor__option'] }, value: mdmFilter, onChange: pipe(mdmFilterToColumnFilter, setColumnFilter), filterOptions: filterOptions, dataTypeDefinition: getFilterDataTypeDefinition(mdmFilter.filter), ValueEditorProps: {
|
|
70
70
|
TextFieldProps: {
|
|
71
71
|
onKeyPress: handleValueEditorKeyPress
|
|
72
72
|
},
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onChange:
|
|
8
|
-
getLookups
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
let multiple: PropTypes.Requireable<boolean>;
|
|
13
|
-
let value: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
14
|
-
value: PropTypes.Requireable<string>;
|
|
15
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
16
|
-
}> | PropTypes.InferProps<{
|
|
17
|
-
value: PropTypes.Requireable<string>;
|
|
18
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
19
|
-
}>[]>>;
|
|
20
|
-
let lookupCode: PropTypes.Validator<string>;
|
|
21
|
-
let lookups: PropTypes.Validator<{
|
|
22
|
-
[x: string]: {
|
|
23
|
-
[x: string]: PropTypes.InferProps<{
|
|
24
|
-
displayName: PropTypes.Requireable<string>;
|
|
25
|
-
parent: PropTypes.Requireable<string>;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
-
let getLookups: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { LookupValue, Lookups } from '@reltio/mdm-sdk';
|
|
2
|
+
type Props = {
|
|
3
|
+
value?: LookupValue | LookupValue[];
|
|
4
|
+
lookupCode: string;
|
|
5
|
+
lookups?: Lookups;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
onChange?: (value: LookupValue | LookupValue[]) => void;
|
|
8
|
+
getLookups?: () => Promise<Lookups>;
|
|
9
|
+
};
|
|
10
|
+
export declare const LookupEditor: ({ multiple, value, lookupCode: lookupTypeCode, lookups, onChange, getLookups, ...otherProps }: Props) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -20,12 +20,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import PropTypes from 'prop-types';
|
|
24
23
|
import React, { useEffect } from 'react';
|
|
25
|
-
import { SimpleLookupType, LookupValueType } from '@reltio/mdm-sdk';
|
|
26
24
|
import { always, defaultTo, isEmpty, map, path, pipe, pluck, prop, propEq } from 'ramda';
|
|
27
|
-
import { buildLookupEntries } from './helpers';
|
|
28
25
|
import { GroupedDropDownEditor } from './components/GroupedDropDownEditor';
|
|
26
|
+
import { buildLookupEntries } from './helpers';
|
|
29
27
|
export var LookupEditor = function (_a) {
|
|
30
28
|
var multiple = _a.multiple, value = _a.value, lookupTypeCode = _a.lookupCode, lookups = _a.lookups, onChange = _a.onChange, getLookups = _a.getLookups, otherProps = __rest(_a, ["multiple", "value", "lookupCode", "lookups", "onChange", "getLookups"]);
|
|
31
29
|
var codeToLookup = function (lookupCode) { return ({
|
|
@@ -43,11 +41,3 @@ export var LookupEditor = function (_a) {
|
|
|
43
41
|
value = defaultTo(multiple ? [] : {}, value);
|
|
44
42
|
return multiple ? (React.createElement(GroupedDropDownEditor, __assign({}, commonProps, { value: pluck('lookupCode', value), getValuePlaceholder: function (lookupCode) { return value.find(propEq('lookupCode', lookupCode)).value; }, onChange: pipe(map(codeToLookup), onChange) }))) : (React.createElement(GroupedDropDownEditor, __assign({}, commonProps, { value: prop('lookupCode', value), getValuePlaceholder: always(prop('value', value)), onChange: pipe(codeToLookup, onChange) })));
|
|
45
43
|
};
|
|
46
|
-
LookupEditor.propTypes = {
|
|
47
|
-
multiple: PropTypes.bool,
|
|
48
|
-
value: PropTypes.oneOfType([LookupValueType, PropTypes.arrayOf(LookupValueType)]),
|
|
49
|
-
lookupCode: PropTypes.string.isRequired,
|
|
50
|
-
lookups: PropTypes.objectOf(PropTypes.objectOf(SimpleLookupType)).isRequired,
|
|
51
|
-
onChange: PropTypes.func,
|
|
52
|
-
getLookups: PropTypes.func
|
|
53
|
-
};
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
value: PropTypes.Validator<NonNullable<NonNullable<string | number | object>>>;
|
|
13
|
-
label: PropTypes.Requireable<string>;
|
|
14
|
-
}> | PropTypes.InferProps<{
|
|
15
|
-
label: PropTypes.Validator<string>;
|
|
16
|
-
values: PropTypes.Validator<object[]>;
|
|
17
|
-
}>>[]>;
|
|
18
|
-
let classes: PropTypes.Requireable<object>;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import MultipliableSelect from '../../../components/MultipliableSelect/MultipliableSelect';
|
|
3
|
+
import { DropDownGroupEntryType, DropDownEntryType } from '../../../types';
|
|
4
|
+
export declare const MENU_ITEM_OFFSET = 25;
|
|
5
|
+
type Props = {
|
|
6
|
+
value?: string | string[];
|
|
7
|
+
entries: DropDownEntryType[] | DropDownGroupEntryType[];
|
|
8
|
+
classes?: Record<string, string>;
|
|
9
|
+
} & ComponentProps<typeof MultipliableSelect>;
|
|
10
|
+
export declare const GroupedDropDownEditor: ({ value, entries, classes, ...otherProps }: Props) => JSX.Element;
|
|
11
|
+
export {};
|