@abgov/jsonforms-components 1.53.3 → 1.53.5
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 +13 -5
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -3882,7 +3882,7 @@ const GoAInputBaseControl = props => {
|
|
|
3882
3882
|
isStepperReview
|
|
3883
3883
|
} = props;
|
|
3884
3884
|
const InnerComponent = input;
|
|
3885
|
-
const labelToUpdate = getLabelText(uischema.scope, label || '');
|
|
3885
|
+
const labelToUpdate = convertToSentenceCase(getLabelText(uischema.scope, label || ''));
|
|
3886
3886
|
let modifiedErrors = checkFieldValidity(props);
|
|
3887
3887
|
if (modifiedErrors === 'must be equal to one of the allowed values') {
|
|
3888
3888
|
modifiedErrors = '';
|
|
@@ -5268,12 +5268,15 @@ const GoABaseInputReviewComponent = props => {
|
|
|
5268
5268
|
id,
|
|
5269
5269
|
uischema,
|
|
5270
5270
|
schema,
|
|
5271
|
-
required
|
|
5271
|
+
required,
|
|
5272
|
+
label
|
|
5272
5273
|
} = props;
|
|
5273
5274
|
let reviewText = data;
|
|
5274
5275
|
const isBoolean = typeof data === 'boolean';
|
|
5275
5276
|
const requiredText = `${((_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.text) ? (_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.text : (schema === null || schema === void 0 ? void 0 : schema.title) ? schema === null || schema === void 0 ? void 0 : schema.title : schema === null || schema === void 0 ? void 0 : schema.description}${required ? ' is required.' : ''}`;
|
|
5276
5277
|
const renderRequiredLabel = () => {
|
|
5278
|
+
var _a;
|
|
5279
|
+
if (label !== '' && ((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.text) !== '') return null;
|
|
5277
5280
|
return data !== undefined && schema.type === 'boolean' && required ? jsx(RequiredTextLabel, {
|
|
5278
5281
|
children: ` (required)`
|
|
5279
5282
|
}) : null;
|
|
@@ -5281,17 +5284,21 @@ const GoABaseInputReviewComponent = props => {
|
|
|
5281
5284
|
const renderWarningMessage = () => {
|
|
5282
5285
|
var _a;
|
|
5283
5286
|
if ((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.radio) return null;
|
|
5284
|
-
if (schema.type === 'boolean' && required && data === undefined) {
|
|
5287
|
+
if (schema.type === 'boolean' && required && (data === undefined || data === false)) {
|
|
5285
5288
|
return warningIcon(requiredText.trim());
|
|
5286
5289
|
}
|
|
5287
5290
|
return null;
|
|
5288
5291
|
};
|
|
5289
5292
|
if (isBoolean) {
|
|
5290
|
-
const
|
|
5293
|
+
const checkboxLabel = ((_d = (_c = uischema.options) === null || _c === void 0 ? void 0 : _c.text) === null || _d === void 0 ? void 0 : _d.trim()) || convertToSentenceCase(getLastSegmentFromPointer(uischema.scope));
|
|
5291
5294
|
if (((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.radio) === true) {
|
|
5292
5295
|
reviewText = data ? `Yes` : `No`;
|
|
5293
5296
|
} else {
|
|
5294
|
-
|
|
5297
|
+
if (label !== '' || typeof label === 'boolean') {
|
|
5298
|
+
reviewText = data ? `Yes` : `No`;
|
|
5299
|
+
} else {
|
|
5300
|
+
reviewText = data ? `Yes (${checkboxLabel.trim()})` : `No (${checkboxLabel.trim()})`;
|
|
5301
|
+
}
|
|
5295
5302
|
}
|
|
5296
5303
|
}
|
|
5297
5304
|
return jsxs("div", {
|
|
@@ -8636,6 +8643,7 @@ const AddressLookUpControl = props => {
|
|
|
8636
8643
|
children: [renderHelp(), jsx("h3", {
|
|
8637
8644
|
children: label
|
|
8638
8645
|
}), jsx(GoAFormItem, {
|
|
8646
|
+
requirement: 'required',
|
|
8639
8647
|
label: 'Street address or P.O. box',
|
|
8640
8648
|
error: (_g = errors === null || errors === void 0 ? void 0 : errors['addressLine1']) !== null && _g !== void 0 ? _g : '',
|
|
8641
8649
|
"data-testId": "form-address-line1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.53.
|
|
3
|
+
"version": "1.53.5",
|
|
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",
|