@abgov/jsonforms-components 1.55.1 → 1.56.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
|
@@ -4458,8 +4458,6 @@ const GoAInputText = props => {
|
|
|
4458
4458
|
if (schema && schema.title === sinTitle && value !== '') {
|
|
4459
4459
|
formattedValue = formatSin(value);
|
|
4460
4460
|
}
|
|
4461
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4462
|
-
/* istanbul ignore next */
|
|
4463
4461
|
if (isVisited === false && setIsVisited) {
|
|
4464
4462
|
setIsVisited();
|
|
4465
4463
|
}
|
|
@@ -4470,11 +4468,9 @@ const GoAInputText = props => {
|
|
|
4470
4468
|
});
|
|
4471
4469
|
},
|
|
4472
4470
|
onBlur: (name, value) => {
|
|
4473
|
-
/* istanbul ignore next */
|
|
4474
4471
|
if (isVisited === false && setIsVisited) {
|
|
4475
4472
|
setIsVisited();
|
|
4476
4473
|
}
|
|
4477
|
-
/* istanbul ignore next */
|
|
4478
4474
|
onBlurForTextControl({
|
|
4479
4475
|
name,
|
|
4480
4476
|
controlProps: props,
|
|
@@ -4528,8 +4524,6 @@ const MultiLineText = props => {
|
|
|
4528
4524
|
// maxCount={schema.maxLength || 256}
|
|
4529
4525
|
onKeyPress: (name, value, key) => {
|
|
4530
4526
|
const newValue = autoCapitalize ? value.toUpperCase() : value;
|
|
4531
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4532
|
-
/* istanbul ignore next */
|
|
4533
4527
|
if (isVisited === false && setIsVisited) {
|
|
4534
4528
|
setIsVisited();
|
|
4535
4529
|
}
|
|
@@ -4548,8 +4542,6 @@ const MultiLineText = props => {
|
|
|
4548
4542
|
});
|
|
4549
4543
|
},
|
|
4550
4544
|
onChange: (name, value) => {
|
|
4551
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4552
|
-
/* istanbul ignore next */
|
|
4553
4545
|
if (isVisited === false && setIsVisited) {
|
|
4554
4546
|
setIsVisited();
|
|
4555
4547
|
}
|
|
@@ -4642,8 +4634,6 @@ const GoADateInput = props => {
|
|
|
4642
4634
|
disabled: !enabled,
|
|
4643
4635
|
readonly: readOnly,
|
|
4644
4636
|
onChange: (name, value) => {
|
|
4645
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4646
|
-
/* istanbul ignore next */
|
|
4647
4637
|
if (isVisited === false && setIsVisited) {
|
|
4648
4638
|
setIsVisited();
|
|
4649
4639
|
}
|
|
@@ -4662,11 +4652,9 @@ const GoADateInput = props => {
|
|
|
4662
4652
|
});
|
|
4663
4653
|
},
|
|
4664
4654
|
onBlur: (name, value) => {
|
|
4665
|
-
/* istanbul ignore next */
|
|
4666
4655
|
if (isVisited === false && setIsVisited) {
|
|
4667
4656
|
setIsVisited();
|
|
4668
4657
|
}
|
|
4669
|
-
/* istanbul ignore next */
|
|
4670
4658
|
onBlurForDateControl({
|
|
4671
4659
|
name,
|
|
4672
4660
|
value,
|
|
@@ -4719,11 +4707,9 @@ const GoANumberInput = props => {
|
|
|
4719
4707
|
name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
|
|
4720
4708
|
testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
|
|
4721
4709
|
onBlur: (name, value) => {
|
|
4722
|
-
/* istanbul ignore next */
|
|
4723
4710
|
if (isVisited === false && setIsVisited) {
|
|
4724
4711
|
setIsVisited();
|
|
4725
4712
|
}
|
|
4726
|
-
/* istanbul ignore next */
|
|
4727
4713
|
onBlurForNumericControl({
|
|
4728
4714
|
name,
|
|
4729
4715
|
value,
|
|
@@ -4731,8 +4717,6 @@ const GoANumberInput = props => {
|
|
|
4731
4717
|
});
|
|
4732
4718
|
},
|
|
4733
4719
|
onChange: (name, value) => {
|
|
4734
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4735
|
-
/* istanbul ignore next */
|
|
4736
4720
|
if (isVisited === false && setIsVisited) {
|
|
4737
4721
|
setIsVisited();
|
|
4738
4722
|
}
|
|
@@ -4787,10 +4771,7 @@ const GoAInputInteger = props => {
|
|
|
4787
4771
|
placeholder: placeholder,
|
|
4788
4772
|
name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
|
|
4789
4773
|
testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
|
|
4790
|
-
/* istanbul ignore next */
|
|
4791
4774
|
onBlur: (name, value) => {
|
|
4792
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4793
|
-
/* istanbul ignore next */
|
|
4794
4775
|
if (isVisited === false && setIsVisited) {
|
|
4795
4776
|
setIsVisited();
|
|
4796
4777
|
}
|
|
@@ -4801,8 +4782,6 @@ const GoAInputInteger = props => {
|
|
|
4801
4782
|
});
|
|
4802
4783
|
},
|
|
4803
4784
|
onChange: (name, value) => {
|
|
4804
|
-
/* TODO: add the unit test, when the solution is used */
|
|
4805
|
-
/* istanbul ignore next */
|
|
4806
4785
|
if (isVisited === false && setIsVisited) {
|
|
4807
4786
|
setIsVisited();
|
|
4808
4787
|
}
|
|
@@ -4822,7 +4801,6 @@ const GoAInputIntegerControl = withJsonFormsControlProps(GoAIntegerControl);
|
|
|
4822
4801
|
|
|
4823
4802
|
const GoADateTimeInput = props => {
|
|
4824
4803
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4825
|
-
// eslint-disable-next-line
|
|
4826
4804
|
const {
|
|
4827
4805
|
data,
|
|
4828
4806
|
config,
|
|
@@ -4865,11 +4843,9 @@ const GoADateTimeInput = props => {
|
|
|
4865
4843
|
});
|
|
4866
4844
|
},
|
|
4867
4845
|
onBlur: (name, value) => {
|
|
4868
|
-
/* istanbul ignore next */
|
|
4869
4846
|
if (isVisited === false && setIsVisited) {
|
|
4870
4847
|
setIsVisited();
|
|
4871
4848
|
}
|
|
4872
|
-
/* istanbul ignore next */
|
|
4873
4849
|
onBlurForDateControl({
|
|
4874
4850
|
name,
|
|
4875
4851
|
value,
|
|
@@ -4915,16 +4891,11 @@ const GoATimeInput = props => {
|
|
|
4915
4891
|
readonly: readOnly,
|
|
4916
4892
|
testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
|
|
4917
4893
|
onBlur: (name, value) => {
|
|
4918
|
-
/* istanbul ignore next */
|
|
4919
4894
|
if (isVisited === false && setIsVisited) {
|
|
4920
4895
|
setIsVisited();
|
|
4921
4896
|
}
|
|
4922
|
-
/* istanbul ignore next */
|
|
4923
4897
|
handleChange(path, value === '' ? undefined : value);
|
|
4924
4898
|
},
|
|
4925
|
-
// Dont use handleChange in the onChange event, use the keyPress or onBlur.
|
|
4926
|
-
// If you use it onChange along with keyPress event it will cause a
|
|
4927
|
-
// side effect that causes the validation to render when it shouldnt.
|
|
4928
4899
|
onChange: (name, value) => {},
|
|
4929
4900
|
onKeyPress: (name, value, key) => {
|
|
4930
4901
|
onKeyPressForTimeControl({
|
|
@@ -6498,12 +6469,15 @@ const FormPagesView = props => {
|
|
|
6498
6469
|
disabled: !(category.isValid && category.isCompleted),
|
|
6499
6470
|
testId: "pages-save-continue-btn",
|
|
6500
6471
|
children: "Save and continue"
|
|
6501
|
-
}) : jsx(
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6472
|
+
}) : jsx(GoAButtonGroup, {
|
|
6473
|
+
alignment: "end",
|
|
6474
|
+
children: jsx(GoAButton, {
|
|
6475
|
+
type: 'primary',
|
|
6476
|
+
onClick: handleSubmit,
|
|
6477
|
+
disabled: !isValid,
|
|
6478
|
+
testId: "pages-submit-btn",
|
|
6479
|
+
children: "Submit"
|
|
6480
|
+
})
|
|
6507
6481
|
})
|
|
6508
6482
|
})]
|
|
6509
6483
|
}, `${category.label}`);
|
|
@@ -6549,8 +6523,8 @@ const categoriesAreValid = uischema => {
|
|
|
6549
6523
|
return isValid;
|
|
6550
6524
|
};
|
|
6551
6525
|
const CategorizationStepperRendererTester = rankWith(2, and(uiTypeIs('Categorization'), categoriesAreValid, uischema => {
|
|
6552
|
-
var _a;
|
|
6553
|
-
return ((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.variant) === 'stepper';
|
|
6526
|
+
var _a, _b;
|
|
6527
|
+
return ((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.variant) === 'stepper' || ((_b = uischema.options) === null || _b === void 0 ? void 0 : _b.variant) === undefined;
|
|
6554
6528
|
}));
|
|
6555
6529
|
const CategorizationPagesRendererTester = rankWith(2, and(uiTypeIs('Categorization'), categoriesAreValid, uischema => {
|
|
6556
6530
|
var _a;
|
|
@@ -9704,14 +9678,10 @@ const hasElements = schema => {
|
|
|
9704
9678
|
const isEmptyElements = schema => {
|
|
9705
9679
|
return 'elements' in schema && schema.elements !== undefined && schema.elements !== null && Object.keys(schema.elements).length === 0;
|
|
9706
9680
|
};
|
|
9707
|
-
const hasVariant = schema => {
|
|
9708
|
-
return 'options' in schema && schema.options !== undefined && schema.options !== null;
|
|
9709
|
-
};
|
|
9710
9681
|
|
|
9711
9682
|
const errCategorizationHasNonCategories = "Each element of 'Categorizations' must be of type 'Category'";
|
|
9712
9683
|
const errCategorizationHasNoElements = 'A Categorization must contain Categories.';
|
|
9713
9684
|
const errNoElements = type => `A ${type} must contain elements.`;
|
|
9714
|
-
const errCategorizationHasNoVariant = 'A Categorization must contain Options with a variant.';
|
|
9715
9685
|
const errMissingScope = 'A Control must have a scope';
|
|
9716
9686
|
const errMalformedScope = scope => `Scope ${scope} must be prefixed with '#/'.`;
|
|
9717
9687
|
const errUnknownScope = scope => `Failed to render: unknown scope ${scope}`;
|
|
@@ -9756,9 +9726,6 @@ const getUISchemaErrors = (uiSchema, schema) => {
|
|
|
9756
9726
|
if (!hasElements(uiSchema)) {
|
|
9757
9727
|
return errCategorizationHasNoElements;
|
|
9758
9728
|
}
|
|
9759
|
-
if (!hasVariant(uiSchema)) {
|
|
9760
|
-
return errCategorizationHasNoVariant;
|
|
9761
|
-
}
|
|
9762
9729
|
// ensure each element has type Category, and that each category
|
|
9763
9730
|
// has elements
|
|
9764
9731
|
if (isLayout(uiSchema)) {
|
|
@@ -9840,8 +9807,9 @@ const createDefaultAjv = (...schemas) => {
|
|
|
9840
9807
|
});
|
|
9841
9808
|
ajv.addSchema(schemas);
|
|
9842
9809
|
addErrors(ajv);
|
|
9843
|
-
ajv.addFormat('file-urn', /^urn:ads:platform:file-service:v[0-9]:\/files\/[a-zA-Z0-9.-]*$/);
|
|
9844
9810
|
addFormats(ajv);
|
|
9811
|
+
ajv.addFormat('file-urn', /^urn:ads:platform:file-service:v[0-9]:\/files\/[a-zA-Z0-9.-]*$/);
|
|
9812
|
+
ajv.addFormat('time', /^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/);
|
|
9845
9813
|
return ajv;
|
|
9846
9814
|
};
|
|
9847
9815
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.56.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",
|
|
@@ -2,7 +2,6 @@ import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
|
2
2
|
export declare const errCategorizationHasNonCategories = "Each element of 'Categorizations' must be of type 'Category'";
|
|
3
3
|
export declare const errCategorizationHasNoElements = "A Categorization must contain Categories.";
|
|
4
4
|
export declare const errNoElements: (type: string) => string;
|
|
5
|
-
export declare const errCategorizationHasNoVariant = "A Categorization must contain Options with a variant.";
|
|
6
5
|
export declare const errMissingScope = "A Control must have a scope";
|
|
7
6
|
export declare const errMalformedScope: (scope: string) => string;
|
|
8
7
|
export declare const errUnknownScope: (scope: string) => string;
|