@reltio/components 1.4.1251 → 1.4.1252
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/attributes/editMode/SimpleAttributeEditor/selectors/getDependentLookupEditorContext.js +5 -3
- package/cjs/components/editors/DependentLookupEditor/DependentLookupEditor.js +9 -7
- package/esm/components/attributes/editMode/SimpleAttributeEditor/selectors/getDependentLookupEditorContext.js +5 -3
- package/esm/components/editors/DependentLookupEditor/DependentLookupEditor.js +9 -7
- package/package.json +3 -3
|
@@ -20,10 +20,12 @@ var getDependentLookupEditorContext = function (state, attributeValue, attribute
|
|
|
20
20
|
var autocompleteConfig = mdm_module_1.default.selectors.getLookupAutocomplete(state);
|
|
21
21
|
var autopopulationEnabled = mdm_sdk_1.isAutopopulationEnabled(autocompleteConfig, attributeTypeUri);
|
|
22
22
|
var isEmptyValue = !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.lookupCode) && !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value);
|
|
23
|
-
var placeholder = (isEmptyValue && isBlocked && ui_i18n_1.default.text('Populating values...')) ||
|
|
23
|
+
var placeholder = (isEmptyValue && isBlocked && ui_i18n_1.default.text('Populating values...')) ||
|
|
24
|
+
(isEmptyValue && missedParentsMessage) ||
|
|
25
|
+
'';
|
|
24
26
|
var context = {
|
|
25
|
-
parents: parents,
|
|
26
|
-
disabled: !!missedParentsMessage || isBlocked,
|
|
27
|
+
parents: missedParentsMessage ? null : parents,
|
|
28
|
+
disabled: (!!missedParentsMessage && isEmptyValue) || isBlocked,
|
|
27
29
|
placeholder: placeholder,
|
|
28
30
|
autopopulationId: autopopulationEnabled ? valueUri : null
|
|
29
31
|
};
|
|
@@ -102,13 +102,15 @@ var DependentLookupEditor = function (_a) {
|
|
|
102
102
|
var loadOptions = react_1.useCallback(function (value, pageNumber) {
|
|
103
103
|
if (pageNumber === void 0) { pageNumber = 1; }
|
|
104
104
|
setOptionsAreLoading(true);
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
return (parents === null
|
|
106
|
+
? Promise.resolve([])
|
|
107
|
+
: getLookups({
|
|
108
|
+
type: lookupTypeCode,
|
|
109
|
+
parents: parents,
|
|
110
|
+
displayNamePrefix: value,
|
|
111
|
+
max: max + 1,
|
|
112
|
+
offset: (pageNumber - 1) * max
|
|
113
|
+
}))
|
|
112
114
|
.then(function (buildOptions) { return helpers_1.buildLookupOptions(buildOptions); })
|
|
113
115
|
.catch(function () { return []; })
|
|
114
116
|
.finally(function () { return setOptionsAreLoading(false); });
|
|
@@ -14,10 +14,12 @@ export var getDependentLookupEditorContext = function (state, attributeValue, at
|
|
|
14
14
|
var autocompleteConfig = mdmModule.selectors.getLookupAutocomplete(state);
|
|
15
15
|
var autopopulationEnabled = isAutopopulationEnabled(autocompleteConfig, attributeTypeUri);
|
|
16
16
|
var isEmptyValue = !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.lookupCode) && !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value);
|
|
17
|
-
var placeholder = (isEmptyValue && isBlocked && i18n.text('Populating values...')) ||
|
|
17
|
+
var placeholder = (isEmptyValue && isBlocked && i18n.text('Populating values...')) ||
|
|
18
|
+
(isEmptyValue && missedParentsMessage) ||
|
|
19
|
+
'';
|
|
18
20
|
var context = {
|
|
19
|
-
parents: parents,
|
|
20
|
-
disabled: !!missedParentsMessage || isBlocked,
|
|
21
|
+
parents: missedParentsMessage ? null : parents,
|
|
22
|
+
disabled: (!!missedParentsMessage && isEmptyValue) || isBlocked,
|
|
21
23
|
placeholder: placeholder,
|
|
22
24
|
autopopulationId: autopopulationEnabled ? valueUri : null
|
|
23
25
|
};
|
|
@@ -77,13 +77,15 @@ var DependentLookupEditor = function (_a) {
|
|
|
77
77
|
var loadOptions = useCallback(function (value, pageNumber) {
|
|
78
78
|
if (pageNumber === void 0) { pageNumber = 1; }
|
|
79
79
|
setOptionsAreLoading(true);
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
return (parents === null
|
|
81
|
+
? Promise.resolve([])
|
|
82
|
+
: getLookups({
|
|
83
|
+
type: lookupTypeCode,
|
|
84
|
+
parents: parents,
|
|
85
|
+
displayNamePrefix: value,
|
|
86
|
+
max: max + 1,
|
|
87
|
+
offset: (pageNumber - 1) * max
|
|
88
|
+
}))
|
|
87
89
|
.then(function (buildOptions) { return buildLookupOptions(buildOptions); })
|
|
88
90
|
.catch(function () { return []; })
|
|
89
91
|
.finally(function () { return setOptionsAreLoading(false); });
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1252",
|
|
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.1252",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1252",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|