@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
|
@@ -61,7 +61,7 @@ var styles_1 = require("./styles");
|
|
|
61
61
|
var EMPTY_FILTER = { fieldName: null, filter: null, operator: mdm_sdk_1.SearchOperator.and, values: [] };
|
|
62
62
|
var AttributesFiltersBuilder = function (_a) {
|
|
63
63
|
var _b = _a.classes, classes = _b === void 0 ? {} : _b, attributesTypesGroups = _a.attributesTypesGroups, filters = _a.filters, onChange = _a.onChange, _c = _a.components, components = _c === void 0 ? {} : _c, onFilterAttributeChange = _a.onFilterAttributeChange;
|
|
64
|
-
var CustomValuesEditor =
|
|
64
|
+
var _d = components, CustomValuesEditor = _d.ValuesEditor, CustomFilterSelector = _d.FilterSelector, _e = _d.LogicalOperator, LogicalOperator = _e === void 0 ? core_1.EmptyStub : _e;
|
|
65
65
|
var styles = (0, styles_1.useStyles)();
|
|
66
66
|
var actualFilters = (0, react_1.useRef)(filters);
|
|
67
67
|
var attributeFilterRef = (0, react_1.useRef)(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttributeItem, EditingConnection, Entity,
|
|
1
|
+
import { AttributeItem, EditingConnection, Entity, ConnectionRelationType } from '@reltio/mdm-sdk';
|
|
2
2
|
type Props = {
|
|
3
3
|
connection: EditingConnection;
|
|
4
4
|
showEmptyEditors?: boolean;
|
|
@@ -11,8 +11,8 @@ type Props = {
|
|
|
11
11
|
}) => void;
|
|
12
12
|
onChangeEntity?: (entity: Entity) => void;
|
|
13
13
|
relatedEntity?: Entity;
|
|
14
|
-
inRelationTypes?:
|
|
15
|
-
outRelationTypes?:
|
|
14
|
+
inRelationTypes?: ConnectionRelationType[];
|
|
15
|
+
outRelationTypes?: ConnectionRelationType[];
|
|
16
16
|
entityErrorMessage?: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const ConnectionEditor: ({ connection, relatedEntity, inRelationTypes, outRelationTypes, showEmptyEditors, entityErrorMessage, onChangeAttribute, onRemoveAttribute, onAddAttributes, onChangeRelationType, onChangeEntity }: Props) => JSX.Element;
|
|
@@ -360,8 +360,8 @@ describe('ConnectionEditor test', function () {
|
|
|
360
360
|
onChangeEntity: onChangeEntity
|
|
361
361
|
});
|
|
362
362
|
newEntity = {
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
entityUri: 'entities/entityCommittee',
|
|
364
|
+
entityType: 'configuration/entityTypes/Committee'
|
|
365
365
|
};
|
|
366
366
|
(0, test_utils_1.act)(function () {
|
|
367
367
|
component.find(EntitySelector_1.EntitySelector).prop('onChange')(newEntity);
|
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ConnectionRelation, ConnectionRelationType, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
+
type Props = {
|
|
3
|
+
className?: string;
|
|
4
|
+
relation?: ConnectionRelation;
|
|
5
|
+
inRelationTypes?: ConnectionRelationType[];
|
|
6
|
+
outRelationTypes?: ConnectionRelationType[];
|
|
7
7
|
applyFirstByDefault?: boolean;
|
|
8
8
|
reversedContextLabels?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
typeColor: PropTypes.Requireable<string>;
|
|
18
|
-
direction: PropTypes.Requireable<string>;
|
|
19
|
-
startObject: PropTypes.Requireable<object>;
|
|
20
|
-
endObject: PropTypes.Requireable<object>;
|
|
21
|
-
}>[]>;
|
|
22
|
-
export let outRelationTypes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
23
|
-
label: PropTypes.Requireable<string>;
|
|
24
|
-
uri: PropTypes.Requireable<string>;
|
|
25
|
-
typeColor: PropTypes.Requireable<string>;
|
|
26
|
-
direction: PropTypes.Requireable<string>;
|
|
27
|
-
startObject: PropTypes.Requireable<object>;
|
|
28
|
-
endObject: PropTypes.Requireable<object>;
|
|
29
|
-
}>[]>;
|
|
30
|
-
export let applyFirstByDefault: PropTypes.Requireable<boolean>;
|
|
31
|
-
export let reversedContextLabels: PropTypes.Requireable<boolean>;
|
|
32
|
-
export let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
import PropTypes from 'prop-types';
|
|
36
|
-
import { ConnectionRelationType } from '@reltio/mdm-sdk';
|
|
9
|
+
onChange: ({ type, direction }: {
|
|
10
|
+
type: ConnectionRelationType;
|
|
11
|
+
direction: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
metadata?: Metadata;
|
|
14
|
+
};
|
|
15
|
+
export declare const ConnectionRelationTypeSelector: ({ relation, inRelationTypes, outRelationTypes, onChange, applyFirstByDefault, reversedContextLabels, ...otherProps }: Props) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -44,14 +44,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
44
44
|
}
|
|
45
45
|
return t;
|
|
46
46
|
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
48
|
exports.ConnectionRelationTypeSelector = void 0;
|
|
52
49
|
var react_1 = __importStar(require("react"));
|
|
53
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
54
|
-
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
55
50
|
var ramda_1 = require("ramda");
|
|
56
51
|
var useRelationTypeSelector_1 = require("../hooks/useRelationTypeSelector");
|
|
57
52
|
var RelationTypeSelector_1 = require("../RelationTypeSelector");
|
|
@@ -59,12 +54,7 @@ var ConnectionRelationTypeSelector = function (_a) {
|
|
|
59
54
|
var _b = _a.relation, relation = _b === void 0 ? {} : _b, _c = _a.inRelationTypes, inRelationTypes = _c === void 0 ? [] : _c, _d = _a.outRelationTypes, outRelationTypes = _d === void 0 ? [] : _d, _e = _a.onChange, onChange = _e === void 0 ? ramda_1.identity : _e, _f = _a.applyFirstByDefault, applyFirstByDefault = _f === void 0 ? false : _f, _g = _a.reversedContextLabels, reversedContextLabels = _g === void 0 ? false : _g, otherProps = __rest(_a, ["relation", "inRelationTypes", "outRelationTypes", "onChange", "applyFirstByDefault", "reversedContextLabels"]);
|
|
60
55
|
var _h = (0, useRelationTypeSelector_1.useRelationTypeSelector)({ reversedContextLabels: reversedContextLabels }), getRelationTypesOptions = _h.getRelationTypesOptions, fromEditorValue = _h.fromEditorValue, toEditorValue = _h.toEditorValue;
|
|
61
56
|
var relationsTypesOptions = (0, react_1.useMemo)(function () { return getRelationTypesOptions(inRelationTypes, outRelationTypes); }, [getRelationTypesOptions, inRelationTypes, outRelationTypes]);
|
|
62
|
-
var handleChange = (0, react_1.useCallback)((0, ramda_1.pipe)(fromEditorValue(inRelationTypes, outRelationTypes), onChange), [
|
|
63
|
-
fromEditorValue,
|
|
64
|
-
inRelationTypes,
|
|
65
|
-
outRelationTypes,
|
|
66
|
-
onChange
|
|
67
|
-
]);
|
|
57
|
+
var handleChange = (0, react_1.useCallback)((0, ramda_1.pipe)(fromEditorValue(inRelationTypes, outRelationTypes), onChange), [fromEditorValue, inRelationTypes, outRelationTypes, onChange]);
|
|
68
58
|
var hasValue = !!relation.relationType;
|
|
69
59
|
(0, react_1.useEffect)(function () {
|
|
70
60
|
if (applyFirstByDefault && relationsTypesOptions.length && !hasValue) {
|
|
@@ -74,12 +64,3 @@ var ConnectionRelationTypeSelector = function (_a) {
|
|
|
74
64
|
return (react_1.default.createElement(RelationTypeSelector_1.RelationTypeSelector, __assign({ value: toEditorValue(relation, relationsTypesOptions), options: relationsTypesOptions, onChange: handleChange }, otherProps)));
|
|
75
65
|
};
|
|
76
66
|
exports.ConnectionRelationTypeSelector = ConnectionRelationTypeSelector;
|
|
77
|
-
exports.ConnectionRelationTypeSelector.propTypes = {
|
|
78
|
-
className: prop_types_1.default.string,
|
|
79
|
-
relation: mdm_sdk_1.ConnectionRelationType,
|
|
80
|
-
inRelationTypes: prop_types_1.default.arrayOf(mdm_sdk_1.RelationTypeType),
|
|
81
|
-
outRelationTypes: prop_types_1.default.arrayOf(mdm_sdk_1.RelationTypeType),
|
|
82
|
-
applyFirstByDefault: prop_types_1.default.bool,
|
|
83
|
-
reversedContextLabels: prop_types_1.default.bool,
|
|
84
|
-
onChange: prop_types_1.default.func
|
|
85
|
-
};
|
|
@@ -1,45 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
TextFieldProps:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Lookups, LookupValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
3
|
+
export declare const DEBOUNCE_INTERVAL = 400;
|
|
4
|
+
type Props = {
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
value?: LookupValue | LookupValue[];
|
|
7
|
+
TextFieldProps: TextFieldProps;
|
|
8
|
+
lookupCode: string;
|
|
9
|
+
parents?: string[];
|
|
10
|
+
onChange: (value: LookupValue | LookupValue[]) => void;
|
|
11
|
+
getLookups: (params: {
|
|
12
|
+
type: string;
|
|
13
|
+
parents: string[];
|
|
14
|
+
displayNamePrefix: string;
|
|
15
|
+
max: number;
|
|
16
|
+
offset: number;
|
|
17
|
+
}) => Promise<Lookups>;
|
|
18
|
+
lookups: {
|
|
19
|
+
[key: string]: LookupValue[];
|
|
20
|
+
};
|
|
21
|
+
resolveLookups: (lookupType: string, codeValues: LookupValue[]) => void;
|
|
22
|
+
fullWidth?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
placeholder?: string;
|
|
16
25
|
max?: number;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
let multiple: PropTypes.Requireable<boolean>;
|
|
21
|
-
let value: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
22
|
-
value: PropTypes.Requireable<string>;
|
|
23
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
24
|
-
}> | PropTypes.InferProps<{
|
|
25
|
-
value: PropTypes.Requireable<string>;
|
|
26
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
27
|
-
}>[]>>;
|
|
28
|
-
let TextFieldProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
|
-
variant: PropTypes.Requireable<string>;
|
|
30
|
-
margin: PropTypes.Requireable<string>;
|
|
31
|
-
hiddenLabel: PropTypes.Requireable<boolean>;
|
|
32
|
-
}>>;
|
|
33
|
-
let lookupCode: PropTypes.Validator<string>;
|
|
34
|
-
let parents: PropTypes.Requireable<any[]>;
|
|
35
|
-
let getLookups: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
-
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
-
let lookups: PropTypes.Requireable<object>;
|
|
38
|
-
let resolveLookups: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
-
let fullWidth: PropTypes.Requireable<boolean>;
|
|
40
|
-
let placeholder: PropTypes.Requireable<string>;
|
|
41
|
-
let disabled: PropTypes.Requireable<boolean>;
|
|
42
|
-
let max: PropTypes.Requireable<number>;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
import PropTypes from 'prop-types';
|
|
26
|
+
};
|
|
27
|
+
export declare const DependentLookupEditor: ({ multiple, value, lookupCode: lookupTypeCode, TextFieldProps, parents, onChange, getLookups, lookups, resolveLookups, fullWidth, disabled, placeholder, max, ...otherProps }: Props) => JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -52,7 +52,6 @@ exports.DependentLookupEditor = exports.DEBOUNCE_INTERVAL = void 0;
|
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
53
|
var classnames_1 = __importDefault(require("classnames"));
|
|
54
54
|
var react_select_1 = require("react-select");
|
|
55
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
56
55
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
57
56
|
var ramda_1 = require("ramda");
|
|
58
57
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
@@ -192,7 +191,9 @@ var DependentLookupEditor = function (_a) {
|
|
|
192
191
|
}, [lookupTypeCode]);
|
|
193
192
|
var displayedOptions = (0, react_1.useMemo)(function () { return options.slice(0, pageNumber * max); }, [max, options, pageNumber]);
|
|
194
193
|
var showMoreButton = options.length > displayedOptions.length;
|
|
195
|
-
var isEmptyValue = multiple
|
|
194
|
+
var isEmptyValue = multiple
|
|
195
|
+
? (0, ramda_1.isEmpty)(value)
|
|
196
|
+
: !(value === null || value === void 0 ? void 0 : value.lookupCode) && !(value === null || value === void 0 ? void 0 : value.value);
|
|
196
197
|
var markAsTouched = (0, useAutopopulation_1.useAutopopulation)({
|
|
197
198
|
initialDefaultOptions: initialDefaultOptions,
|
|
198
199
|
isEmptyValue: isEmptyValue,
|
|
@@ -207,22 +208,3 @@ var DependentLookupEditor = function (_a) {
|
|
|
207
208
|
}, components: SelectComponents, isClearable: true, isSearchable: true, controlShouldRenderValue: multiple, inputValue: inputValue, filterOption: multiple ? undefined : ramda_1.T, onInputChange: handleInputChange, loadingMessage: function () { return ui_i18n_1.default.text('Loading...'); }, isLoading: !inputValue && isLoadingDefaultOptions, hideSelectedOptions: false, placeholder: placeholder || '', isDisabled: disabled, options: displayedOptions, getOptionValue: (0, ramda_1.either)((0, ramda_1.prop)('value'), (0, ramda_1.prop)('lookupCode')), getOptionLabel: helpers_1.getOptionLabel, onChange: handleChange, onFocus: multiple ? undefined : handleFocus, value: (0, ramda_1.defaultTo)(multiple ? [] : null, value), menuListFooter: showMoreButton && react_1.default.createElement(ReactSelectLoadMoreButton_1.ReactSelectLoadMoreButton, { loading: optionsAreLoading, onClick: loadMoreOptions }) })));
|
|
208
209
|
};
|
|
209
210
|
exports.DependentLookupEditor = DependentLookupEditor;
|
|
210
|
-
exports.DependentLookupEditor.propTypes = {
|
|
211
|
-
multiple: prop_types_1.default.bool,
|
|
212
|
-
value: prop_types_1.default.oneOfType([mdm_sdk_1.LookupValueType, prop_types_1.default.arrayOf(mdm_sdk_1.LookupValueType)]),
|
|
213
|
-
TextFieldProps: prop_types_1.default.shape({
|
|
214
|
-
variant: prop_types_1.default.string,
|
|
215
|
-
margin: prop_types_1.default.string,
|
|
216
|
-
hiddenLabel: prop_types_1.default.bool
|
|
217
|
-
}),
|
|
218
|
-
lookupCode: prop_types_1.default.string.isRequired,
|
|
219
|
-
parents: prop_types_1.default.array,
|
|
220
|
-
getLookups: prop_types_1.default.func,
|
|
221
|
-
onChange: prop_types_1.default.func,
|
|
222
|
-
lookups: prop_types_1.default.object,
|
|
223
|
-
resolveLookups: prop_types_1.default.func,
|
|
224
|
-
fullWidth: prop_types_1.default.bool,
|
|
225
|
-
placeholder: prop_types_1.default.string,
|
|
226
|
-
disabled: prop_types_1.default.bool,
|
|
227
|
-
max: prop_types_1.default.number
|
|
228
|
-
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MultipliableSelect from '../components/MultipliableSelect/MultipliableSelect';
|
|
3
|
+
import { DropDownEntryType } from '../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
entries: DropDownEntryType[];
|
|
6
|
+
classes?: Record<string, string>;
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
disableUnderline?: boolean;
|
|
10
|
+
displayEmpty?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
} & Omit<React.ComponentProps<typeof MultipliableSelect>, 'children' | 'getValueLabel' | 'onChange' | 'value'>;
|
|
13
|
+
export declare const DropDownEditor: ({ entries, classes, ...otherProps }: Props) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -27,11 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.DropDownEditor = void 0;
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
31
30
|
var ramda_1 = require("ramda");
|
|
32
31
|
var MenuItem_1 = __importDefault(require("@mui/material/MenuItem"));
|
|
33
32
|
var MultipliableSelect_1 = __importDefault(require("../components/MultipliableSelect/MultipliableSelect"));
|
|
34
|
-
var prop_types_2 = require("../constants/prop-types");
|
|
35
33
|
var findEntryByValue = function (entries) { return function (value) { return entries.find((0, ramda_1.propEq)('value', value)); }; };
|
|
36
34
|
var DropDownEditor = function (_a) {
|
|
37
35
|
var entries = _a.entries, _b = _a.classes, classes = _b === void 0 ? {} : _b, otherProps = __rest(_a, ["entries", "classes"]);
|
|
@@ -42,7 +40,3 @@ var DropDownEditor = function (_a) {
|
|
|
42
40
|
})));
|
|
43
41
|
};
|
|
44
42
|
exports.DropDownEditor = DropDownEditor;
|
|
45
|
-
exports.DropDownEditor.propTypes = {
|
|
46
|
-
classes: prop_types_1.default.object,
|
|
47
|
-
entries: prop_types_1.default.arrayOf(prop_types_2.DropDownEntryType).isRequired
|
|
48
|
-
};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, Entity, AttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { ScrollType } from '../contexts/ScrollToElementContext';
|
|
4
|
+
import { EditModeAttributesPagerProps } from '../EditModeAttributesPager/types';
|
|
1
5
|
declare const _default: React.ComponentType<{
|
|
2
|
-
|
|
3
|
-
|
|
6
|
+
parentAttributeType?: AttributeType;
|
|
7
|
+
attrTypes: AttributeType[];
|
|
8
|
+
entity: Entity;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
showEmptyEditors?: boolean;
|
|
11
|
+
showNonOv?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
alwaysVisibleTypeUris?: string[];
|
|
14
|
+
highlightAttribute?: (element: AttributeType, type: ScrollType) => void;
|
|
15
|
+
} & Pick<EditModeAttributesPagerProps<AttributeValue>, "mode" | "crosswalks" | "parentUri" | "onDeleteAttribute" | "onChangeAttribute" | "additionalControlsRenderer" | "showEmptyEditors" | "onAddAttributes" | "drawLines">>;
|
|
4
16
|
export default _default;
|
|
5
|
-
import React from 'react';
|
|
@@ -38,7 +38,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
var react_1 = __importStar(require("react"));
|
|
41
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
42
41
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
43
42
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
44
43
|
var ramda_1 = require("ramda");
|
|
@@ -100,25 +99,6 @@ var EditModeAttributesList = function (_a) {
|
|
|
100
99
|
return (react_1.default.createElement(EditModeAttributesPager_1.EditModeAttributesPager, { key: "".concat(attrType.uri, "_").concat(parentUri), attributeType: attrType, drawLines: drawLines, values: values, paging: (0, ramda_1.path)(['paging', attrType.uri], attributes), parentUri: parentUri, showEmptyEditors: showEmptyEditors, mode: mode, crosswalks: crosswalks, onAddAttributes: onAddAttributes, onChangeAttribute: onChangeAttribute, onDeleteAttribute: onDeleteAttribute, additionalControlsRenderer: additionalControlsRenderer, showNonOv: showNonOv }));
|
|
101
100
|
}))));
|
|
102
101
|
};
|
|
103
|
-
EditModeAttributesList.propTypes = {
|
|
104
|
-
parentAttributeType: prop_types_1.default.object,
|
|
105
|
-
attrTypes: prop_types_1.default.array,
|
|
106
|
-
entity: prop_types_1.default.object,
|
|
107
|
-
parentUri: prop_types_1.default.string,
|
|
108
|
-
children: prop_types_1.default.node,
|
|
109
|
-
showEmptyEditors: prop_types_1.default.bool,
|
|
110
|
-
mode: mdm_sdk_1.ModeType,
|
|
111
|
-
crosswalks: prop_types_1.default.array,
|
|
112
|
-
drawLines: prop_types_1.default.bool,
|
|
113
|
-
showNonOv: prop_types_1.default.bool,
|
|
114
|
-
className: prop_types_1.default.string,
|
|
115
|
-
alwaysVisibleTypeUris: prop_types_1.default.array,
|
|
116
|
-
onAddAttributes: prop_types_1.default.func,
|
|
117
|
-
onChangeAttribute: prop_types_1.default.func,
|
|
118
|
-
onDeleteAttribute: prop_types_1.default.func,
|
|
119
|
-
additionalControlsRenderer: prop_types_1.default.func,
|
|
120
|
-
highlightAttribute: prop_types_1.default.func
|
|
121
|
-
};
|
|
122
102
|
exports.default = (0, withContext_1.withContext)(ScrollToElementContext_1.ScrollToElementContext, function (contextValue) {
|
|
123
103
|
var highlightAttribute = (contextValue || {}).highlightAttribute;
|
|
124
104
|
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,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -39,7 +28,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
29
|
var react_1 = __importStar(require("react"));
|
|
41
30
|
var ramda_1 = require("ramda");
|
|
42
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
43
31
|
var classnames_1 = __importDefault(require("classnames"));
|
|
44
32
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
45
33
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
@@ -99,10 +87,12 @@ var EditModeComplexAttribute = function (_a) {
|
|
|
99
87
|
}
|
|
100
88
|
}, [deleted]);
|
|
101
89
|
var hasAnalyticValue = (attributeTypesList || []).some(function (attributeType) { return (0, mdm_sdk_1.isAnalyticAttribute)(attributeType); });
|
|
102
|
-
var attributeListEntity = (0, react_1.useMemo)(function () {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
90
|
+
var attributeListEntity = (0, react_1.useMemo)(function () {
|
|
91
|
+
return ({
|
|
92
|
+
attributes: hasAnalyticValue ? null : attributeValue.value,
|
|
93
|
+
analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
|
|
94
|
+
});
|
|
95
|
+
}, [attributeValue, hasAnalyticValue]);
|
|
106
96
|
var errorMessage = (0, mdm_sdk_1.getErrorMessage)(ownError) || (hasDescendantsWithErrors && ui_i18n_1.default.text('Has an incorrect value')) || '';
|
|
107
97
|
return lazy ? (react_1.default.createElement(Button_1.default, { variant: "text", color: "primary", onClick: onAddOneMore }, "Create attribute")) : (react_1.default.createElement("div", { ref: ref, className: (0, classnames_1.default)(styles.complexWrapper, errorClassName) },
|
|
108
98
|
react_1.default.createElement("div", { className: styles.editor },
|
|
@@ -119,7 +109,6 @@ var EditModeComplexAttribute = function (_a) {
|
|
|
119
109
|
showDeleteButton && (react_1.default.createElement(SmallIconButton_1.SmallIconButton, { icon: Delete_1.default, onClick: onDeleteThis, size: "L", "data-reltio-id": "reltio-delete-complex-attribute-button" })))),
|
|
120
110
|
expanded && (react_1.default.createElement(EditModeAttributesList_1.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))));
|
|
121
111
|
};
|
|
122
|
-
EditModeComplexAttribute.propTypes = __assign({ label: prop_types_1.default.string, children: prop_types_1.default.node, attributeTypesList: prop_types_1.default.arrayOf(mdm_sdk_1.AttributeTypeType), attributeValue: prop_types_1.default.oneOfType([mdm_sdk_1.NestedAttributeValueType, mdm_sdk_1.ReferenceAttributeValueType]), highlightedError: prop_types_1.default.object, isHighlightedPath: prop_types_1.default.bool }, mdm_sdk_1.ComplexAttributeType);
|
|
123
112
|
exports.default = (0, withContext_1.withContext)(ScrollToElementContext_1.ScrollToElementContext, function (contextValue, _a) {
|
|
124
113
|
var attributeValue = _a.attributeValue;
|
|
125
114
|
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 {};
|
|
@@ -50,7 +50,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
51
|
exports.EntitySelector = void 0;
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
54
53
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
55
54
|
var ramda_1 = require("ramda");
|
|
56
55
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
@@ -108,16 +107,3 @@ var EntitySelector = function (_a) {
|
|
|
108
107
|
react_1.default.createElement(EntityCreator_1.EntityCreator, { mode: mode, attributeTypesSelectionStrategy: attributeTypesSelectionStrategy, entityType: currentEntityType, entityUri: entity.entityUri })))));
|
|
109
108
|
};
|
|
110
109
|
exports.EntitySelector = EntitySelector;
|
|
111
|
-
exports.EntitySelector.propTypes = {
|
|
112
|
-
entity: mdm_sdk_1.ConnectionEntityType,
|
|
113
|
-
entityTypesUris: prop_types_1.default.arrayOf(prop_types_1.default.string),
|
|
114
|
-
max: prop_types_1.default.number,
|
|
115
|
-
mode: mdm_sdk_1.ModeType,
|
|
116
|
-
dispatch: prop_types_1.default.func,
|
|
117
|
-
metadata: mdm_sdk_1.MetadataType,
|
|
118
|
-
onChange: prop_types_1.default.func.isRequired,
|
|
119
|
-
onCreate: prop_types_1.default.func,
|
|
120
|
-
attributeTypesSelectionStrategy: prop_types_1.default.func,
|
|
121
|
-
globalSearchRequestOptions: prop_types_1.default.object,
|
|
122
|
-
disableLinkClick: prop_types_1.default.bool
|
|
123
|
-
};
|