@abgov/jsonforms-components 1.42.2 → 1.42.4
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/index.esm.js +11 -6
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -4650,6 +4650,7 @@ const Dropdown = props => {
|
|
|
4650
4650
|
}
|
|
4651
4651
|
if (e.key === ESCAPE_KEY) {
|
|
4652
4652
|
setIsOpen(false);
|
|
4653
|
+
setInputTextFocus();
|
|
4653
4654
|
}
|
|
4654
4655
|
let index = items.findIndex(val => {
|
|
4655
4656
|
return val.label === e.currentTarget.innerText;
|
|
@@ -8000,7 +8001,7 @@ const AddressLookUpControl = props => {
|
|
|
8000
8001
|
};
|
|
8001
8002
|
useEffect(() => {
|
|
8002
8003
|
const fetchSuggestions = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
8003
|
-
if (searchTerm.length > 2) {
|
|
8004
|
+
if (searchTerm.length > 2 && searchTerm.charAt(searchTerm.length - 1) !== ' ') {
|
|
8004
8005
|
setLoading(true);
|
|
8005
8006
|
setOpen(true);
|
|
8006
8007
|
yield fetchAddressSuggestions(formUrl, searchTerm, isAlbertaAddress).then(response => {
|
|
@@ -8033,8 +8034,8 @@ const AddressLookUpControl = props => {
|
|
|
8033
8034
|
/* istanbul ignore next */
|
|
8034
8035
|
const handleRequiredFieldBlur = name => {
|
|
8035
8036
|
const err = Object.assign({}, errors);
|
|
8036
|
-
if ((data === null || data === void 0 ? void 0 : data[
|
|
8037
|
-
err[name] = name === 'municipality' ? 'city is required' :
|
|
8037
|
+
if ((data === null || data === void 0 ? void 0 : data['city']) === undefined || (data === null || data === void 0 ? void 0 : data['city']) === '') {
|
|
8038
|
+
err[name] = name === 'municipality' ? 'city is required' : '';
|
|
8038
8039
|
setErrors(err);
|
|
8039
8040
|
}
|
|
8040
8041
|
if (!(data === null || data === void 0 ? void 0 : data[name]) || data[name] === '' || (data === null || data === void 0 ? void 0 : data[name]) === undefined) {
|
|
@@ -8072,17 +8073,17 @@ const AddressLookUpControl = props => {
|
|
|
8072
8073
|
} else if (key === 'ArrowUp') {
|
|
8073
8074
|
setSelectedIndex(prevIndex => prevIndex > 0 ? prevIndex - 1 : suggestions.length - 1);
|
|
8074
8075
|
handleDropdownChange(value);
|
|
8075
|
-
} else if (key === 'Enter') {
|
|
8076
|
+
} else if (key === 'Enter' || key === ' ' && value.length > 2) {
|
|
8076
8077
|
handleDropdownChange(value);
|
|
8077
8078
|
setLoading(false);
|
|
8078
8079
|
if (selectedIndex >= 0) {
|
|
8079
|
-
(_a = document.getElementById(
|
|
8080
|
+
(_a = document.getElementById('goaInput')) === null || _a === void 0 ? void 0 : _a.blur();
|
|
8080
8081
|
const suggestion = suggestions[selectedIndex];
|
|
8081
8082
|
if (suggestion) {
|
|
8082
8083
|
setTimeout(() => {
|
|
8083
8084
|
handleSuggestionClick(suggestion);
|
|
8084
8085
|
setOpen(false);
|
|
8085
|
-
},
|
|
8086
|
+
}, 1);
|
|
8086
8087
|
}
|
|
8087
8088
|
}
|
|
8088
8089
|
}
|
|
@@ -8124,6 +8125,10 @@ const AddressLookUpControl = props => {
|
|
|
8124
8125
|
tabIndex: 0,
|
|
8125
8126
|
children: suggestions && autocompletion && open && suggestions.map((suggestion, index) => jsx(ListItem, {
|
|
8126
8127
|
"data-index": index,
|
|
8128
|
+
onMouseDown: e => {
|
|
8129
|
+
e.preventDefault();
|
|
8130
|
+
e.stopPropagation();
|
|
8131
|
+
},
|
|
8127
8132
|
onClick: () => {
|
|
8128
8133
|
handleSuggestionClick(suggestion);
|
|
8129
8134
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.42.
|
|
3
|
+
"version": "1.42.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|