@abgov/jsonforms-components 1.36.1 → 1.37.0
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
CHANGED
|
@@ -7927,29 +7927,37 @@ const AddressLookUpControl = props => {
|
|
|
7927
7927
|
});
|
|
7928
7928
|
};
|
|
7929
7929
|
|
|
7930
|
-
const
|
|
7930
|
+
const isPropertiesMatch = (obj, props, isExactMatch) => {
|
|
7931
7931
|
if (isObject$e(obj)) {
|
|
7932
7932
|
const keys = Object.keys(obj);
|
|
7933
|
-
|
|
7933
|
+
if (isExactMatch) {
|
|
7934
|
+
return props.every(attr => keys.includes(attr)) && keys.length === props.length;
|
|
7935
|
+
} else {
|
|
7936
|
+
return props.every(attr => keys.includes(attr));
|
|
7937
|
+
}
|
|
7934
7938
|
}
|
|
7935
7939
|
return false;
|
|
7936
7940
|
};
|
|
7937
|
-
const
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7941
|
+
const createSchemaMatchTester = (props, isExactMatch = false) => {
|
|
7942
|
+
return (uischema, schema, context) => {
|
|
7943
|
+
if (!isControl(uischema) || !isScoped(uischema)) {
|
|
7944
|
+
return false;
|
|
7945
|
+
}
|
|
7946
|
+
if ((schema === null || schema === void 0 ? void 0 : schema.properties) && isObject$e(schema === null || schema === void 0 ? void 0 : schema.properties)) {
|
|
7947
|
+
const propertyFromScope = uischema['scope'].split('/').pop();
|
|
7948
|
+
if (isObject$e(schema.properties[propertyFromScope]) && 'properties' in schema.properties[propertyFromScope]) {
|
|
7949
|
+
const objToTest = schema.properties[propertyFromScope]['properties'];
|
|
7950
|
+
if (objToTest && isPropertiesMatch(objToTest, props, isExactMatch)) {
|
|
7951
|
+
return true;
|
|
7952
|
+
}
|
|
7947
7953
|
}
|
|
7948
7954
|
}
|
|
7949
|
-
|
|
7950
|
-
|
|
7955
|
+
return false;
|
|
7956
|
+
};
|
|
7951
7957
|
};
|
|
7952
|
-
|
|
7958
|
+
|
|
7959
|
+
const isAddressLookup = createSchemaMatchTester(['addressLine2', 'municipality', 'addressLine1', 'subdivisionCode', 'postalCode']);
|
|
7960
|
+
const AddressLookUpTester = rankWith(4, isAddressLookup);
|
|
7953
7961
|
|
|
7954
7962
|
const GoATextCell = props => jsx(GoAInputText, Object.assign({}, props));
|
|
7955
7963
|
const GoATextCellTester = rankWith(1, isStringControl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
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",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RankedTester
|
|
2
|
-
export declare const isAddressLookup: (
|
|
1
|
+
import { RankedTester } from '@jsonforms/core';
|
|
2
|
+
export declare const isAddressLookup: import("@jsonforms/core").Tester;
|
|
3
3
|
export declare const AddressLookUpTester: RankedTester;
|