@reltio/components 1.4.1617 → 1.4.1618
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/BasicViewHeader/styles.js +1 -0
- package/cjs/components/ExpandableSearchInput/ExpandableSearchInput.js +2 -2
- package/cjs/components/ExpandableSearchInput/styles.js +2 -1
- package/cjs/components/editors/LookupEditor/LookupEditor.js +2 -1
- package/cjs/hooks/useMatchesLoader.js +5 -0
- package/esm/components/BasicViewHeader/styles.js +1 -0
- package/esm/components/ExpandableSearchInput/ExpandableSearchInput.js +2 -2
- package/esm/components/ExpandableSearchInput/styles.js +2 -1
- package/esm/components/editors/LookupEditor/LookupEditor.js +2 -1
- package/esm/hooks/useMatchesLoader.js +5 -0
- package/package.json +3 -3
|
@@ -46,9 +46,9 @@ var ExpandableSearchInput = function (_a) {
|
|
|
46
46
|
setValue(query);
|
|
47
47
|
}, [query]);
|
|
48
48
|
var styles = (0, styles_1.useStyles)();
|
|
49
|
-
var hasValue = value && value.length;
|
|
50
49
|
return isOpen ? (react_1.default.createElement(Input_1.default, { className: styles.input, value: value, autoFocus: true, placeholder: ui_i18n_1.default.text('Search'), disableUnderline: true, onChange: (0, ramda_1.pipe)(core_1.getValue, setValue), startAdornment: react_1.default.createElement(InputAdornment_1.default, { position: "start" },
|
|
51
|
-
react_1.default.createElement(Search_1.default, { className: styles.startAdornment })), endAdornment: react_1.default.createElement(InputAdornment_1.default, { position: "end" },
|
|
50
|
+
react_1.default.createElement(Search_1.default, { className: styles.startAdornment })), endAdornment: react_1.default.createElement(InputAdornment_1.default, { position: "end" },
|
|
51
|
+
react_1.default.createElement(SmallIconButton_1.SmallIconButton, { size: "S", icon: Close_1.default, onClick: (0, ramda_1.pipe)(ramda_1.F, setIsOpen, (0, ramda_1.always)(''), (0, ramda_1.tap)(onChange), setValue) })), onKeyPress: (0, ramda_1.when)((0, ramda_1.propEq)('key', 'Enter'), (0, ramda_1.pipe)((0, ramda_1.always)(value), ramda_1.trim, onChange)) })) : (react_1.default.createElement(IconButton_1.default, { className: styles.searchButton, onClick: (0, ramda_1.pipe)(ramda_1.T, setIsOpen), size: "large" },
|
|
52
52
|
react_1.default.createElement(Search_1.default, null)));
|
|
53
53
|
};
|
|
54
54
|
exports.ExpandableSearchInput = ExpandableSearchInput;
|
|
@@ -61,8 +61,9 @@ var LookupEditor = function (_a) {
|
|
|
61
61
|
value: (0, ramda_1.path)([lookupTypeCode, lookupCode, 'displayName'], lookups)
|
|
62
62
|
}); };
|
|
63
63
|
(0, react_1.useEffect)(function () {
|
|
64
|
+
var _a;
|
|
64
65
|
if ((0, ramda_1.isEmpty)(lookups) && getLookups) {
|
|
65
|
-
getLookups();
|
|
66
|
+
(_a = getLookups()) === null || _a === void 0 ? void 0 : _a.catch(function () { });
|
|
66
67
|
}
|
|
67
68
|
}, [lookups, getLookups]);
|
|
68
69
|
var entries = (0, entriesHelpers_1.buildLookupEntries)(lookupTypeCode, lookups); // TODO: this code could be not valid if lookups are not loaded
|
|
@@ -81,6 +81,11 @@ var useMatchesLoader = function (_a) {
|
|
|
81
81
|
setEntitiesMap((0, mdm_sdk_1.getEntitiesMapForTransitiveMatches)(originalResponse));
|
|
82
82
|
}
|
|
83
83
|
setMatches(response);
|
|
84
|
+
})
|
|
85
|
+
.catch(function (error) {
|
|
86
|
+
console.warn("Can't load matches:", error);
|
|
87
|
+
setMatches([]);
|
|
88
|
+
setTotal(0);
|
|
84
89
|
})
|
|
85
90
|
.finally(function () {
|
|
86
91
|
onFinishLoading === null || onFinishLoading === void 0 ? void 0 : onFinishLoading();
|
|
@@ -17,8 +17,8 @@ export var ExpandableSearchInput = function (_a) {
|
|
|
17
17
|
setValue(query);
|
|
18
18
|
}, [query]);
|
|
19
19
|
var styles = useStyles();
|
|
20
|
-
var hasValue = value && value.length;
|
|
21
20
|
return isOpen ? (React.createElement(Input, { className: styles.input, value: value, autoFocus: true, placeholder: i18n.text('Search'), disableUnderline: true, onChange: pipe(getValue, setValue), startAdornment: React.createElement(InputAdornment, { position: "start" },
|
|
22
|
-
React.createElement(SearchIcon, { className: styles.startAdornment })), endAdornment: React.createElement(InputAdornment, { position: "end" },
|
|
21
|
+
React.createElement(SearchIcon, { className: styles.startAdornment })), endAdornment: React.createElement(InputAdornment, { position: "end" },
|
|
22
|
+
React.createElement(SmallIconButton, { size: "S", icon: CloseIcon, onClick: pipe(F, setIsOpen, always(''), tap(onChange), setValue) })), onKeyPress: when(propEq('key', 'Enter'), pipe(always(value), trim, onChange)) })) : (React.createElement(IconButton, { className: styles.searchButton, onClick: pipe(T, setIsOpen), size: "large" },
|
|
23
23
|
React.createElement(SearchIcon, null)));
|
|
24
24
|
};
|
|
@@ -33,8 +33,9 @@ var LookupEditor = function (_a) {
|
|
|
33
33
|
value: path([lookupTypeCode, lookupCode, 'displayName'], lookups)
|
|
34
34
|
}); };
|
|
35
35
|
useEffect(function () {
|
|
36
|
+
var _a;
|
|
36
37
|
if (isEmpty(lookups) && getLookups) {
|
|
37
|
-
getLookups();
|
|
38
|
+
(_a = getLookups()) === null || _a === void 0 ? void 0 : _a.catch(function () { });
|
|
38
39
|
}
|
|
39
40
|
}, [lookups, getLookups]);
|
|
40
41
|
var entries = buildLookupEntries(lookupTypeCode, lookups); // TODO: this code could be not valid if lookups are not loaded
|
|
@@ -75,6 +75,11 @@ export var useMatchesLoader = function (_a) {
|
|
|
75
75
|
setEntitiesMap(getEntitiesMapForTransitiveMatches(originalResponse));
|
|
76
76
|
}
|
|
77
77
|
setMatches(response);
|
|
78
|
+
})
|
|
79
|
+
.catch(function (error) {
|
|
80
|
+
console.warn("Can't load matches:", error);
|
|
81
|
+
setMatches([]);
|
|
82
|
+
setTotal(0);
|
|
78
83
|
})
|
|
79
84
|
.finally(function () {
|
|
80
85
|
onFinishLoading === null || onFinishLoading === void 0 ? void 0 : onFinishLoading();
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1618",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1618",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1618",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|