@reltio/components 1.4.1666 → 1.4.1668
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/components/ConnectionEditor/ConnectionEditor.js +2 -2
- package/cjs/components/EntityUriLink/EntityUriLink.d.ts +3 -5
- package/cjs/components/EntityUriLink/EntityUriLink.js +6 -8
- package/cjs/components/ValueChip/ValueChip.d.ts +7 -14
- package/cjs/components/ValueChip/ValueChip.js +1 -7
- package/cjs/components/ValueChip/styles.d.ts +2 -2
- package/cjs/components/attributes/editMode/AttributesPager/AttributesPager.js +1 -1
- package/cjs/components/attributes/editMode/AttributesPager/ImageLineRenderer.d.ts +5 -2
- package/cjs/components/attributes/editMode/AttributesPager/ImageLineRenderer.js +44 -9
- package/cjs/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
- package/cjs/components/attributes/editMode/AttributesPager/styles.js +7 -0
- package/cjs/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/cjs/components/attributes/editMode/ImageAttributesLine/styles.js +1 -2
- package/cjs/components/attributes/editMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/cjs/components/attributes/editMode/Tags/Tags.js +63 -19
- package/cjs/components/attributes/inline/ComplexAttribute/ComplexAttribute.js +2 -2
- package/cjs/components/attributes/inline/NestedAttributesBlock/NestedAttributesBlock.js +1 -1
- package/cjs/components/attributes/inline/SimpleAttribute/SimpleAttribute.js +2 -2
- package/cjs/components/attributes/inline/SimpleAttributesBlock/SimpleAttributesBlock.js +1 -1
- package/cjs/components/attributes/readMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/cjs/components/crosswalks/AttributesTable/AddAttributesButton/AddAttributesButton.js +1 -1
- package/cjs/components/editors/DataTypeValueEditor/useEditorContext.d.ts +1 -1
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +20 -24
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.js +155 -83
- package/cjs/components/editors/TypeaheadEditor/styles.d.ts +1 -1
- package/cjs/components/editors/TypeaheadEditor/styles.js +17 -17
- package/cjs/components/history/ContributorsPanel/styles.d.ts +1 -1
- package/cjs/hooks/useCommentsEntitiesMap.js +1 -1
- package/cjs/hooks/useMatchesLoader.js +2 -2
- package/esm/components/ConnectionEditor/ConnectionEditor.js +3 -3
- package/esm/components/EntityUriLink/EntityUriLink.d.ts +3 -5
- package/esm/components/EntityUriLink/EntityUriLink.js +6 -8
- package/esm/components/ValueChip/ValueChip.d.ts +7 -14
- package/esm/components/ValueChip/ValueChip.js +1 -7
- package/esm/components/ValueChip/styles.d.ts +2 -2
- package/esm/components/attributes/editMode/AttributesPager/AttributesPager.js +2 -2
- package/esm/components/attributes/editMode/AttributesPager/ImageLineRenderer.d.ts +5 -2
- package/esm/components/attributes/editMode/AttributesPager/ImageLineRenderer.js +21 -9
- package/esm/components/attributes/editMode/AttributesPager/styles.d.ts +1 -1
- package/esm/components/attributes/editMode/AttributesPager/styles.js +7 -0
- package/esm/components/attributes/editMode/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/esm/components/attributes/editMode/ImageAttributesLine/styles.js +1 -2
- package/esm/components/attributes/editMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/esm/components/attributes/editMode/Tags/Tags.js +65 -21
- package/esm/components/attributes/inline/ComplexAttribute/ComplexAttribute.js +3 -3
- package/esm/components/attributes/inline/NestedAttributesBlock/NestedAttributesBlock.js +2 -2
- package/esm/components/attributes/inline/SimpleAttribute/SimpleAttribute.js +3 -3
- package/esm/components/attributes/inline/SimpleAttributesBlock/SimpleAttributesBlock.js +2 -2
- package/esm/components/attributes/readMode/NestedAttribute/NestedAttribute.d.ts +1 -1
- package/esm/components/crosswalks/AttributesTable/AddAttributesButton/AddAttributesButton.js +2 -2
- package/esm/components/editors/DataTypeValueEditor/useEditorContext.d.ts +1 -1
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +20 -24
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +155 -83
- package/esm/components/editors/TypeaheadEditor/styles.d.ts +1 -1
- package/esm/components/editors/TypeaheadEditor/styles.js +17 -17
- package/esm/components/history/ContributorsPanel/styles.d.ts +1 -1
- package/esm/hooks/useCommentsEntitiesMap.js +2 -2
- package/esm/hooks/useMatchesLoader.js +3 -3
- package/package.json +2 -2
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
49
|
var t = {};
|
|
14
50
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -29,133 +65,169 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
29
65
|
}
|
|
30
66
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
67
|
};
|
|
68
|
+
import React, { useCallback, useRef, useMemo, useState, useEffect } from 'react';
|
|
69
|
+
import { identity, isEmpty, nthArg, path, pipe, prop, remove, T, uniq } from 'ramda';
|
|
70
|
+
import classnames from 'classnames';
|
|
71
|
+
import { debounce, isEmptyValue } from '@reltio/mdm-sdk';
|
|
32
72
|
import Autosuggest from 'react-autosuggest';
|
|
33
73
|
import AutosizeInput from 'react-input-autosize';
|
|
34
|
-
import classnames from 'classnames';
|
|
35
74
|
import TextField from '@mui/material/TextField';
|
|
36
75
|
import MenuItem from '@mui/material/MenuItem';
|
|
37
76
|
import Paper from '@mui/material/Paper';
|
|
77
|
+
import { useDidUpdateEffect } from '../../../hooks';
|
|
38
78
|
import Popper from '../../Popper/Popper';
|
|
39
|
-
import PropTypes from 'prop-types';
|
|
40
|
-
import React, { useCallback, useRef, useMemo, useState } from 'react';
|
|
41
79
|
import { NoResults } from '../../../components/EmptySearchResult';
|
|
42
|
-
import { always, andThen, both, concat, defaultTo, F, identity, ifElse, isEmpty, nthArg, path, pipe, prop, propEq, remove, T, tap, trim, uniq } from 'ramda';
|
|
43
|
-
import { debounce, isEmptyValue } from '@reltio/mdm-sdk';
|
|
44
|
-
import { getValue } from '../../../core/utils';
|
|
45
|
-
import { useStyles } from './styles';
|
|
46
80
|
import ExpandedValueTooltip from '../../ExpandedValueTooltip/ExpandedValueTooltip';
|
|
47
81
|
import ValueChip from '../../ValueChip/ValueChip';
|
|
48
82
|
import LoadMoreButton from '../../commonReactSelectComponents/LoadMoreButton';
|
|
49
|
-
import {
|
|
83
|
+
import { useStyles } from './styles';
|
|
50
84
|
var FETCH_DEBOUNCE_INTERVAL = 300;
|
|
51
85
|
var PAGE_SIZE = 50;
|
|
86
|
+
var ChangeMethod;
|
|
87
|
+
(function (ChangeMethod) {
|
|
88
|
+
ChangeMethod["Type"] = "type";
|
|
89
|
+
ChangeMethod["Escape"] = "escape";
|
|
90
|
+
ChangeMethod["Click"] = "click";
|
|
91
|
+
ChangeMethod["Enter"] = "enter";
|
|
92
|
+
})(ChangeMethod || (ChangeMethod = {}));
|
|
52
93
|
var TypeaheadEditor = function (_a) {
|
|
53
94
|
var value = _a.value, _b = _a.max, max = _b === void 0 ? PAGE_SIZE : _b, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth, _c = _a.InputProps, InputProps = _c === void 0 ? {} : _c, _d = _a.isCrossedOut, isCrossedOut = _d === void 0 ? false : _d, inputProps = __rest(_a, ["value", "max", "getSuggestions", "onChange", "multiple", "fullWidth", "InputProps", "isCrossedOut"]);
|
|
95
|
+
var styles = useStyles();
|
|
96
|
+
var inputRef = useRef(null);
|
|
54
97
|
var _e = useState([]), suggestions = _e[0], setSuggestions = _e[1];
|
|
55
98
|
var _f = useState(false), isPlaceholderVisible = _f[0], setPlaceholderVisibility = _f[1];
|
|
56
99
|
var _g = useState(1), pageNumber = _g[0], setPageNumber = _g[1];
|
|
57
100
|
var _h = useState(false), nextPageIsLoading = _h[0], setNextPageIsLoading = _h[1];
|
|
101
|
+
var _j = useState(''), inputValue = _j[0], setInputValue = _j[1];
|
|
102
|
+
var _k = useState(null), highlightedItem = _k[0], setHighlightedItem = _k[1];
|
|
58
103
|
var pageSizeForRequest = max + 1;
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
var inputValue = multiple ? currentValue : value;
|
|
62
|
-
useDidUpdateEffect(function () {
|
|
63
|
-
setPageNumber(1);
|
|
64
|
-
}, [inputValue]);
|
|
65
|
-
var inputRef = useRef();
|
|
66
|
-
var styles = useStyles();
|
|
104
|
+
var displayedSuggestions = useMemo(function () { return suggestions.slice(0, pageNumber * max); }, [suggestions, pageNumber, max]);
|
|
105
|
+
var showMoreButton = suggestions.length > displayedSuggestions.length;
|
|
67
106
|
var isFocused = function () { var _a; return ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === document.activeElement; };
|
|
68
|
-
var fetchSuggestions =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
107
|
+
var fetchSuggestions = useCallback(function (_a) {
|
|
108
|
+
var value = _a.value;
|
|
109
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
110
|
+
var response;
|
|
111
|
+
return __generator(this, function (_b) {
|
|
112
|
+
switch (_b.label) {
|
|
113
|
+
case 0: return [4 /*yield*/, getSuggestions(value.trim(), pageSizeForRequest)];
|
|
114
|
+
case 1:
|
|
115
|
+
response = _b.sent();
|
|
116
|
+
setSuggestions(response);
|
|
117
|
+
setPlaceholderVisibility(isEmpty(response) && isFocused());
|
|
118
|
+
return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
75
121
|
});
|
|
76
|
-
};
|
|
77
|
-
var onMouseDown = function (event) {
|
|
78
|
-
event.preventDefault();
|
|
79
|
-
};
|
|
122
|
+
}, [getSuggestions, pageSizeForRequest]);
|
|
80
123
|
var debouncedFetchSuggestions = useCallback(debounce(fetchSuggestions, FETCH_DEBOUNCE_INTERVAL), [
|
|
81
124
|
getSuggestions
|
|
82
125
|
]);
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
126
|
+
var handleLoadMoreSuggestions = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
127
|
+
var response_1;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0:
|
|
131
|
+
setNextPageIsLoading(true);
|
|
132
|
+
_a.label = 1;
|
|
133
|
+
case 1:
|
|
134
|
+
_a.trys.push([1, , 3, 4]);
|
|
135
|
+
return [4 /*yield*/, getSuggestions(inputValue, pageSizeForRequest, pageNumber + 1)];
|
|
136
|
+
case 2:
|
|
137
|
+
response_1 = _a.sent();
|
|
138
|
+
setSuggestions(function (prevSuggestions) { return __spreadArray(__spreadArray([], prevSuggestions, true), response_1, true); });
|
|
139
|
+
setPageNumber(function (prevPageNumber) { return prevPageNumber + 1; });
|
|
140
|
+
return [3 /*break*/, 4];
|
|
141
|
+
case 3:
|
|
142
|
+
setNextPageIsLoading(false);
|
|
143
|
+
return [7 /*endfinally*/];
|
|
144
|
+
case 4: return [2 /*return*/];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}); }, [getSuggestions, inputValue, pageNumber, pageSizeForRequest]);
|
|
148
|
+
var handleSuggestionsFetchRequested = useCallback(function (value) {
|
|
149
|
+
if (value.reason === 'input-changed') {
|
|
150
|
+
debouncedFetchSuggestions(value);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
fetchSuggestions(value);
|
|
154
|
+
}
|
|
155
|
+
}, [debouncedFetchSuggestions, fetchSuggestions]);
|
|
156
|
+
var handleSuggestionsClearRequested = useCallback(function () {
|
|
157
|
+
setSuggestions([]);
|
|
158
|
+
setPlaceholderVisibility(false);
|
|
159
|
+
setPageNumber(1);
|
|
160
|
+
}, []);
|
|
161
|
+
var handleSuggestionHighlighted = useCallback(function (_a) {
|
|
162
|
+
var suggestion = _a.suggestion;
|
|
163
|
+
setHighlightedItem(suggestion);
|
|
164
|
+
}, []);
|
|
165
|
+
var handleInputValueChange = useCallback(function (_a) {
|
|
87
166
|
var newValue = _a.newValue, method = _a.method;
|
|
88
167
|
switch (method) {
|
|
89
|
-
case
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
case 'escape': {
|
|
96
|
-
if (multiple) {
|
|
97
|
-
setCurrentValue(newValue);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
onChange(newValue);
|
|
101
|
-
}
|
|
168
|
+
case ChangeMethod.Type:
|
|
169
|
+
case ChangeMethod.Escape:
|
|
170
|
+
setInputValue(newValue);
|
|
102
171
|
break;
|
|
103
|
-
|
|
104
|
-
case
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
setCurrentValue('');
|
|
108
|
-
if (newValue) {
|
|
172
|
+
case ChangeMethod.Click:
|
|
173
|
+
case ChangeMethod.Enter: {
|
|
174
|
+
if (multiple === true) {
|
|
175
|
+
if (newValue)
|
|
109
176
|
onChange(uniq(__spreadArray(__spreadArray([], value, true), [newValue], false)));
|
|
110
|
-
|
|
177
|
+
setInputValue('');
|
|
111
178
|
}
|
|
112
179
|
else {
|
|
113
|
-
|
|
180
|
+
setInputValue(newValue);
|
|
114
181
|
}
|
|
115
|
-
break;
|
|
116
182
|
}
|
|
117
183
|
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
184
|
+
}, [multiple, onChange, value]);
|
|
185
|
+
var handleKeyDown = useCallback(function (event) {
|
|
186
|
+
if (event.code !== 'Enter' || highlightedItem)
|
|
187
|
+
return;
|
|
188
|
+
if (multiple === true) {
|
|
189
|
+
handleInputValueChange({ method: ChangeMethod.Enter, newValue: inputValue });
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
onChange(inputValue);
|
|
193
|
+
}
|
|
194
|
+
}, [handleInputValueChange, onChange, highlightedItem, inputValue, multiple]);
|
|
195
|
+
var handleBlur = useCallback(function () {
|
|
196
|
+
if (multiple !== true)
|
|
197
|
+
onChange(inputValue);
|
|
198
|
+
}, [inputValue, onChange, multiple]);
|
|
199
|
+
useEffect(function () {
|
|
200
|
+
if (multiple !== true)
|
|
201
|
+
setInputValue(value !== null && value !== void 0 ? value : '');
|
|
202
|
+
}, [value, multiple]);
|
|
203
|
+
useDidUpdateEffect(function () {
|
|
204
|
+
setPageNumber(1);
|
|
205
|
+
}, [inputValue]);
|
|
206
|
+
return (React.createElement(Autosuggest, { suggestions: displayedSuggestions, shouldRenderSuggestions: T, getSuggestionValue: identity, onSuggestionsFetchRequested: handleSuggestionsFetchRequested, onSuggestionsClearRequested: handleSuggestionsClearRequested, onSuggestionHighlighted: handleSuggestionHighlighted, theme: {
|
|
207
|
+
container: fullWidth ? styles.suggestionsContainer : '',
|
|
208
|
+
suggestionsList: styles.suggestionsList,
|
|
209
|
+
suggestionsContainerOpen: styles.suggestionsContainerOpen
|
|
210
|
+
}, inputProps: __assign({ value: inputValue, onChange: pipe(nthArg(1), handleInputValueChange), onKeyDown: handleKeyDown, onBlur: handleBlur, fullWidth: fullWidth, variant: 'standard', autoComplete: 'nope' }, inputProps), renderInputComponent: function (_a) {
|
|
124
211
|
var _b, _c;
|
|
125
|
-
var ref = _a.ref,
|
|
212
|
+
var ref = _a.ref, otherProps = __rest(_a, ["ref"]);
|
|
126
213
|
var commonClasses = {
|
|
127
|
-
underline: classnames((_b = {}, _b[styles
|
|
214
|
+
underline: classnames((_b = {}, _b[styles.underline] = isEmptyValue(value), _b)),
|
|
128
215
|
input: classnames(styles['rawInput'], path(['classes', 'input'], InputProps))
|
|
129
216
|
};
|
|
130
|
-
return multiple ? (React.createElement(TextField, __assign({
|
|
217
|
+
return multiple === true ? (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), inputComponent: AutosizeInput, classes: __assign(__assign({ root: classnames(styles.multipleTextFieldInput, path(['classes', 'root'], InputProps)) }, commonClasses), { input: classnames(styles.autosizeInput, commonClasses.input), adornedStart: styles.multipleTextFieldAdornedStart }) }), classes: { root: styles.multipleTextField } }))) : (React.createElement(TextField, __assign({}, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: classnames(styles.inputRoot, path(['classes', 'root'], InputProps), (_c = {},
|
|
131
218
|
_c[styles.isCrossedOut] = isCrossedOut,
|
|
132
219
|
_c)) }, commonClasses) }) })));
|
|
133
220
|
}, renderSuggestionsContainer: function (_a) {
|
|
134
221
|
var children = _a.children, _b = _a.containerProps, ref = _b.ref, restContainerProps = __rest(_b, ["ref"]);
|
|
135
222
|
return (React.createElement(Popper, { anchorEl: inputRef.current, open: Boolean(children) || isPlaceholderVisible },
|
|
136
|
-
React.createElement(Paper, __assign({ ref: ref, square: true
|
|
137
|
-
children || React.createElement(NoResults, { className: styles
|
|
138
|
-
showMoreButton && !isPlaceholderVisible && (React.createElement(LoadMoreButton, { onClick:
|
|
223
|
+
React.createElement(Paper, __assign({}, restContainerProps, { ref: ref, square: true, style: { width: prop('clientWidth', inputRef.current) } }),
|
|
224
|
+
children || React.createElement(NoResults, { className: styles.suggestionsPlaceholder }),
|
|
225
|
+
showMoreButton && !isPlaceholderVisible && (React.createElement(LoadMoreButton, { onClick: handleLoadMoreSuggestions, onMouseDown: function (event) { return event.preventDefault(); }, loading: nextPageIsLoading })))));
|
|
139
226
|
}, renderSuggestion: function (suggestion, _a) {
|
|
140
227
|
var isHighlighted = _a.isHighlighted;
|
|
141
|
-
return (React.createElement(MenuItem, { className: styles
|
|
228
|
+
return (React.createElement(MenuItem, { className: styles.suggestionsItem, selected: isHighlighted, component: "div" },
|
|
142
229
|
React.createElement(ExpandedValueTooltip, { value: suggestion },
|
|
143
|
-
React.createElement("div", { className: styles
|
|
144
|
-
}
|
|
145
|
-
container: fullWidth ? styles['typeahead__suggestions-container'] : '',
|
|
146
|
-
suggestionsList: styles['typeahead__suggestions-list'],
|
|
147
|
-
suggestionsContainerOpen: styles['typeahead__suggestions-container--open']
|
|
148
|
-
}, onSuggestionHighlighted: pipe(prop('suggestion'), Boolean, setHasHighlightedItem) }));
|
|
149
|
-
};
|
|
150
|
-
TypeaheadEditor.propTypes = {
|
|
151
|
-
multiple: PropTypes.bool,
|
|
152
|
-
fullWidth: PropTypes.bool,
|
|
153
|
-
placeholder: PropTypes.string,
|
|
154
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
155
|
-
onChange: PropTypes.func.isRequired,
|
|
156
|
-
getSuggestions: PropTypes.func.isRequired,
|
|
157
|
-
InputProps: PropTypes.object,
|
|
158
|
-
max: PropTypes.number,
|
|
159
|
-
isCrossedOut: PropTypes.bool
|
|
230
|
+
React.createElement("div", { className: styles.suggestionsItemText }, suggestion))));
|
|
231
|
+
} }));
|
|
160
232
|
};
|
|
161
233
|
export default TypeaheadEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"underline" | "inputRoot" | "isCrossedOut" | "autosizeInput" | "suggestionsPlaceholder" | "suggestionsContainer" | "suggestionsContainerOpen" | "suggestionsList" | "suggestionsItem" | "suggestionsItemText" | "rawInput" | "multipleTextField" | "multipleTextFieldInput" | "multipleTextFieldAdornedStart">;
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
2
|
export var useStyles = makeStyles({
|
|
3
|
-
|
|
3
|
+
suggestionsPlaceholder: {
|
|
4
4
|
padding: '8px 16px',
|
|
5
5
|
textAlign: 'center'
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
suggestionsContainer: {
|
|
8
|
+
width: '100%'
|
|
9
|
+
},
|
|
10
|
+
suggestionsContainerOpen: {
|
|
8
11
|
maxHeight: '230px',
|
|
9
12
|
overflowY: 'auto'
|
|
10
13
|
},
|
|
11
|
-
|
|
14
|
+
suggestionsList: {
|
|
12
15
|
margin: 0,
|
|
13
16
|
padding: 0,
|
|
14
17
|
listStyleType: 'none'
|
|
15
18
|
},
|
|
16
|
-
|
|
19
|
+
suggestionsItem: {
|
|
17
20
|
color: 'rgba(0,0,0,0.87)',
|
|
18
21
|
fontSize: '14px'
|
|
19
22
|
},
|
|
20
|
-
|
|
23
|
+
suggestionsItemText: {
|
|
24
|
+
overflow: 'hidden',
|
|
25
|
+
textOverflow: 'ellipsis',
|
|
26
|
+
display: 'block'
|
|
27
|
+
},
|
|
28
|
+
inputRoot: {
|
|
21
29
|
color: 'rgba(0,0,0,0.87)',
|
|
22
30
|
fontSize: '14px'
|
|
23
31
|
},
|
|
@@ -45,29 +53,21 @@ export var useStyles = makeStyles({
|
|
|
45
53
|
isCrossedOut: {
|
|
46
54
|
textDecoration: 'line-through'
|
|
47
55
|
},
|
|
48
|
-
|
|
56
|
+
multipleTextField: {
|
|
49
57
|
flexWrap: 'wrap',
|
|
50
58
|
color: 'rgba(0,0,0,0.87)',
|
|
51
59
|
fontSize: '14px'
|
|
52
60
|
},
|
|
53
|
-
|
|
61
|
+
multipleTextFieldInput: {
|
|
54
62
|
flex: '1 0 25px',
|
|
55
63
|
flexWrap: 'wrap'
|
|
56
64
|
},
|
|
57
|
-
|
|
65
|
+
multipleTextFieldAdornedStart: {
|
|
58
66
|
paddingLeft: '8px'
|
|
59
67
|
},
|
|
60
|
-
|
|
68
|
+
underline: {
|
|
61
69
|
'&:before': {
|
|
62
70
|
display: 'none'
|
|
63
71
|
}
|
|
64
|
-
},
|
|
65
|
-
'typeahead__suggestions-container': {
|
|
66
|
-
width: '100%'
|
|
67
|
-
},
|
|
68
|
-
'menuItem--item': {
|
|
69
|
-
overflow: 'hidden',
|
|
70
|
-
textOverflow: 'ellipsis',
|
|
71
|
-
display: 'block'
|
|
72
72
|
}
|
|
73
73
|
});
|
|
@@ -2,5 +2,5 @@ export declare const useStyles: (props?: any) => import("@mui/styles").ClassName
|
|
|
2
2
|
type StylesProps = {
|
|
3
3
|
color: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const useContributorStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"
|
|
5
|
+
export declare const useContributorStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"icon" | "active" | "inactive" | "clickable">;
|
|
6
6
|
export {};
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { useCallback, useEffect, useState } from 'react';
|
|
13
13
|
import { concat, difference, isEmpty, map, pipe, prop, reduce, reject, uniq } from 'ramda';
|
|
14
|
-
import {
|
|
14
|
+
import { FilterOptions, getFilteredEntities, isEntityUri, getEntity, ActivityFilter } from '@reltio/mdm-sdk';
|
|
15
15
|
import { useSafePromise } from './useSafePromise';
|
|
16
16
|
import { useMdmEntityUriWithDataTenant } from '../contexts';
|
|
17
17
|
var SELECT_OPTION = 'uri,label,type';
|
|
@@ -29,7 +29,7 @@ export var useCommentsEntitiesMap = function (comments) {
|
|
|
29
29
|
];
|
|
30
30
|
var requestOptions = {
|
|
31
31
|
max: entitiesUris.length,
|
|
32
|
-
activeness:
|
|
32
|
+
activeness: ActivityFilter.ALL,
|
|
33
33
|
select: 'uri,label,type'
|
|
34
34
|
};
|
|
35
35
|
return safePromise(getFilteredEntities(requestFilters, requestOptions));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ActivityFilter, collectAllTransitiveEntitiesUris, getEntitiesMapForTransitiveMatches, getMatchesForDataTenantEntity, getMatchesFromDataTenants, getTransitiveMatches, isDataTenantEntity, isTempUri, withDtssPotentialItems, addGlobalFilterToQuery } from '@reltio/mdm-sdk';
|
|
3
3
|
import { usePagingSimulator } from './usePagingSimulator';
|
|
4
4
|
import { useSafePromise } from './useSafePromise';
|
|
5
5
|
import { useMdmDataTenants, useMdmDtssPath, useMdmGlobalSearchRequestOptions, useMdmTenant } from '../contexts';
|
|
@@ -15,8 +15,8 @@ export var useMatchesLoader = function (_a) {
|
|
|
15
15
|
var _f = useMdmGlobalSearchRequestOptions() || {}, activityFilter = _f.activityFilter, globalFilter = _f.globalFilter;
|
|
16
16
|
var activeness = typeof options.showInactiveEntities === 'boolean'
|
|
17
17
|
? options.showInactiveEntities
|
|
18
|
-
?
|
|
19
|
-
:
|
|
18
|
+
? ActivityFilter.ALL
|
|
19
|
+
: ActivityFilter.ACTIVE_ONLY
|
|
20
20
|
: activityFilter;
|
|
21
21
|
var entityUri = entity === null || entity === void 0 ? void 0 : entity.uri;
|
|
22
22
|
var dtssParams = useMemo(function () { return ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1668",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
10
10
|
"@react-google-maps/api": "2.7.0",
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1668",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|