@reltio/components 1.4.1616 → 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.
@@ -10,6 +10,7 @@ exports.useStyles = (0, styles_1.makeStyles)({
10
10
  },
11
11
  title: {
12
12
  fontSize: '18px',
13
+ minWidth: '50px',
13
14
  fontWeight: 'normal',
14
15
  lineHeight: 'inherit',
15
16
  whiteSpace: 'nowrap',
@@ -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" }, hasValue && (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" },
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;
@@ -9,8 +9,9 @@ exports.useStyles = (0, styles_1.makeStyles)({
9
9
  padding: '8px'
10
10
  },
11
11
  input: {
12
+ maxWidth: '350px',
12
13
  flex: '1 0 200px',
13
- marginLeft: '70px',
14
+ marginLeft: '20px',
14
15
  fontSize: '14px',
15
16
  background: 'rgba(0,0,0,0.03) 2px',
16
17
  padding: '4px 0',
@@ -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();
@@ -7,6 +7,7 @@ export var useStyles = makeStyles({
7
7
  },
8
8
  title: {
9
9
  fontSize: '18px',
10
+ minWidth: '50px',
10
11
  fontWeight: 'normal',
11
12
  lineHeight: 'inherit',
12
13
  whiteSpace: 'nowrap',
@@ -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" }, hasValue && (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" },
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
  };
@@ -6,8 +6,9 @@ export var useStyles = makeStyles({
6
6
  padding: '8px'
7
7
  },
8
8
  input: {
9
+ maxWidth: '350px',
9
10
  flex: '1 0 200px',
10
- marginLeft: '70px',
11
+ marginLeft: '20px',
11
12
  fontSize: '14px',
12
13
  background: 'rgba(0,0,0,0.03) 2px',
13
14
  padding: '4px 0',
@@ -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.1616",
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.1616",
11
- "@reltio/mdm-sdk": "^1.4.1616",
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",