@reltio/components 1.4.1853 → 1.4.1854

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 (163) hide show
  1. package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
  2. package/cjs/ConnectionEditor/ConnectionEditor.d.ts +3 -3
  3. package/cjs/ConnectionEditor/ConnectionEditor.test.js +2 -2
  4. package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
  5. package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -20
  6. package/cjs/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
  7. package/cjs/DependentLookupEditor/DependentLookupEditor.js +3 -21
  8. package/cjs/DropDownEditor/DropDownEditor.d.ts +14 -15
  9. package/cjs/DropDownEditor/DropDownEditor.js +0 -6
  10. package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
  11. package/cjs/EditModeAttributesList/EditModeAttributesList.js +0 -20
  12. package/cjs/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
  13. package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
  14. package/cjs/EditModeAttributesPager/types.d.ts +7 -6
  15. package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
  16. package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.js +6 -17
  17. package/cjs/EditModeComplexAttribute/index.d.ts +1 -0
  18. package/cjs/EntitySelector/EntitySelector.d.ts +19 -31
  19. package/cjs/EntitySelector/EntitySelector.js +0 -14
  20. package/cjs/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
  21. package/cjs/EntitySelector/components/EntityOption/EntityOption.js +0 -18
  22. package/cjs/ErrorWrapper/ErrorWrapper.d.ts +2 -2
  23. package/cjs/FilterEditor/FilterEditor.d.ts +16 -23
  24. package/cjs/FilterEditor/FilterEditor.js +2 -14
  25. package/cjs/FilterValueEditor/FilterValueEditor.d.ts +14 -24
  26. package/cjs/FilterValueEditor/FilterValueEditor.js +0 -9
  27. package/cjs/HOCs/withFilter/ColumnFilter.js +1 -1
  28. package/cjs/LookupEditor/LookupEditor.d.ts +11 -33
  29. package/cjs/LookupEditor/LookupEditor.js +1 -14
  30. package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
  31. package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
  32. package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
  33. package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
  34. package/cjs/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
  35. package/cjs/NestedAttribute/NestedAttribute.d.ts +4 -124
  36. package/cjs/NestedAttribute/NestedAttribute.js +0 -1
  37. package/cjs/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
  38. package/cjs/NestedAttributeEditor/NestedAttributeEditor.js +0 -1
  39. package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
  40. package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +0 -12
  41. package/cjs/ReadOnlyComplexAttribute/index.d.ts +1 -0
  42. package/cjs/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
  43. package/cjs/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
  44. package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
  45. package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.js +2 -3
  46. package/cjs/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
  47. package/cjs/RelationTypeSelector/RelationTypeSelector.js +2 -14
  48. package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
  49. package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.js +0 -17
  50. package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
  51. package/cjs/components/ImageDetailsView/helpers/index.d.ts +5 -2
  52. package/cjs/components/ImportButton/ImportButton.d.ts +2 -1
  53. package/cjs/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
  54. package/cjs/components/MultipliableSelect/MultipliableSelect.js +0 -15
  55. package/cjs/components/ProfileBand/styles.d.ts +1 -1
  56. package/cjs/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
  57. package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
  58. package/cjs/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
  59. package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
  60. package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
  61. package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
  62. package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -51
  63. package/cjs/components/ReactSelect/AsyncSelect.d.ts +0 -45
  64. package/cjs/components/ReactSelect/CreatableSelect.d.ts +0 -45
  65. package/cjs/components/ReactSelect/Select.d.ts +0 -45
  66. package/cjs/components/ReactSelect/withMuiSkin.d.ts +3 -48
  67. package/cjs/components/ReactSelect/withMuiSkin.js +0 -50
  68. package/cjs/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
  69. package/cjs/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
  70. package/cjs/components/SearchInput/SearchInput.d.ts +1 -1
  71. package/cjs/components/SelectionPopup/SelectionPopup.d.ts +1 -1
  72. package/cjs/constants/index.d.ts +1 -1
  73. package/cjs/constants/index.js +1 -4
  74. package/cjs/constants/prop-types.d.ts +0 -81
  75. package/cjs/constants/prop-types.js +17 -46
  76. package/cjs/constants/textField.d.ts +2 -2
  77. package/cjs/contexts/ScrollToElementContext/index.d.ts +1 -1
  78. package/cjs/helpers/basicTable.d.ts +2 -7
  79. package/cjs/hooks/useRelationTypeSelector.d.ts +12 -8
  80. package/cjs/hooks/useRelationTypeSelector.js +3 -1
  81. package/cjs/types/index.d.ts +19 -2
  82. package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
  83. package/esm/ConnectionEditor/ConnectionEditor.d.ts +3 -3
  84. package/esm/ConnectionEditor/ConnectionEditor.test.js +2 -2
  85. package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
  86. package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -17
  87. package/esm/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
  88. package/esm/DependentLookupEditor/DependentLookupEditor.js +4 -22
  89. package/esm/DropDownEditor/DropDownEditor.d.ts +14 -15
  90. package/esm/DropDownEditor/DropDownEditor.js +0 -6
  91. package/esm/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
  92. package/esm/EditModeAttributesList/EditModeAttributesList.js +1 -21
  93. package/esm/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
  94. package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
  95. package/esm/EditModeAttributesPager/types.d.ts +7 -6
  96. package/esm/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
  97. package/esm/EditModeComplexAttribute/EditModeComplexAttribute.js +7 -18
  98. package/esm/EditModeComplexAttribute/index.d.ts +1 -0
  99. package/esm/EntitySelector/EntitySelector.d.ts +19 -31
  100. package/esm/EntitySelector/EntitySelector.js +1 -15
  101. package/esm/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
  102. package/esm/EntitySelector/components/EntityOption/EntityOption.js +0 -18
  103. package/esm/ErrorWrapper/ErrorWrapper.d.ts +2 -2
  104. package/esm/FilterEditor/FilterEditor.d.ts +16 -23
  105. package/esm/FilterEditor/FilterEditor.js +3 -15
  106. package/esm/FilterValueEditor/FilterValueEditor.d.ts +14 -24
  107. package/esm/FilterValueEditor/FilterValueEditor.js +1 -10
  108. package/esm/HOCs/withFilter/ColumnFilter.js +1 -1
  109. package/esm/LookupEditor/LookupEditor.d.ts +11 -33
  110. package/esm/LookupEditor/LookupEditor.js +1 -11
  111. package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
  112. package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
  113. package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
  114. package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
  115. package/esm/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
  116. package/esm/NestedAttribute/NestedAttribute.d.ts +4 -124
  117. package/esm/NestedAttribute/NestedAttribute.js +1 -2
  118. package/esm/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
  119. package/esm/NestedAttributeEditor/NestedAttributeEditor.js +1 -2
  120. package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
  121. package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +1 -13
  122. package/esm/ReadOnlyComplexAttribute/index.d.ts +1 -0
  123. package/esm/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
  124. package/esm/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
  125. package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
  126. package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.js +3 -4
  127. package/esm/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
  128. package/esm/RelationTypeSelector/RelationTypeSelector.js +2 -14
  129. package/esm/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
  130. package/esm/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -18
  131. package/esm/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
  132. package/esm/components/ImageDetailsView/helpers/index.d.ts +5 -2
  133. package/esm/components/ImportButton/ImportButton.d.ts +2 -1
  134. package/esm/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
  135. package/esm/components/MultipliableSelect/MultipliableSelect.js +0 -15
  136. package/esm/components/ProfileBand/styles.d.ts +1 -1
  137. package/esm/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
  138. package/esm/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
  139. package/esm/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
  140. package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
  141. package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
  142. package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
  143. package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -28
  144. package/esm/components/ReactSelect/AsyncSelect.d.ts +0 -45
  145. package/esm/components/ReactSelect/CreatableSelect.d.ts +0 -45
  146. package/esm/components/ReactSelect/Select.d.ts +0 -45
  147. package/esm/components/ReactSelect/withMuiSkin.d.ts +3 -48
  148. package/esm/components/ReactSelect/withMuiSkin.js +0 -50
  149. package/esm/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
  150. package/esm/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
  151. package/esm/components/SearchInput/SearchInput.d.ts +1 -1
  152. package/esm/components/SelectionPopup/SelectionPopup.d.ts +1 -1
  153. package/esm/constants/index.d.ts +1 -1
  154. package/esm/constants/index.js +1 -1
  155. package/esm/constants/prop-types.d.ts +0 -81
  156. package/esm/constants/prop-types.js +17 -38
  157. package/esm/constants/textField.d.ts +2 -2
  158. package/esm/contexts/ScrollToElementContext/index.d.ts +1 -1
  159. package/esm/helpers/basicTable.d.ts +2 -7
  160. package/esm/hooks/useRelationTypeSelector.d.ts +12 -8
  161. package/esm/hooks/useRelationTypeSelector.js +3 -1
  162. package/esm/types/index.d.ts +19 -2
  163. package/package.json +2 -2
@@ -1,5 +1,42 @@
1
- declare const _default: React.ComponentType<{
2
- [x: string]: unknown;
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, ComplexAttributeType, ReferenceAttributeValueType, NestedAttributeValueType, AttributeTypeType, getErrorMessage, hasAttributeDescendantsWithErrors, isAnalyticAttribute } from '@reltio/mdm-sdk';
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 () { return ({
75
- attributes: hasAnalyticValue ? null : attributeValue.value,
76
- analyticsAttributes: hasAnalyticValue ? attributeValue.value : null
77
- }); }, [attributeValue, hasAnalyticValue]);
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 +1,2 @@
1
1
  export { default as EditModeComplexAttribute } from './EditModeComplexAttribute';
2
+ export type { EditModeComplexAttributeProps } from './EditModeComplexAttribute';
@@ -1,32 +1,20 @@
1
- export function EntitySelector({ entity, entityTypesUris, mode, max, onChange, onCreate, metadata, globalSearchRequestOptions, attributeTypesSelectionStrategy, disableLinkClick, ...otherProps }: {
2
- [x: string]: any;
3
- entity?: {};
4
- entityTypesUris?: any[];
5
- mode: any;
6
- max: any;
7
- onChange: any;
8
- onCreate: any;
9
- metadata: any;
10
- globalSearchRequestOptions: any;
11
- attributeTypesSelectionStrategy: any;
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
- }): JSX.Element;
14
- export namespace EntitySelector {
15
- namespace propTypes {
16
- export { ConnectionEntityType as entity };
17
- export let entityTypesUris: PropTypes.Requireable<string[]>;
18
- export let max: PropTypes.Requireable<number>;
19
- export { ModeType as mode };
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, MetadataType, ConnectionEntityType, ModeType, isTempUri, isAvailableEntityType } from '@reltio/mdm-sdk';
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
- export function EntityOption({ innerRef, innerProps, selectOption, data }: {
2
- innerRef: any;
3
- innerProps: any;
4
- selectOption: any;
5
- data: any;
6
- }): JSX.Element;
7
- export namespace EntityOption {
8
- namespace propTypes {
9
- let innerRef: PropTypes.Requireable<any>;
10
- let innerProps: PropTypes.Validator<object>;
11
- let selectOption: PropTypes.Validator<(...args: any[]) => any>;
12
- let data: PropTypes.Requireable<PropTypes.InferProps<{
13
- uri: PropTypes.Validator<string>;
14
- label: PropTypes.Validator<string>;
15
- entityType: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
16
- uri: PropTypes.Requireable<string>;
17
- type: PropTypes.Requireable<string>;
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: string;
7
- helperText: string;
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
- export function FilterEditor({ value, onChange, filterOptions, dataTypeDefinition, classes, valueEditorProps }: {
2
- value: any;
3
- onChange: any;
4
- filterOptions: any;
5
- dataTypeDefinition: any;
6
- classes: any;
7
- valueEditorProps: any;
8
- }): JSX.Element;
9
- export namespace FilterEditor {
10
- namespace propTypes {
11
- export { FilterType as value };
12
- export let onChange: PropTypes.Requireable<(...args: any[]) => any>;
13
- export let filterOptions: PropTypes.Requireable<PropTypes.InferProps<{
14
- value: PropTypes.Requireable<string>;
15
- label: PropTypes.Requireable<string>;
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, FilterType } from '@reltio/mdm-sdk';
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, valueEditorProps = _a.valueEditorProps;
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 }, valueEditorProps)))));
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
- export function FilterValueEditor({ filter: { values, fieldName, filter }, onChange, dataTypeDefinition, orientation, TextFieldProps, ...otherProps }: {
2
- [x: string]: any;
3
- filter: {
4
- values?: any[];
5
- fieldName: any;
6
- filter: any;
7
- };
8
- onChange: any;
9
- dataTypeDefinition: any;
10
- orientation: any;
11
- TextFieldProps: any;
12
- }): JSX.Element;
13
- export namespace FilterValueEditor {
14
- namespace propTypes {
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 { FilterType, isDateRangeFilterOption, isMultiValueOption, isRangeFilterOption, mapFilterValue, wrapInArray } from '@reltio/mdm-sdk';
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), valueEditorProps: {
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
- export function LookupEditor({ multiple, value, lookupCode: lookupTypeCode, lookups, onChange, getLookups, ...otherProps }: {
2
- [x: string]: any;
3
- multiple: any;
4
- value: any;
5
- lookupCode: any;
6
- lookups: any;
7
- onChange: any;
8
- getLookups: any;
9
- }): JSX.Element;
10
- export namespace LookupEditor {
11
- namespace propTypes {
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
- export const MENU_ITEM_OFFSET: 25;
2
- export function GroupedDropDownEditor({ value, entries, classes, ...otherProps }: {
3
- [x: string]: any;
4
- value: any;
5
- entries: any;
6
- classes: any;
7
- }): JSX.Element;
8
- export namespace GroupedDropDownEditor {
9
- namespace propTypes {
10
- let value: PropTypes.Requireable<NonNullable<NonNullable<string | number | object>>>;
11
- let entries: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
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 {};
@@ -21,14 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import React from 'react';
24
- import PropTypes from 'prop-types';
25
24
  import classnames from 'classnames';
26
25
  import i18n from 'ui-i18n';
27
26
  import { isNil, pipe, prop } from 'ramda';
28
27
  import { wrapInArrayIfNeeded } from '@reltio/mdm-sdk';
29
28
  import CheckIcon from '@mui/icons-material/Check';
30
29
  import MenuItem from '@mui/material/MenuItem';
31
- import { DropDownEntryType, DropDownGroupEntryType, SelectValueType } from '../../../constants/prop-types';
32
30
  import MultipliableSelect from '../../../components/MultipliableSelect/MultipliableSelect';
33
31
  import { findEntryByValue, flattenGroupedEntries } from './helpers';
34
32
  import { useStyles } from './styles';
@@ -47,8 +45,3 @@ export var GroupedDropDownEditor = function (_a) {
47
45
  label || value.toString()));
48
46
  })) : (React.createElement(MenuItem, { className: styles.emptyLabel, disabled: true }, i18n.text('No results found')))));
49
47
  };
50
- GroupedDropDownEditor.propTypes = {
51
- value: PropTypes.oneOfType([SelectValueType, PropTypes.arrayOf(SelectValueType)]),
52
- entries: PropTypes.arrayOf(PropTypes.oneOfType([DropDownEntryType, DropDownGroupEntryType])).isRequired,
53
- classes: PropTypes.object
54
- };
@@ -1,2 +1,9 @@
1
- export const flattenGroupedEntries: any;
2
- export const findEntryByValue: any;
1
+ import { CurriedFunction2, PrimitiveValue } from '@reltio/mdm-sdk';
2
+ import { DropDownGroupEntryType, DropDownEntryType } from '../../../types';
3
+ type FlattenEntry = DropDownEntryType & {
4
+ depth: number;
5
+ isGroup?: boolean;
6
+ };
7
+ export declare const flattenGroupedEntries: (entries: DropDownEntryType[] | DropDownGroupEntryType[]) => FlattenEntry[];
8
+ export declare const findEntryByValue: CurriedFunction2<Array<FlattenEntry>, PrimitiveValue, FlattenEntry>;
9
+ export {};
@@ -22,12 +22,12 @@ import { chain, curry, has } from 'ramda';
22
22
  var isGroupEntry = has('values');
23
23
  var flattenEntry = curry(function (depth, entry) {
24
24
  return isGroupEntry(entry)
25
- ? __spreadArray([{ label: entry.label, depth: depth, isGroup: true }], chain(flattenEntry(depth + 1), entry.values), true) : __assign(__assign({}, entry), { depth: depth });
25
+ ? __spreadArray([
26
+ { label: entry.label, depth: depth, isGroup: true }
27
+ ], chain(flattenEntry(depth + 1), entry.values), true) : __assign(__assign({}, entry), { depth: depth });
26
28
  });
27
29
  export var flattenGroupedEntries = chain(flattenEntry(0));
28
- export var findEntryByValue = curry(function (entries, _value) {
29
- return entries.find(function (_a) {
30
- var isGroup = _a.isGroup, value = _a.value;
31
- return !isGroup && value === _value;
32
- });
33
- });
30
+ export var findEntryByValue = curry(function (entries, _value) { return entries.find(function (_a) {
31
+ var isGroup = _a.isGroup, value = _a.value;
32
+ return !isGroup && value === _value;
33
+ }); });
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon" | "root" | "checkIcon" | "emptyLabel">;
1
+ export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"icon" | "root" | "checkIcon" | "emptyLabel">;