@abgov/jsonforms-components 1.50.0 → 1.50.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
CHANGED
|
@@ -5,7 +5,7 @@ import styled from 'styled-components';
|
|
|
5
5
|
import React, { createContext, useContext, useReducer, useMemo, useEffect, useState, useRef, useCallback } from 'react';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
import get$1 from 'lodash/get';
|
|
8
|
-
import { rankWith, isStringControl, and, optionIs, uiTypeIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, getAjv, isVisible, toDataPath, deriveLabelForUISchemaElement, isEnabled, schemaTypeIs, formatIs, createDefaultValue, Paths, or, isObjectArrayControl, isPrimitiveArrayControl,
|
|
8
|
+
import { rankWith, isStringControl, and, optionIs, uiTypeIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, getAjv, isVisible, toDataPath, deriveLabelForUISchemaElement, isEnabled, schemaTypeIs, formatIs, createDefaultValue, Paths, or, isObjectArrayControl, isPrimitiveArrayControl, schemaMatches, hasType, isControl, isCategorization, isLayout } from '@jsonforms/core';
|
|
9
9
|
import { withJsonFormsControlProps, withJsonFormsRendererProps, withJsonFormsEnumProps, withTranslateProps, useJsonForms, JsonFormsDispatch, withJsonFormsLayoutProps, withJsonFormsArrayLayoutProps, withJsonFormsCellProps } from '@jsonforms/react';
|
|
10
10
|
import * as _$b from 'lodash';
|
|
11
11
|
import { isEqual, isObject as isObject$f } from 'lodash';
|
|
@@ -5288,7 +5288,7 @@ const ReviewLayoutRenderer = ({
|
|
|
5288
5288
|
};
|
|
5289
5289
|
const ReviewGrid = styled.div(_t$6 || (_t$6 = _$6`
|
|
5290
5290
|
display: grid;
|
|
5291
|
-
grid-template-columns: repeat(auto-
|
|
5291
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, calc(50% - 8px)));
|
|
5292
5292
|
gap: 16px;
|
|
5293
5293
|
`));
|
|
5294
5294
|
|
|
@@ -8699,21 +8699,9 @@ const isPropertiesMatch = (obj, props, isExactMatch) => {
|
|
|
8699
8699
|
return false;
|
|
8700
8700
|
};
|
|
8701
8701
|
const createSchemaMatchTester = (props, isExactMatch = false) => {
|
|
8702
|
-
return (
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
}
|
|
8706
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.properties) && isObject$f(schema === null || schema === void 0 ? void 0 : schema.properties)) {
|
|
8707
|
-
const propertyFromScope = uischema['scope'].split('/').pop();
|
|
8708
|
-
if (isObject$f(schema.properties[propertyFromScope]) && 'properties' in schema.properties[propertyFromScope]) {
|
|
8709
|
-
const objToTest = schema.properties[propertyFromScope]['properties'];
|
|
8710
|
-
if (objToTest && isPropertiesMatch(objToTest, props, isExactMatch)) {
|
|
8711
|
-
return true;
|
|
8712
|
-
}
|
|
8713
|
-
}
|
|
8714
|
-
}
|
|
8715
|
-
return false;
|
|
8716
|
-
};
|
|
8702
|
+
return schemaMatches(schema => {
|
|
8703
|
+
return schema && isPropertiesMatch(schema.properties, props, isExactMatch);
|
|
8704
|
+
});
|
|
8717
8705
|
};
|
|
8718
8706
|
|
|
8719
8707
|
const isAddressLookup = createSchemaMatchTester(['addressLine2', 'municipality', 'addressLine1', 'subdivisionCode', 'postalCode']);
|
|
@@ -8886,28 +8874,7 @@ const FullNameControl = props => {
|
|
|
8886
8874
|
});
|
|
8887
8875
|
};
|
|
8888
8876
|
|
|
8889
|
-
const
|
|
8890
|
-
if (isObject$f(obj)) {
|
|
8891
|
-
const keys = Object.keys(obj);
|
|
8892
|
-
return ['firstName', 'middleName', 'lastName'].every(attr => keys.includes(attr)) && keys.length === 3;
|
|
8893
|
-
}
|
|
8894
|
-
return false;
|
|
8895
|
-
};
|
|
8896
|
-
const isFullName = (uischema, schema, context) => {
|
|
8897
|
-
if (!isControl(uischema) || !isScoped(uischema)) {
|
|
8898
|
-
return false;
|
|
8899
|
-
}
|
|
8900
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.properties) && isObject$f(schema === null || schema === void 0 ? void 0 : schema.properties)) {
|
|
8901
|
-
const propertyFromScope = uischema['scope'].split('/').pop();
|
|
8902
|
-
if (isObject$f(schema.properties[propertyFromScope]) && 'properties' in schema.properties[propertyFromScope]) {
|
|
8903
|
-
const objToTest = schema.properties[propertyFromScope]['properties'];
|
|
8904
|
-
if (objToTest && isFullNameSchema(objToTest)) {
|
|
8905
|
-
return true;
|
|
8906
|
-
}
|
|
8907
|
-
}
|
|
8908
|
-
}
|
|
8909
|
-
return false;
|
|
8910
|
-
};
|
|
8877
|
+
const isFullName = createSchemaMatchTester(['firstName', 'middleName', 'lastName'], true);
|
|
8911
8878
|
const FullNameTester = rankWith(4, isFullName);
|
|
8912
8879
|
|
|
8913
8880
|
const FullNameDobControl = props => {
|
|
@@ -9119,28 +9086,7 @@ const FullNameDobReviewControl = props => {
|
|
|
9119
9086
|
});
|
|
9120
9087
|
};
|
|
9121
9088
|
|
|
9122
|
-
const
|
|
9123
|
-
if (isObject$f(obj)) {
|
|
9124
|
-
const keys = Object.keys(obj);
|
|
9125
|
-
return ['firstName', 'middleName', 'lastName', 'dateOfBirth'].every(attr => keys.includes(attr)) && keys.length === 4;
|
|
9126
|
-
}
|
|
9127
|
-
return false;
|
|
9128
|
-
};
|
|
9129
|
-
const isFullNameDoB = (uischema, schema, context) => {
|
|
9130
|
-
if (!isControl(uischema) || !isScoped(uischema)) {
|
|
9131
|
-
return false;
|
|
9132
|
-
}
|
|
9133
|
-
if ((schema === null || schema === void 0 ? void 0 : schema.properties) && isObject$f(schema === null || schema === void 0 ? void 0 : schema.properties)) {
|
|
9134
|
-
const propertyFromScope = uischema['scope'].split('/').pop();
|
|
9135
|
-
if (isObject$f(schema.properties[propertyFromScope]) && 'properties' in schema.properties[propertyFromScope]) {
|
|
9136
|
-
const objToTest = schema.properties[propertyFromScope]['properties'];
|
|
9137
|
-
if (objToTest && isFullNameDoBSchema(objToTest)) {
|
|
9138
|
-
return true;
|
|
9139
|
-
}
|
|
9140
|
-
}
|
|
9141
|
-
}
|
|
9142
|
-
return false;
|
|
9143
|
-
};
|
|
9089
|
+
const isFullNameDoB = createSchemaMatchTester(['firstName', 'middleName', 'lastName', 'dateOfBirth'], true);
|
|
9144
9090
|
const FullNameDobTester = rankWith(4, isFullNameDoB);
|
|
9145
9091
|
|
|
9146
9092
|
const GoATextCell = props => jsx(GoAInputText, Object.assign({}, props));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.50.
|
|
3
|
+
"version": "1.50.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",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RankedTester
|
|
2
|
-
export declare const isFullName: (
|
|
1
|
+
import { RankedTester } from '@jsonforms/core';
|
|
2
|
+
export declare const isFullName: import("@jsonforms/core").Tester;
|
|
3
3
|
export declare const FullNameTester: RankedTester;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RankedTester
|
|
2
|
-
export declare const isFullNameDoB: (
|
|
1
|
+
import { RankedTester } from '@jsonforms/core';
|
|
2
|
+
export declare const isFullNameDoB: import("@jsonforms/core").Tester;
|
|
3
3
|
export declare const FullNameDobTester: RankedTester;
|