@abgov/jsonforms-components 1.35.0 → 1.35.1
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 +12 -4
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -7226,18 +7226,26 @@ const AddressLookUpControl = props => {
|
|
|
7226
7226
|
};
|
|
7227
7227
|
const handleInputChange = (field, value) => {
|
|
7228
7228
|
var _a, _b;
|
|
7229
|
+
let newAddress;
|
|
7229
7230
|
if (field === 'postalCode') {
|
|
7230
7231
|
const validatePc = validatePostalCode(value);
|
|
7231
|
-
if (!validatePc && value.length >=
|
|
7232
|
+
if (!validatePc && value.length >= 4) {
|
|
7232
7233
|
const postalCodeErrorMessage = (_b = (_a = schema.errorMessage) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.postalCode;
|
|
7233
7234
|
setPostalCodeErrorMsg(postalCodeErrorMessage !== null && postalCodeErrorMessage !== void 0 ? postalCodeErrorMessage : '');
|
|
7234
7235
|
} else {
|
|
7235
7236
|
setPostalCodeErrorMsg('');
|
|
7236
7237
|
}
|
|
7238
|
+
if (value.length >= 4 && value.indexOf(' ') === -1) {
|
|
7239
|
+
value = value.slice(0, 3) + ' ' + value.slice(3);
|
|
7240
|
+
}
|
|
7241
|
+
newAddress = Object.assign(Object.assign({}, address), {
|
|
7242
|
+
[field]: value.toUpperCase()
|
|
7243
|
+
});
|
|
7244
|
+
} else {
|
|
7245
|
+
newAddress = Object.assign(Object.assign({}, address), {
|
|
7246
|
+
[field]: value
|
|
7247
|
+
});
|
|
7237
7248
|
}
|
|
7238
|
-
const newAddress = Object.assign(Object.assign({}, address), {
|
|
7239
|
-
[field]: value
|
|
7240
|
-
});
|
|
7241
7249
|
setAddress(newAddress);
|
|
7242
7250
|
updateFormData(newAddress);
|
|
7243
7251
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.1",
|
|
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",
|