@reltio/components 1.4.1372 → 1.4.1374

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/cjs/components/RelationEditor/RelationEditor.d.ts +5 -32
  2. package/cjs/components/RelationEditor/RelationEditor.js +33 -22
  3. package/cjs/components/RelationEditor/index.d.ts +3 -152
  4. package/cjs/components/RelationEditor/styles.js +2 -1
  5. package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.d.ts +10 -6
  6. package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.js +19 -5
  7. package/cjs/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
  8. package/cjs/components/attributes/editMode/AttributesPager/styles.js +2 -1
  9. package/cjs/components/attributes/editMode/AttributesPager/utils.d.ts +2 -1
  10. package/cjs/components/attributes/editMode/AttributesView/styles.js +1 -0
  11. package/cjs/components/attributes/editMode/ComplexAttribute/ComplexAttribute.d.ts +5 -160
  12. package/cjs/components/attributes/editMode/ComplexAttribute/ComplexAttribute.js +29 -13
  13. package/cjs/components/attributes/editMode/ComplexAttribute/styles.d.ts +1 -1
  14. package/cjs/components/attributes/editMode/ComplexAttribute/styles.js +3 -0
  15. package/cjs/components/attributes/editMode/ReferenceAttribute/ReferenceAttribute.d.ts +1 -130
  16. package/cjs/components/attributes/editMode/ReferenceAttribute/ReferenceAttribute.js +24 -19
  17. package/cjs/components/attributes/editMode/ReferenceAttribute/index.d.ts +1 -129
  18. package/cjs/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +1 -1
  19. package/cjs/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.js +23 -12
  20. package/cjs/components/attributes/editMode/SimpleAttributeEditor/styles.d.ts +1 -1
  21. package/cjs/components/attributes/editMode/SimpleAttributeEditor/styles.js +2 -1
  22. package/cjs/components/editors/DataTypeValueEditor/DataTypeValueEditor.d.ts +18 -17
  23. package/cjs/components/editors/DataTypeValueEditor/DataTypeValueEditor.js +3 -1
  24. package/cjs/contexts/ScrollToErrorContext/index.d.ts +13 -0
  25. package/cjs/contexts/ScrollToErrorContext/index.js +48 -0
  26. package/cjs/contexts/index.d.ts +1 -0
  27. package/cjs/contexts/index.js +4 -1
  28. package/cjs/hooks/index.d.ts +1 -0
  29. package/cjs/hooks/index.js +3 -1
  30. package/cjs/hooks/useScrollToAttributeError/styles.d.ts +1 -0
  31. package/cjs/hooks/useScrollToAttributeError/styles.js +49 -0
  32. package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.d.ts +14 -0
  33. package/cjs/hooks/useScrollToAttributeError/useScrollToAttributeError.js +31 -0
  34. package/esm/components/RelationEditor/RelationEditor.d.ts +5 -32
  35. package/esm/components/RelationEditor/RelationEditor.js +33 -22
  36. package/esm/components/RelationEditor/index.d.ts +3 -152
  37. package/esm/components/RelationEditor/styles.js +2 -1
  38. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.d.ts +10 -6
  39. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.js +20 -6
  40. package/esm/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
  41. package/esm/components/attributes/editMode/AttributesPager/styles.js +2 -1
  42. package/esm/components/attributes/editMode/AttributesPager/utils.d.ts +2 -1
  43. package/esm/components/attributes/editMode/AttributesView/styles.js +1 -0
  44. package/esm/components/attributes/editMode/ComplexAttribute/ComplexAttribute.d.ts +5 -160
  45. package/esm/components/attributes/editMode/ComplexAttribute/ComplexAttribute.js +29 -13
  46. package/esm/components/attributes/editMode/ComplexAttribute/styles.d.ts +1 -1
  47. package/esm/components/attributes/editMode/ComplexAttribute/styles.js +3 -0
  48. package/esm/components/attributes/editMode/ReferenceAttribute/ReferenceAttribute.d.ts +1 -130
  49. package/esm/components/attributes/editMode/ReferenceAttribute/ReferenceAttribute.js +27 -22
  50. package/esm/components/attributes/editMode/ReferenceAttribute/index.d.ts +1 -129
  51. package/esm/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +1 -1
  52. package/esm/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.js +24 -13
  53. package/esm/components/attributes/editMode/SimpleAttributeEditor/styles.d.ts +1 -1
  54. package/esm/components/attributes/editMode/SimpleAttributeEditor/styles.js +2 -1
  55. package/esm/components/editors/DataTypeValueEditor/DataTypeValueEditor.d.ts +18 -17
  56. package/esm/components/editors/DataTypeValueEditor/DataTypeValueEditor.js +3 -1
  57. package/esm/contexts/ScrollToErrorContext/index.d.ts +13 -0
  58. package/esm/contexts/ScrollToErrorContext/index.js +21 -0
  59. package/esm/contexts/index.d.ts +1 -0
  60. package/esm/contexts/index.js +1 -0
  61. package/esm/hooks/index.d.ts +1 -0
  62. package/esm/hooks/index.js +1 -0
  63. package/esm/hooks/useScrollToAttributeError/styles.d.ts +1 -0
  64. package/esm/hooks/useScrollToAttributeError/styles.js +46 -0
  65. package/esm/hooks/useScrollToAttributeError/useScrollToAttributeError.d.ts +14 -0
  66. package/esm/hooks/useScrollToAttributeError/useScrollToAttributeError.js +24 -0
  67. package/package.json +4 -4
@@ -1,160 +1,5 @@
1
- export default ComplexAttribute;
2
- declare function ComplexAttribute({ label, attributeTypesList, attributeType, attributeValue, children, errors, ownError, mode, metadata, crosswalks, lazy, showEmptyEditors, onAddOneMore, onAddAttributes, onDeleteAttribute, onChangeAttribute, additionalControlsRenderer, hideDeleteButton, state, showNonOv, expanded: expandedProp }: {
3
- label: any;
4
- attributeTypesList: any;
5
- attributeType: any;
6
- attributeValue: any;
7
- children: any;
8
- errors: any;
9
- ownError: any;
10
- mode: any;
11
- metadata: any;
12
- crosswalks: any;
13
- lazy: any;
14
- showEmptyEditors: any;
15
- onAddOneMore: any;
16
- onAddAttributes: any;
17
- onDeleteAttribute: any;
18
- onChangeAttribute: any;
19
- additionalControlsRenderer: any;
20
- hideDeleteButton: any;
21
- state: any;
22
- showNonOv: any;
23
- expanded?: boolean;
24
- }): JSX.Element;
25
- declare namespace ComplexAttribute {
26
- const propTypes: {
27
- attributeType: PropTypes.Requireable<PropTypes.InferProps<{
28
- label: PropTypes.Requireable<string>;
29
- name: PropTypes.Requireable<string>;
30
- description: PropTypes.Requireable<string>;
31
- type: PropTypes.Requireable<string>;
32
- hidden: PropTypes.Requireable<boolean>;
33
- faceted: PropTypes.Requireable<boolean>;
34
- searchable: PropTypes.Requireable<boolean>;
35
- uri: PropTypes.Requireable<string>;
36
- access: PropTypes.Requireable<string[]>;
37
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
38
- minValue: PropTypes.Requireable<number>;
39
- maxValue: PropTypes.Requireable<number>;
40
- }>>;
41
- }>>;
42
- showEmptyEditors: PropTypes.Requireable<boolean>;
43
- lazy: PropTypes.Requireable<boolean>;
44
- mode: PropTypes.Requireable<any>;
45
- metadata: PropTypes.Requireable<PropTypes.InferProps<{
46
- uri: PropTypes.Requireable<string>;
47
- description: PropTypes.Requireable<string>;
48
- label: PropTypes.Requireable<string>;
49
- schemaVersion: PropTypes.Requireable<string>;
50
- entityTypes: PropTypes.Requireable<PropTypes.InferProps<{
51
- typeColor: PropTypes.Requireable<string>;
52
- typeIcon: PropTypes.Requireable<string>;
53
- typeImage: PropTypes.Requireable<string>;
54
- label: PropTypes.Requireable<string>;
55
- uri: PropTypes.Requireable<string>;
56
- attributes: PropTypes.Requireable<PropTypes.InferProps<{
57
- label: PropTypes.Requireable<string>;
58
- name: PropTypes.Requireable<string>;
59
- description: PropTypes.Requireable<string>;
60
- type: PropTypes.Requireable<string>;
61
- hidden: PropTypes.Requireable<boolean>;
62
- faceted: PropTypes.Requireable<boolean>;
63
- searchable: PropTypes.Requireable<boolean>;
64
- uri: PropTypes.Requireable<string>;
65
- access: PropTypes.Requireable<string[]>;
66
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
67
- minValue: PropTypes.Requireable<number>;
68
- maxValue: PropTypes.Requireable<number>;
69
- }>>;
70
- }>[]>;
71
- }>[]>;
72
- roles: PropTypes.Requireable<object[]>;
73
- groupTypes: PropTypes.Requireable<object[]>;
74
- relationTypes: PropTypes.Requireable<PropTypes.InferProps<{
75
- label: PropTypes.Requireable<string>;
76
- uri: PropTypes.Requireable<string>;
77
- typeColor: PropTypes.Requireable<string>;
78
- direction: PropTypes.Requireable<string>;
79
- startObject: PropTypes.Requireable<object>;
80
- endObject: PropTypes.Requireable<object>;
81
- }>[]>;
82
- graphTypes: PropTypes.Requireable<PropTypes.InferProps<{
83
- uri: PropTypes.Requireable<string>;
84
- label: PropTypes.Requireable<string>;
85
- extendsTypeUri: PropTypes.Requireable<string>;
86
- relationshipTypeURIs: PropTypes.Requireable<string[]>;
87
- }>[]>;
88
- interactionTypes: PropTypes.Requireable<PropTypes.InferProps<{
89
- uri: PropTypes.Requireable<string>;
90
- label: PropTypes.Requireable<string>;
91
- memberTypes: PropTypes.Requireable<any[]>;
92
- extendsTypeUri: PropTypes.Requireable<string>;
93
- attributes: PropTypes.Requireable<PropTypes.InferProps<{
94
- label: PropTypes.Requireable<string>;
95
- name: PropTypes.Requireable<string>;
96
- description: PropTypes.Requireable<string>;
97
- type: PropTypes.Requireable<string>;
98
- hidden: PropTypes.Requireable<boolean>;
99
- faceted: PropTypes.Requireable<boolean>;
100
- searchable: PropTypes.Requireable<boolean>;
101
- uri: PropTypes.Requireable<string>;
102
- access: PropTypes.Requireable<string[]>;
103
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
104
- minValue: PropTypes.Requireable<number>;
105
- maxValue: PropTypes.Requireable<number>;
106
- }>>;
107
- }>[]>;
108
- }>[]>;
109
- sources: PropTypes.Requireable<object[]>;
110
- }>>;
111
- ownError: PropTypes.Requireable<PropTypes.InferProps<{
112
- type: PropTypes.Validator<NonNullable<import("@reltio/mdm-sdk").ErrorType>>;
113
- attributeTypeUri: PropTypes.Validator<string>;
114
- parentUri: PropTypes.Validator<string>;
115
- uri: PropTypes.Requireable<string>;
116
- message: PropTypes.Requireable<string>;
117
- }>>;
118
- errors: PropTypes.Requireable<PropTypes.InferProps<{
119
- type: PropTypes.Validator<NonNullable<import("@reltio/mdm-sdk").ErrorType>>;
120
- attributeTypeUri: PropTypes.Validator<string>;
121
- parentUri: PropTypes.Validator<string>;
122
- uri: PropTypes.Requireable<string>;
123
- message: PropTypes.Requireable<string>;
124
- }>[]>;
125
- crosswalks: PropTypes.Requireable<any[]>;
126
- onAddAttributes: PropTypes.Requireable<(...args: any[]) => any>;
127
- onAddOneMore: PropTypes.Requireable<(...args: any[]) => any>;
128
- onDeleteAttribute: PropTypes.Requireable<(...args: any[]) => any>;
129
- onChangeAttribute: PropTypes.Requireable<(...args: any[]) => any>;
130
- additionalControlsRenderer: PropTypes.Requireable<(...args: any[]) => any>;
131
- hideDeleteButton: PropTypes.Requireable<boolean>;
132
- showNonOv: PropTypes.Requireable<boolean>;
133
- state: PropTypes.Requireable<string>;
134
- expanded: PropTypes.Requireable<boolean>;
135
- label: PropTypes.Requireable<string>;
136
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
137
- attributeTypesList: PropTypes.Requireable<PropTypes.InferProps<{
138
- label: PropTypes.Requireable<string>;
139
- name: PropTypes.Requireable<string>;
140
- description: PropTypes.Requireable<string>;
141
- type: PropTypes.Requireable<string>;
142
- hidden: PropTypes.Requireable<boolean>;
143
- faceted: PropTypes.Requireable<boolean>;
144
- searchable: PropTypes.Requireable<boolean>;
145
- uri: PropTypes.Requireable<string>;
146
- access: PropTypes.Requireable<string[]>;
147
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
148
- minValue: PropTypes.Requireable<number>;
149
- maxValue: PropTypes.Requireable<number>;
150
- }>>;
151
- }>[]>;
152
- attributeValue: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
153
- value: PropTypes.Requireable<object>;
154
- ov: PropTypes.Requireable<boolean>;
155
- type: PropTypes.Requireable<string>;
156
- uri: PropTypes.Requireable<string>;
157
- }>>>;
158
- };
159
- }
160
- import PropTypes from "prop-types";
1
+ declare const _default: React.ComponentType<{
2
+ [x: string]: unknown;
3
+ }> | ((props: any) => JSX.Element);
4
+ export default _default;
5
+ import React from "react";
@@ -10,21 +10,25 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import React, { useMemo, useState, useEffect } from 'react';
13
+ import { pipe, propOr, pathEq, any } from 'ramda';
13
14
  import PropTypes from 'prop-types';
14
15
  import classnames from 'classnames';
16
+ import i18n from 'ui-i18n';
17
+ import { checkCanDeleteAttribute, isReltioCrosswalk, isTempUri, ComplexAttributeType, ReferenceAttributeValueType, NestedAttributeValueType, AttributeTypeType, getErrorMessage, hasAttributeDescendantsWithErrors, isAnalyticAttribute } from '@reltio/mdm-sdk';
15
18
  import Button from '@material-ui/core/Button';
16
- import SmallIconButton from '../../../SmallIconButton/SmallIconButton';
17
19
  import DeleteIcon from '@material-ui/icons/Delete';
18
20
  import Typography from '@material-ui/core/Typography';
19
- import i18n from 'ui-i18n';
20
- import { checkCanDeleteAttribute, isReltioCrosswalk, isTempUri, ComplexAttributeType, ReferenceAttributeValueType, NestedAttributeValueType, AttributeTypeType, getErrorMessage, hasAttributeDescendantsWithErrors, isAnalyticAttribute } from '@reltio/mdm-sdk';
21
- import { useStyles } from './styles';
21
+ import SmallIconButton from '../../../SmallIconButton/SmallIconButton';
22
+ import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
22
23
  import ErrorWrapper from '../../../ErrorWrapper/ErrorWrapper';
23
24
  import AttributesList from '../AttributesList/AttributesList';
24
- import ArrowExpandButton from '../../../ArrowExpandButton/ArrowExpandButton';
25
+ import { withContext } from '../../../../HOCs';
26
+ import { ScrollToErrorContext } from '../../../../contexts';
27
+ import { useScrollToAttributeError } from '../../../../hooks';
28
+ import { useStyles } from './styles';
25
29
  var ComplexAttribute = function (_a) {
26
30
  var _b;
27
- var label = _a.label, attributeTypesList = _a.attributeTypesList, attributeType = _a.attributeType, attributeValue = _a.attributeValue, children = _a.children, errors = _a.errors, ownError = _a.ownError, mode = _a.mode, metadata = _a.metadata, crosswalks = _a.crosswalks, lazy = _a.lazy, showEmptyEditors = _a.showEmptyEditors, onAddOneMore = _a.onAddOneMore, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, hideDeleteButton = _a.hideDeleteButton, state = _a.state, showNonOv = _a.showNonOv, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c;
31
+ var label = _a.label, attributeTypesList = _a.attributeTypesList, attributeType = _a.attributeType, attributeValue = _a.attributeValue, children = _a.children, errors = _a.errors, ownError = _a.ownError, mode = _a.mode, metadata = _a.metadata, crosswalks = _a.crosswalks, lazy = _a.lazy, showEmptyEditors = _a.showEmptyEditors, onAddOneMore = _a.onAddOneMore, onAddAttributes = _a.onAddAttributes, onDeleteAttribute = _a.onDeleteAttribute, onChangeAttribute = _a.onChangeAttribute, additionalControlsRenderer = _a.additionalControlsRenderer, hideDeleteButton = _a.hideDeleteButton, state = _a.state, showNonOv = _a.showNonOv, isHighlightedPath = _a.isHighlightedPath, highlightedError = _a.highlightedError, _c = _a.expanded, expandedProp = _c === void 0 ? false : _c;
28
32
  var styles = useStyles();
29
33
  var deleted = state === 'deleted';
30
34
  var edited = state === 'edited';
@@ -32,6 +36,12 @@ var ComplexAttribute = function (_a) {
32
36
  var isNew = isTempUri(uri);
33
37
  var defaultExpand = isNew || expandedProp;
34
38
  var _d = useState(defaultExpand), expanded = _d[0], setExpanded = _d[1];
39
+ var _e = useScrollToAttributeError({ highlightedError: highlightedError }), ref = _e.ref, errorClassName = _e.errorClassName;
40
+ useEffect(function () {
41
+ if (isHighlightedPath) {
42
+ setExpanded(true);
43
+ }
44
+ }, [isHighlightedPath]);
35
45
  useEffect(function () {
36
46
  setExpanded(defaultExpand);
37
47
  }, [defaultExpand]);
@@ -46,10 +56,7 @@ var ComplexAttribute = function (_a) {
46
56
  }, [attributeType, attributeValue, mode, metadata, crosswalks]);
47
57
  var showDeleteButton = !deleted && !hideDeleteButton && !!onDeleteAttribute && canDelete;
48
58
  var onDeleteThis = function () { return onDeleteAttribute({ uri: uri, attributeType: attributeType, attributeValue: attributeValue }); };
49
- var hasDescendantsWithErrors = useMemo(function () { return hasAttributeDescendantsWithErrors(attributeValue, errors); }, [
50
- errors,
51
- attributeValue
52
- ]);
59
+ var hasDescendantsWithErrors = useMemo(function () { return hasAttributeDescendantsWithErrors(attributeValue, errors); }, [errors, attributeValue]);
53
60
  useEffect(function () {
54
61
  if (hasDescendantsWithErrors) {
55
62
  setExpanded(true);
@@ -66,7 +73,7 @@ var ComplexAttribute = function (_a) {
66
73
  analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
67
74
  }); }, [attributeValue, hasAnalyticValue]);
68
75
  var errorMessage = getErrorMessage(ownError) || (hasDescendantsWithErrors && i18n.text('Has an incorrect value')) || '';
69
- return lazy ? (React.createElement(Button, { variant: "text", color: "primary", onClick: onAddOneMore }, "Create attribute")) : (React.createElement(React.Fragment, null,
76
+ return lazy ? (React.createElement(Button, { variant: "text", color: "primary", onClick: onAddOneMore }, "Create attribute")) : (React.createElement("div", { ref: ref, className: classnames(styles.complexWrapper, errorClassName) },
70
77
  React.createElement("div", { className: styles.editor },
71
78
  React.createElement("div", { className: styles.titleContainer },
72
79
  React.createElement(ArrowExpandButton, { onClick: function () { return setExpanded(function (value) { return !value; }); }, expanded: expanded, className: styles.expandButton, disabled: deleted }),
@@ -81,5 +88,14 @@ var ComplexAttribute = function (_a) {
81
88
  showDeleteButton && React.createElement(SmallIconButton, { icon: DeleteIcon, onClick: onDeleteThis, size: "L" }))),
82
89
  expanded && (React.createElement(AttributesList, { 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))));
83
90
  };
84
- ComplexAttribute.propTypes = __assign({ label: PropTypes.string, children: PropTypes.node, attributeTypesList: PropTypes.arrayOf(AttributeTypeType), attributeValue: PropTypes.oneOfType([NestedAttributeValueType, ReferenceAttributeValueType]) }, ComplexAttributeType);
85
- export default ComplexAttribute;
91
+ ComplexAttribute.propTypes = __assign({ label: PropTypes.string, children: PropTypes.node, attributeTypesList: PropTypes.arrayOf(AttributeTypeType), attributeValue: PropTypes.oneOfType([NestedAttributeValueType, ReferenceAttributeValueType]), highlightedError: PropTypes.object, isHighlightedPath: PropTypes.bool }, ComplexAttributeType);
92
+ export default withContext(ScrollToErrorContext, function (contextValue, _a) {
93
+ var attributeValue = _a.attributeValue;
94
+ var error = (contextValue || {}).error;
95
+ var isHighlighted = (error === null || error === void 0 ? void 0 : error.uri) === attributeValue.uri;
96
+ var isHighlightedPath = pipe(propOr([], 'path'), any(pathEq(['value', 'uri'], attributeValue.uri)))(error);
97
+ return {
98
+ highlightedError: isHighlighted ? contextValue : null,
99
+ isHighlightedPath: isHighlightedPath
100
+ };
101
+ }, ComplexAttribute);
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"actions" | "label" | "deleted" | "editor" | "expandButton" | "editedLabel" | "titleContainer" | "errorWrapperHelperText">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"actions" | "label" | "deleted" | "editor" | "expandButton" | "editedLabel" | "complexWrapper" | "titleContainer" | "errorWrapperHelperText">;
@@ -1,5 +1,8 @@
1
1
  import { makeStyles } from '@material-ui/core/styles';
2
2
  export var useStyles = makeStyles(function (theme) { return ({
3
+ complexWrapper: {
4
+ position: 'relative'
5
+ },
3
6
  editor: {
4
7
  display: 'flex',
5
8
  flex: 1,
@@ -1,132 +1,3 @@
1
- declare const _default: React.MemoExoticComponent<{
2
- (props: any): JSX.Element;
3
- propTypes: {
4
- modifiedEntity: PropTypes.Requireable<PropTypes.InferProps<{
5
- uri: PropTypes.Requireable<string>;
6
- type: PropTypes.Requireable<string>;
7
- }>>;
8
- metadata: PropTypes.Requireable<PropTypes.InferProps<{
9
- uri: PropTypes.Requireable<string>;
10
- description: PropTypes.Requireable<string>;
11
- label: PropTypes.Requireable<string>;
12
- schemaVersion: PropTypes.Requireable<string>;
13
- entityTypes: PropTypes.Requireable<PropTypes.InferProps<{
14
- typeColor: PropTypes.Requireable<string>;
15
- typeIcon: PropTypes.Requireable<string>;
16
- typeImage: PropTypes.Requireable<string>;
17
- label: PropTypes.Requireable<string>;
18
- uri: PropTypes.Requireable<string>;
19
- attributes: PropTypes.Requireable<PropTypes.InferProps<{
20
- label: PropTypes.Requireable<string>;
21
- name: PropTypes.Requireable<string>;
22
- description: PropTypes.Requireable<string>;
23
- type: PropTypes.Requireable<string>;
24
- hidden: PropTypes.Requireable<boolean>;
25
- faceted: PropTypes.Requireable<boolean>;
26
- searchable: PropTypes.Requireable<boolean>;
27
- uri: PropTypes.Requireable<string>;
28
- access: PropTypes.Requireable<string[]>;
29
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
30
- minValue: PropTypes.Requireable<number>;
31
- maxValue: PropTypes.Requireable<number>;
32
- }>>;
33
- }>[]>;
34
- }>[]>;
35
- roles: PropTypes.Requireable<object[]>;
36
- groupTypes: PropTypes.Requireable<object[]>;
37
- relationTypes: PropTypes.Requireable<PropTypes.InferProps<{
38
- label: PropTypes.Requireable<string>;
39
- uri: PropTypes.Requireable<string>;
40
- typeColor: PropTypes.Requireable<string>;
41
- direction: PropTypes.Requireable<string>;
42
- startObject: PropTypes.Requireable<object>;
43
- endObject: PropTypes.Requireable<object>;
44
- }>[]>;
45
- graphTypes: PropTypes.Requireable<PropTypes.InferProps<{
46
- uri: PropTypes.Requireable<string>;
47
- label: PropTypes.Requireable<string>;
48
- extendsTypeUri: PropTypes.Requireable<string>;
49
- relationshipTypeURIs: PropTypes.Requireable<string[]>;
50
- }>[]>;
51
- interactionTypes: PropTypes.Requireable<PropTypes.InferProps<{
52
- uri: PropTypes.Requireable<string>;
53
- label: PropTypes.Requireable<string>;
54
- memberTypes: PropTypes.Requireable<any[]>;
55
- extendsTypeUri: PropTypes.Requireable<string>;
56
- attributes: PropTypes.Requireable<PropTypes.InferProps<{
57
- label: PropTypes.Requireable<string>;
58
- name: PropTypes.Requireable<string>;
59
- description: PropTypes.Requireable<string>;
60
- type: PropTypes.Requireable<string>;
61
- hidden: PropTypes.Requireable<boolean>;
62
- faceted: PropTypes.Requireable<boolean>;
63
- searchable: PropTypes.Requireable<boolean>;
64
- uri: PropTypes.Requireable<string>;
65
- access: PropTypes.Requireable<string[]>;
66
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
67
- minValue: PropTypes.Requireable<number>;
68
- maxValue: PropTypes.Requireable<number>;
69
- }>>;
70
- }>[]>;
71
- }>[]>;
72
- sources: PropTypes.Requireable<object[]>;
73
- }>>;
74
- globalSearchRequestOptions: PropTypes.Requireable<object>;
75
- onDeleteModifiedEntity: PropTypes.Requireable<(...args: any[]) => any>;
76
- onUpdateModifiedEntity: PropTypes.Requireable<(...args: any[]) => any>;
77
- onDeactivateError: PropTypes.Requireable<(...args: any[]) => any>;
78
- attributeType: PropTypes.Requireable<PropTypes.InferProps<{
79
- label: PropTypes.Requireable<string>;
80
- name: PropTypes.Requireable<string>;
81
- description: PropTypes.Requireable<string>;
82
- type: PropTypes.Requireable<string>;
83
- hidden: PropTypes.Requireable<boolean>;
84
- faceted: PropTypes.Requireable<boolean>;
85
- searchable: PropTypes.Requireable<boolean>;
86
- uri: PropTypes.Requireable<string>;
87
- access: PropTypes.Requireable<string[]>;
88
- cardinality: PropTypes.Requireable<PropTypes.InferProps<{
89
- minValue: PropTypes.Requireable<number>;
90
- maxValue: PropTypes.Requireable<number>;
91
- }>>;
92
- }>>;
93
- showEmptyEditors: PropTypes.Requireable<boolean>;
94
- lazy: PropTypes.Requireable<boolean>;
95
- mode: PropTypes.Requireable<any>;
96
- ownError: PropTypes.Requireable<PropTypes.InferProps<{
97
- type: PropTypes.Validator<NonNullable<import("@reltio/mdm-sdk").ErrorType>>;
98
- attributeTypeUri: PropTypes.Validator<string>;
99
- parentUri: PropTypes.Validator<string>;
100
- uri: PropTypes.Requireable<string>;
101
- message: PropTypes.Requireable<string>;
102
- }>>;
103
- errors: PropTypes.Requireable<PropTypes.InferProps<{
104
- type: PropTypes.Validator<NonNullable<import("@reltio/mdm-sdk").ErrorType>>;
105
- attributeTypeUri: PropTypes.Validator<string>;
106
- parentUri: PropTypes.Validator<string>;
107
- uri: PropTypes.Requireable<string>;
108
- message: PropTypes.Requireable<string>;
109
- }>[]>;
110
- crosswalks: PropTypes.Requireable<any[]>;
111
- onAddAttributes: PropTypes.Requireable<(...args: any[]) => any>;
112
- onAddOneMore: PropTypes.Requireable<(...args: any[]) => any>;
113
- onDeleteAttribute: PropTypes.Requireable<(...args: any[]) => any>;
114
- onChangeAttribute: PropTypes.Requireable<(...args: any[]) => any>;
115
- additionalControlsRenderer: PropTypes.Requireable<(...args: any[]) => any>;
116
- hideDeleteButton: PropTypes.Requireable<boolean>;
117
- showNonOv: PropTypes.Requireable<boolean>;
118
- state: PropTypes.Requireable<string>;
119
- expanded: PropTypes.Requireable<boolean>;
120
- attributeValue: PropTypes.Requireable<PropTypes.InferProps<{
121
- refEntity: PropTypes.Requireable<object>;
122
- refRelation: PropTypes.Requireable<object>;
123
- value: PropTypes.Requireable<object>;
124
- ov: PropTypes.Requireable<boolean>;
125
- type: PropTypes.Requireable<string>;
126
- uri: PropTypes.Requireable<string>;
127
- }>>;
128
- };
129
- }>;
1
+ declare const _default: React.ComponentType<any> | ((props: any) => JSX.Element);
130
2
  export default _default;
131
- import PropTypes from "prop-types";
132
3
  import React from "react";
@@ -20,21 +20,25 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React, { memo, useMemo, useCallback, useRef } from 'react';
23
+ import React, { useMemo, useCallback, useRef } from 'react';
24
24
  import PropTypes from 'prop-types';
25
25
  import classnames from 'classnames';
26
- import { identity, pipe, isEmpty } from 'ramda';
27
- import { evaluateDeepEntityLabel, ReferenceAttributeType, referencedEntityAttributeTypesSelectionStrategy, getEntityType, getReferencedEntityFromAttrValue, getReferencedRelationFromAttrValue, getReferencedEntityUri, getReferencedEntityTypeUri, getReferencedEntityTypeUriFromAttrType, getReferencedRelationAttrTypesUris, findAttributeTypeByUri, getCreatableAttributeTypes, createTemporaryEntity, convertReferencedEntityForAttrValue, createReferencedRelationForAttrValue, addReferencedRelationCrosswalks, getReferencedEntityUriFromAttrValue, checkCanEditAttribute, checkMetadataForCreate, isReltioCrosswalk, getErrorMessage, EntityType, MetadataType, getErrorId, getReferencedEntityActiveError, isTempUri, getLabel } from '@reltio/mdm-sdk';
26
+ import { identity, pipe, isEmpty, allPass, prop, propEq } from 'ramda';
27
+ import { evaluateDeepEntityLabel, ReferenceAttributeType, referencedEntityAttributeTypesSelectionStrategy, getEntityType, getReferencedEntityFromAttrValue, getReferencedRelationFromAttrValue, getReferencedEntityUri, getReferencedEntityTypeUri, getReferencedEntityTypeUriFromAttrType, getReferencedRelationAttrTypesUris, findAttributeTypeByUri, getCreatableAttributeTypes, createTemporaryEntity, convertReferencedEntityForAttrValue, createReferencedRelationForAttrValue, addReferencedRelationCrosswalks, getReferencedEntityUriFromAttrValue, checkCanEditAttribute, checkMetadataForCreate, isReltioCrosswalk, getErrorMessage, EntityType, MetadataType, getErrorId, getReferencedEntityActiveError, isTempUri, getLabel, isEmptyValue } from '@reltio/mdm-sdk';
28
28
  import ComplexAttribute from '../ComplexAttribute/ComplexAttribute';
29
29
  import EntitySelector from '../EntitySelector/EntitySelector';
30
30
  import { ErrorWrapper } from '../../../index';
31
+ import { withContext } from '../../../../HOCs';
32
+ import { ScrollToErrorContext } from '../../../../contexts';
33
+ import { useScrollToAttributeError } from '../../../../hooks';
31
34
  import { useStyles } from './styles';
32
35
  var ReferenceAttribute = function (props) {
33
36
  var _a;
34
37
  var styles = useStyles();
35
- var modifiedEntity = props.modifiedEntity, metadata = props.metadata, globalSearchRequestOptions = props.globalSearchRequestOptions, onDeleteModifiedEntity = props.onDeleteModifiedEntity, onUpdateModifiedEntity = props.onUpdateModifiedEntity, onDeactivateError = props.onDeactivateError, ownProps = __rest(props, ["modifiedEntity", "metadata", "globalSearchRequestOptions", "onDeleteModifiedEntity", "onUpdateModifiedEntity", "onDeactivateError"]);
38
+ var modifiedEntity = props.modifiedEntity, metadata = props.metadata, globalSearchRequestOptions = props.globalSearchRequestOptions, onDeleteModifiedEntity = props.onDeleteModifiedEntity, onUpdateModifiedEntity = props.onUpdateModifiedEntity, onDeactivateError = props.onDeactivateError, highlightedError = props.highlightedError, ownProps = __rest(props, ["modifiedEntity", "metadata", "globalSearchRequestOptions", "onDeleteModifiedEntity", "onUpdateModifiedEntity", "onDeactivateError", "highlightedError"]);
36
39
  var attributeValue = ownProps.attributeValue, attributeType = ownProps.attributeType, mode = ownProps.mode, crosswalks = ownProps.crosswalks, errors = ownProps.errors, onChangeAttribute = ownProps.onChangeAttribute;
37
40
  var initialAttributeValue = useRef(attributeValue);
41
+ var _b = useScrollToAttributeError({ highlightedError: highlightedError, isSimple: true }), ref = _b.ref, errorClassName = _b.errorClassName;
38
42
  var referencedEntity = getReferencedEntityFromAttrValue(attributeValue);
39
43
  var referencedRelation = getReferencedRelationFromAttrValue(attributeValue);
40
44
  var referencedEntityTypeUri = getReferencedEntityTypeUriFromAttrType(attributeType);
@@ -43,14 +47,8 @@ var ReferenceAttribute = function (props) {
43
47
  ? evaluateDeepEntityLabel(modifiedEntity, referencedEntityType.dataLabelPattern)
44
48
  : attributeValue.label;
45
49
  var entityTypesUris = useMemo(function () { return [referencedEntityTypeUri]; }, [referencedEntityTypeUri]);
46
- var allCrosswalks = useMemo(function () { return addReferencedRelationCrosswalks(crosswalks, referencedRelation); }, [
47
- crosswalks,
48
- referencedRelation
49
- ]);
50
- var referencedEntityMissedError = useMemo(function () { return getReferencedEntityActiveError(attributeValue, errors); }, [
51
- attributeValue,
52
- errors
53
- ]);
50
+ var allCrosswalks = useMemo(function () { return addReferencedRelationCrosswalks(crosswalks, referencedRelation); }, [crosswalks, referencedRelation]);
51
+ var referencedEntityMissedError = useMemo(function () { return getReferencedEntityActiveError(attributeValue, errors); }, [attributeValue, errors]);
54
52
  var selectedEntity = useMemo(function () {
55
53
  return referencedEntity && {
56
54
  entityUri: getReferencedEntityUri(referencedEntity),
@@ -113,16 +111,23 @@ var ReferenceAttribute = function (props) {
113
111
  isReltioCrosswalk: isReltioCrosswalk(crosswalks, attributeValue)
114
112
  });
115
113
  }, [attributeType, attributeValue, mode, crosswalks]);
116
- var canCreateReferencedEntity = useMemo(function () { return checkMetadataForCreate(mode, referencedEntityType); }, [
117
- mode,
118
- referencedEntityType
119
- ]);
114
+ var canCreateReferencedEntity = useMemo(function () { return checkMetadataForCreate(mode, referencedEntityType); }, [mode, referencedEntityType]);
120
115
  var errorMessage = getErrorMessage(referencedEntityMissedError);
121
116
  return (React.createElement(ComplexAttribute, __assign({}, ownProps, { label: getLabel(label), attributeTypesList: editableAttrTypes, crosswalks: allCrosswalks, metadata: metadata }),
122
- React.createElement(ErrorWrapper, { errorMessage: errorMessage },
123
- React.createElement(EntitySelector, { className: classnames(styles.item, (_a = {},
124
- _a[styles.dense] = errorMessage || (selectedEntity && isTempUri(selectedEntity.entityUri)),
125
- _a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, max: 20, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, onChange: canChangeReferencedEntity ? onChangeEntity : undefined, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy }))));
117
+ React.createElement("div", { ref: ref, className: errorClassName },
118
+ React.createElement(ErrorWrapper, { errorMessage: errorMessage },
119
+ React.createElement(EntitySelector, { className: classnames(styles.item, (_a = {},
120
+ _a[styles.dense] = errorMessage || (selectedEntity && isTempUri(selectedEntity.entityUri)),
121
+ _a)), entity: selectedEntity || {}, entityTypesUris: entityTypesUris, max: 20, globalSearchRequestOptions: globalSearchRequestOptions, mode: mode, onChange: canChangeReferencedEntity ? onChangeEntity : undefined, onCreate: canCreateReferencedEntity ? onCreateEntity : undefined, metadata: metadata, attributeTypesSelectionStrategy: newEntityAttrTypesSelectionStrategy })))));
126
122
  };
127
- ReferenceAttribute.propTypes = __assign(__assign({}, ReferenceAttributeType), { modifiedEntity: EntityType, metadata: MetadataType, globalSearchRequestOptions: PropTypes.object, onDeleteModifiedEntity: PropTypes.func, onUpdateModifiedEntity: PropTypes.func, onDeactivateError: PropTypes.func });
128
- export default memo(ReferenceAttribute);
123
+ ReferenceAttribute.propTypes = __assign(__assign({}, ReferenceAttributeType), { modifiedEntity: EntityType, metadata: MetadataType, globalSearchRequestOptions: PropTypes.object, onDeleteModifiedEntity: PropTypes.func, onUpdateModifiedEntity: PropTypes.func, onDeactivateError: PropTypes.func, highlightedError: PropTypes.object });
124
+ export default withContext(ScrollToErrorContext, function (contextValue, _a) {
125
+ var attributeValue = _a.attributeValue, attributeType = _a.attributeType;
126
+ var error = (contextValue || {}).error;
127
+ var isHighlighted = allPass([
128
+ pipe(prop('uri'), isEmptyValue),
129
+ propEq('parentUri', attributeValue.uri),
130
+ propEq('attributeTypeUri', attributeType.uri)
131
+ ])(error);
132
+ return { highlightedError: isHighlighted ? contextValue : null };
133
+ }, ReferenceAttribute);
@@ -1,132 +1,4 @@
1
1
  export { ReferenceAttribute };
2
- declare const _default: import("react-redux").ConnectedComponent<import("react").MemoExoticComponent<{
3
- (props: any): JSX.Element;
4
- propTypes: {
5
- modifiedEntity: import("prop-types").Requireable<import("prop-types").InferProps<{
6
- uri: import("prop-types").Requireable<string>;
7
- type: import("prop-types").Requireable<string>;
8
- }>>;
9
- metadata: import("prop-types").Requireable<import("prop-types").InferProps<{
10
- uri: import("prop-types").Requireable<string>;
11
- description: import("prop-types").Requireable<string>;
12
- label: import("prop-types").Requireable<string>;
13
- schemaVersion: import("prop-types").Requireable<string>;
14
- entityTypes: import("prop-types").Requireable<import("prop-types").InferProps<{
15
- typeColor: import("prop-types").Requireable<string>;
16
- typeIcon: import("prop-types").Requireable<string>;
17
- typeImage: import("prop-types").Requireable<string>;
18
- label: import("prop-types").Requireable<string>;
19
- uri: import("prop-types").Requireable<string>;
20
- attributes: import("prop-types").Requireable<import("prop-types").InferProps<{
21
- label: import("prop-types").Requireable<string>;
22
- name: import("prop-types").Requireable<string>;
23
- description: import("prop-types").Requireable<string>;
24
- type: import("prop-types").Requireable<string>;
25
- hidden: import("prop-types").Requireable<boolean>;
26
- faceted: import("prop-types").Requireable<boolean>;
27
- searchable: import("prop-types").Requireable<boolean>;
28
- uri: import("prop-types").Requireable<string>;
29
- access: import("prop-types").Requireable<string[]>;
30
- cardinality: import("prop-types").Requireable<import("prop-types").InferProps<{
31
- minValue: import("prop-types").Requireable<number>;
32
- maxValue: import("prop-types").Requireable<number>;
33
- }>>;
34
- }>[]>;
35
- }>[]>;
36
- roles: import("prop-types").Requireable<object[]>;
37
- groupTypes: import("prop-types").Requireable<object[]>;
38
- relationTypes: import("prop-types").Requireable<import("prop-types").InferProps<{
39
- label: import("prop-types").Requireable<string>;
40
- uri: import("prop-types").Requireable<string>;
41
- typeColor: import("prop-types").Requireable<string>;
42
- direction: import("prop-types").Requireable<string>;
43
- startObject: import("prop-types").Requireable<object>;
44
- endObject: import("prop-types").Requireable<object>;
45
- }>[]>;
46
- graphTypes: import("prop-types").Requireable<import("prop-types").InferProps<{
47
- uri: import("prop-types").Requireable<string>;
48
- label: import("prop-types").Requireable<string>;
49
- extendsTypeUri: import("prop-types").Requireable<string>;
50
- relationshipTypeURIs: import("prop-types").Requireable<string[]>;
51
- }>[]>;
52
- interactionTypes: import("prop-types").Requireable<import("prop-types").InferProps<{
53
- uri: import("prop-types").Requireable<string>;
54
- label: import("prop-types").Requireable<string>;
55
- memberTypes: import("prop-types").Requireable<any[]>;
56
- extendsTypeUri: import("prop-types").Requireable<string>;
57
- attributes: import("prop-types").Requireable<import("prop-types").InferProps<{
58
- label: import("prop-types").Requireable<string>;
59
- name: import("prop-types").Requireable<string>;
60
- description: import("prop-types").Requireable<string>;
61
- type: import("prop-types").Requireable<string>;
62
- hidden: import("prop-types").Requireable<boolean>;
63
- faceted: import("prop-types").Requireable<boolean>;
64
- searchable: import("prop-types").Requireable<boolean>;
65
- uri: import("prop-types").Requireable<string>;
66
- access: import("prop-types").Requireable<string[]>;
67
- cardinality: import("prop-types").Requireable<import("prop-types").InferProps<{
68
- minValue: import("prop-types").Requireable<number>;
69
- maxValue: import("prop-types").Requireable<number>;
70
- }>>;
71
- }>[]>;
72
- }>[]>;
73
- sources: import("prop-types").Requireable<object[]>;
74
- }>>;
75
- globalSearchRequestOptions: import("prop-types").Requireable<object>;
76
- onDeleteModifiedEntity: import("prop-types").Requireable<(...args: any[]) => any>;
77
- onUpdateModifiedEntity: import("prop-types").Requireable<(...args: any[]) => any>;
78
- onDeactivateError: import("prop-types").Requireable<(...args: any[]) => any>;
79
- attributeType: import("prop-types").Requireable<import("prop-types").InferProps<{
80
- label: import("prop-types").Requireable<string>;
81
- name: import("prop-types").Requireable<string>;
82
- description: import("prop-types").Requireable<string>;
83
- type: import("prop-types").Requireable<string>;
84
- hidden: import("prop-types").Requireable<boolean>;
85
- faceted: import("prop-types").Requireable<boolean>;
86
- searchable: import("prop-types").Requireable<boolean>;
87
- uri: import("prop-types").Requireable<string>;
88
- access: import("prop-types").Requireable<string[]>;
89
- cardinality: import("prop-types").Requireable<import("prop-types").InferProps<{
90
- minValue: import("prop-types").Requireable<number>;
91
- maxValue: import("prop-types").Requireable<number>;
92
- }>>;
93
- }>>;
94
- showEmptyEditors: import("prop-types").Requireable<boolean>;
95
- lazy: import("prop-types").Requireable<boolean>;
96
- mode: import("prop-types").Requireable<any>;
97
- ownError: import("prop-types").Requireable<import("prop-types").InferProps<{
98
- type: import("prop-types").Validator<NonNullable<import("@reltio/mdm-sdk").ErrorType>>;
99
- attributeTypeUri: import("prop-types").Validator<string>;
100
- parentUri: import("prop-types").Validator<string>;
101
- uri: import("prop-types").Requireable<string>;
102
- message: import("prop-types").Requireable<string>;
103
- }>>;
104
- errors: import("prop-types").Requireable<import("prop-types").InferProps<{
105
- type: import("prop-types").Validator<NonNullable<import("@reltio/mdm-sdk").ErrorType>>;
106
- attributeTypeUri: import("prop-types").Validator<string>;
107
- parentUri: import("prop-types").Validator<string>;
108
- uri: import("prop-types").Requireable<string>;
109
- message: import("prop-types").Requireable<string>;
110
- }>[]>;
111
- crosswalks: import("prop-types").Requireable<any[]>;
112
- onAddAttributes: import("prop-types").Requireable<(...args: any[]) => any>;
113
- onAddOneMore: import("prop-types").Requireable<(...args: any[]) => any>;
114
- onDeleteAttribute: import("prop-types").Requireable<(...args: any[]) => any>;
115
- onChangeAttribute: import("prop-types").Requireable<(...args: any[]) => any>;
116
- additionalControlsRenderer: import("prop-types").Requireable<(...args: any[]) => any>;
117
- hideDeleteButton: import("prop-types").Requireable<boolean>;
118
- showNonOv: import("prop-types").Requireable<boolean>;
119
- state: import("prop-types").Requireable<string>;
120
- expanded: import("prop-types").Requireable<boolean>;
121
- attributeValue: import("prop-types").Requireable<import("prop-types").InferProps<{
122
- refEntity: import("prop-types").Requireable<object>;
123
- refRelation: import("prop-types").Requireable<object>;
124
- value: import("prop-types").Requireable<object>;
125
- ov: import("prop-types").Requireable<boolean>;
126
- type: import("prop-types").Requireable<string>;
127
- uri: import("prop-types").Requireable<string>;
128
- }>>;
129
- };
130
- }>, any>;
2
+ declare const _default: import("react-redux").ConnectedComponent<import("react").ComponentType<any> | ((props: any) => JSX.Element), any>;
131
3
  export default _default;
132
4
  import ReferenceAttribute from "./ReferenceAttribute";
@@ -1,3 +1,3 @@
1
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
1
+ declare const _default: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
2
  export default _default;
3
3
  import React from "react";