@abgov/jsonforms-components 1.53.6 → 1.53.7
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 +23 -57
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -2835,28 +2835,6 @@ const onKeyPressForTextControl = props => {
|
|
|
2835
2835
|
handleChange(path, value);
|
|
2836
2836
|
}
|
|
2837
2837
|
};
|
|
2838
|
-
/**
|
|
2839
|
-
* Helper functions to process onKeyPress events for Numeric controls.
|
|
2840
|
-
* @param props - EventKeyPressControlProps
|
|
2841
|
-
*/
|
|
2842
|
-
const onKeyPressNumericControl = props => {
|
|
2843
|
-
const {
|
|
2844
|
-
value,
|
|
2845
|
-
key,
|
|
2846
|
-
controlProps
|
|
2847
|
-
} = props;
|
|
2848
|
-
const {
|
|
2849
|
-
handleChange,
|
|
2850
|
-
path
|
|
2851
|
-
} = controlProps;
|
|
2852
|
-
if (isNotKeyPressTabOrShift(key)) {
|
|
2853
|
-
let newValue = '';
|
|
2854
|
-
if (value !== '') {
|
|
2855
|
-
newValue = +value;
|
|
2856
|
-
}
|
|
2857
|
-
handleChange(path, newValue);
|
|
2858
|
-
}
|
|
2859
|
-
};
|
|
2860
2838
|
/**
|
|
2861
2839
|
* Helper function to process onKeyPress events for Time controls
|
|
2862
2840
|
* @param props - EventKeyPressControlProps
|
|
@@ -3013,9 +2991,7 @@ const onChangeForInputControl = props => {
|
|
|
3013
2991
|
handleChange,
|
|
3014
2992
|
path
|
|
3015
2993
|
} = controlProps;
|
|
3016
|
-
|
|
3017
|
-
handleChange(path, value);
|
|
3018
|
-
}
|
|
2994
|
+
handleChange(path, value);
|
|
3019
2995
|
};
|
|
3020
2996
|
/**
|
|
3021
2997
|
* Helper function to process onChange event for Date controls.
|
|
@@ -4508,14 +4484,7 @@ const GoAInputText = props => {
|
|
|
4508
4484
|
controlProps: props
|
|
4509
4485
|
});
|
|
4510
4486
|
},
|
|
4511
|
-
onKeyPress: (name, value, key) => {
|
|
4512
|
-
onKeyPressForTextControl({
|
|
4513
|
-
name,
|
|
4514
|
-
value: autoCapitalize ? value.toUpperCase() : value,
|
|
4515
|
-
key,
|
|
4516
|
-
controlProps: props
|
|
4517
|
-
});
|
|
4518
|
-
},
|
|
4487
|
+
onKeyPress: (name, value, key) => {},
|
|
4519
4488
|
onBlur: (name, value) => {
|
|
4520
4489
|
onBlurForTextControl({
|
|
4521
4490
|
name,
|
|
@@ -4741,14 +4710,7 @@ const GoANumberInput = props => {
|
|
|
4741
4710
|
width: width,
|
|
4742
4711
|
name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
|
|
4743
4712
|
testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
|
|
4744
|
-
onKeyPress: (name, value, key) => {
|
|
4745
|
-
onKeyPressNumericControl({
|
|
4746
|
-
name,
|
|
4747
|
-
value,
|
|
4748
|
-
key,
|
|
4749
|
-
controlProps: props
|
|
4750
|
-
});
|
|
4751
|
-
},
|
|
4713
|
+
onKeyPress: (name, value, key) => {},
|
|
4752
4714
|
onBlur: (name, value) => {
|
|
4753
4715
|
onBlurForNumericControl({
|
|
4754
4716
|
name,
|
|
@@ -4809,14 +4771,7 @@ const GoAInputInteger = props => {
|
|
|
4809
4771
|
placeholder: placeholder,
|
|
4810
4772
|
name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
|
|
4811
4773
|
testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
|
|
4812
|
-
onKeyPress: (name, value, key) => {
|
|
4813
|
-
onKeyPressNumericControl({
|
|
4814
|
-
name,
|
|
4815
|
-
value,
|
|
4816
|
-
key,
|
|
4817
|
-
controlProps: props
|
|
4818
|
-
});
|
|
4819
|
-
},
|
|
4774
|
+
onKeyPress: (name, value, key) => {},
|
|
4820
4775
|
onBlur: (name, value) => {
|
|
4821
4776
|
onBlurForNumericControl({
|
|
4822
4777
|
name,
|
|
@@ -5817,15 +5772,15 @@ const pickPropertyValues = (obj, property, endWithType) => {
|
|
|
5817
5772
|
} else if (_$b.isObject(obj[key])) {
|
|
5818
5773
|
// if the object type is equal to end type, we are not going to continue the recursive approach
|
|
5819
5774
|
if (endWithType && ((_a = obj[key]) === null || _a === void 0 ? void 0 : _a.type) === endWithType) {
|
|
5820
|
-
if (obj[key]) {
|
|
5821
|
-
values.push(obj[key]);
|
|
5775
|
+
if (property in obj[key]) {
|
|
5776
|
+
values.push(obj[key][property]);
|
|
5822
5777
|
}
|
|
5823
5778
|
} else {
|
|
5824
|
-
values = [...values, ...pickPropertyValues(obj[key], property)];
|
|
5779
|
+
values = [...values, ...pickPropertyValues(obj[key], property, endWithType)];
|
|
5825
5780
|
}
|
|
5826
5781
|
} else if (_$b.isArray(obj[key])) {
|
|
5827
5782
|
const nextValues = obj[key].map(function (arrayObj) {
|
|
5828
|
-
return pickPropertyValues(arrayObj, property);
|
|
5783
|
+
return pickPropertyValues(arrayObj, property, endWithType);
|
|
5829
5784
|
});
|
|
5830
5785
|
values = [...values, ...nextValues];
|
|
5831
5786
|
}
|
|
@@ -5945,8 +5900,14 @@ const subErrorInParent = (error, paths) => {
|
|
|
5945
5900
|
For example: error with instance path /roadmap/0/when belongs to /roadmap
|
|
5946
5901
|
*/
|
|
5947
5902
|
const errorPaths = error.instancePath.split('/');
|
|
5948
|
-
if (errorPaths.length <
|
|
5949
|
-
|
|
5903
|
+
if (errorPaths.length < 2) return false;
|
|
5904
|
+
// For case /roadmap/0
|
|
5905
|
+
if (errorPaths.length > 1 && isNumber(errorPaths[errorPaths.length - 1])) {
|
|
5906
|
+
const parentPath = errorPaths.slice(0, errorPaths.length - 1).join('/');
|
|
5907
|
+
return paths.includes(parentPath);
|
|
5908
|
+
}
|
|
5909
|
+
// For case /roadmap/0/when
|
|
5910
|
+
if (errorPaths.length > 2 && isNumber(errorPaths[errorPaths.length - 2])) {
|
|
5950
5911
|
const parentPath = errorPaths.slice(0, errorPaths.length - 2).join('/');
|
|
5951
5912
|
return paths.includes(parentPath);
|
|
5952
5913
|
}
|
|
@@ -6059,9 +6020,9 @@ const createStepperContextInitData = props => {
|
|
|
6059
6020
|
const categorization = uischema;
|
|
6060
6021
|
const valid = ajv.validate(schema, data || {});
|
|
6061
6022
|
const categories = (_a = categorization.elements) === null || _a === void 0 ? void 0 : _a.map((c, id) => {
|
|
6062
|
-
const scopes = pickPropertyValues(c, 'scope');
|
|
6023
|
+
const scopes = pickPropertyValues(c, 'scope', 'ListWithDetail');
|
|
6063
6024
|
// ListWithDetail path might have conflicts with others. The errors in ListWithDetail will still be caught in the ctx.core.errors
|
|
6064
|
-
const incompletePaths = getIncompletePaths(ajv,
|
|
6025
|
+
const incompletePaths = getIncompletePaths(ajv, scopes);
|
|
6065
6026
|
return {
|
|
6066
6027
|
id,
|
|
6067
6028
|
label: deriveLabelForUISchemaElement(c, t),
|
|
@@ -6837,6 +6798,11 @@ const ToolBarHeader = styled.div(_t3$1 || (_t3$1 = _$2`
|
|
|
6837
6798
|
`));
|
|
6838
6799
|
const ObjectArrayTitle = styled.h3(_t4$1 || (_t4$1 = _$2`
|
|
6839
6800
|
margin-bottom: var(--goa-space-l);
|
|
6801
|
+
|
|
6802
|
+
span {
|
|
6803
|
+
color: #666666;
|
|
6804
|
+
font-size: var(--goa-font-size-2);
|
|
6805
|
+
}
|
|
6840
6806
|
`));
|
|
6841
6807
|
const TextCenter = styled.div(_t5$1 || (_t5$1 = _$2`
|
|
6842
6808
|
text-align: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.53.
|
|
3
|
+
"version": "1.53.7",
|
|
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",
|