@abgov/jsonforms-components 2.52.4 → 2.52.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 CHANGED
@@ -3054,6 +3054,7 @@ $$z({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$3 }, {
3054
3054
  const sinTitle = 'Social insurance number';
3055
3055
  const invalidSin = 'Social insurance number is invalid';
3056
3056
  const DEFAULT_MAX_ITEMS = 50;
3057
+ const REQUIRED_PROPERTY_ERROR = 'is a required property';
3057
3058
 
3058
3059
  /**
3059
3060
  * Sets the first word to be capitalized so that it is sentence cased.
@@ -9374,7 +9375,7 @@ const MainTab = ({
9374
9375
  acc.fields[field] = prettify$1(missingFromNested) + ' is required';
9375
9376
  } else {
9376
9377
  const raw = e.message;
9377
- if (raw && (raw.includes('must have required property') || raw.includes('is a required property'))) {
9378
+ if (raw && (raw.includes('must have required property') || raw.includes(REQUIRED_PROPERTY_ERROR))) {
9378
9379
  const m = raw.match(/'([^']+)'/);
9379
9380
  if (m && m[1]) acc.fields[field] = prettify$1(m[1]) + ' is required';else acc.fields[field] = raw;
9380
9381
  } else {
@@ -9392,7 +9393,7 @@ const MainTab = ({
9392
9393
  acc.row = prettify$1(missingFromNested) + ' is required';
9393
9394
  } else {
9394
9395
  const raw = e == null ? void 0 : e.message;
9395
- if (raw && (raw.includes('must have required property') || raw.includes('is a required property'))) {
9396
+ if (raw && (raw.includes('must have required property') || raw.includes(REQUIRED_PROPERTY_ERROR))) {
9396
9397
  const m = raw.match(/'([^']+)'/);
9397
9398
  if (m && m[1]) acc.row = prettify$1(m[1]) + ' is required';else acc.row = raw;
9398
9399
  } else {
@@ -9405,7 +9406,7 @@ const MainTab = ({
9405
9406
  }
9406
9407
  if (!acc.fields[field]) {
9407
9408
  let msg = humanizeAjvError(e, core.schema, core.uischema);
9408
- if (typeof msg === 'string' && (msg.includes('must have required property') || msg.includes('is a required property'))) {
9409
+ if (typeof msg === 'string' && (msg.includes('must have required property') || msg.includes(REQUIRED_PROPERTY_ERROR))) {
9409
9410
  const propertyMatch = msg.match(/'([^']+)'/);
9410
9411
  if (propertyMatch && propertyMatch[1]) {
9411
9412
  msg = prettify$1(propertyMatch[1]) + ' is required';
@@ -9859,11 +9860,9 @@ const GoAInputBaseTableReview = props => {
9859
9860
  enabled: enabled,
9860
9861
  renderers: jsonForms.renderers,
9861
9862
  cells: cells
9862
- }), activeError && jsxs(WarningIconDiv, {
9863
- children: [jsx(GoabIcon, {
9864
- type: "warning",
9865
- size: "small"
9866
- }), activeError]
9863
+ }), activeError && jsx(GoabFormItem, {
9864
+ error: activeError,
9865
+ label: ""
9867
9866
  })]
9868
9867
  })]
9869
9868
  })
@@ -10013,7 +10012,7 @@ const GoAEmailInput = props => {
10013
10012
  }, [showReviewLink]);
10014
10013
  const splitErrors = (errors != null ? errors : '').split(/\r?\n/).map(e => e.trim()).filter(Boolean);
10015
10014
  const primaryLabel = (defaultSchema == null ? void 0 : defaultSchema.label) || defaultLabel;
10016
- const splintIndex = splitErrors.findIndex(e => e === 'is a required property');
10015
+ const splintIndex = splitErrors.findIndex(e => e === REQUIRED_PROPERTY_ERROR);
10017
10016
  splitErrors[splintIndex] = `${primaryLabel} is required`;
10018
10017
  const finalErrors = splitErrors.join('\n');
10019
10018
  return jsx(Visible, {
@@ -10633,11 +10632,9 @@ const FullNameControlReview = props => {
10633
10632
  testId: "full-name-change-btn",
10634
10633
  children: "Change"
10635
10634
  })]
10636
- }), errors && jsxs(WarningIconDiv, {
10637
- children: [jsx(GoabIcon, {
10638
- type: "warning",
10639
- size: "small"
10640
- }), errors != null && errors.includes('is a required property') ? `${label} is required` : errors]
10635
+ }), errors && jsx(GoabFormItem, {
10636
+ error: errors != null && errors.includes(REQUIRED_PROPERTY_ERROR) ? `${label} is required` : errors,
10637
+ label: ""
10641
10638
  })]
10642
10639
  })
10643
10640
  }), renderRow('First name', data == null ? void 0 : data.firstName, `firstName-control-${id}`), (data == null ? void 0 : data.middleName) && renderRow('Middle name', data == null ? void 0 : data.middleName, `middleName-control-${id}`), renderRow('Last name', data == null ? void 0 : data.lastName, `lastName-control-${id}`)]
@@ -10692,11 +10689,9 @@ const FullNameDobReviewControl = props => {
10692
10689
  testId: "fullname-dob-change-btn",
10693
10690
  children: "Change"
10694
10691
  })]
10695
- }), errors && jsxs(WarningIconDiv, {
10696
- children: [jsx(GoabIcon, {
10697
- type: "warning",
10698
- size: "small"
10699
- }), errors != null && errors.includes('is a required property') ? `${label} is required` : errors]
10692
+ }), errors && jsx(GoabFormItem, {
10693
+ error: errors != null && errors.includes(REQUIRED_PROPERTY_ERROR) ? `${label} is required` : errors,
10694
+ label: ""
10700
10695
  })]
10701
10696
  })
10702
10697
  }), renderRow('First name', data == null ? void 0 : data.firstName, `firstName-control-${id}`), (data == null ? void 0 : data.middleName) && renderRow('Middle name', data == null ? void 0 : data.middleName, `middleName-control-${id}`), renderRow('Last name', data == null ? void 0 : data.lastName, `lastName-control-${id}`), renderRow('Date of birth', data == null ? void 0 : data.dateOfBirth, `dob-control-${id}`)]
@@ -11206,7 +11201,7 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
11206
11201
  if (error) {
11207
11202
  try {
11208
11203
  humanMessage = humanizeAjvError(error, schema, uischema);
11209
- if (typeof humanMessage === 'string' && (humanMessage.includes('must have required property') || humanMessage.includes('is a required property'))) {
11204
+ if (typeof humanMessage === 'string' && (humanMessage.includes('must have required property') || humanMessage.includes(REQUIRED_PROPERTY_ERROR))) {
11210
11205
  const propertyMatch = humanMessage.match(/'([^']+)'/);
11211
11206
  if (propertyMatch && propertyMatch[1]) {
11212
11207
  humanMessage = prettify(propertyMatch[1]) + ' is required';
@@ -12130,7 +12125,7 @@ const AddressLoopUpControlTableReview = props => {
12130
12125
  } catch (err) {
12131
12126
  // fallback to parsing the raw message
12132
12127
  const raw = matched.message;
12133
- if (raw != null && raw.includes('must have required property') || raw != null && raw.includes('is a required property')) {
12128
+ if (raw != null && raw.includes('must have required property') || raw != null && raw.includes(REQUIRED_PROPERTY_ERROR)) {
12134
12129
  const propertyMatch = raw.match(/'([^']+)'/);
12135
12130
  if (propertyMatch && propertyMatch[1]) {
12136
12131
  return prettify(propertyMatch[1]) + ' is required';
@@ -12146,12 +12141,12 @@ const AddressLoopUpControlTableReview = props => {
12146
12141
  // Build the target scope for the address control
12147
12142
  const targetScope = (uischema == null ? void 0 : uischema.scope) || (path ? `#/properties/${path}` : undefined);
12148
12143
  const renderRow = (label, value, propName, showButton = false) => {
12149
- var _error, _error2;
12150
12144
  let error = getError(propName);
12151
12145
  const required = isRequired(propName);
12152
12146
  if (required && !value && !error) {
12153
12147
  error = `${label} is required`;
12154
12148
  }
12149
+ const errorMessage = error && (error.includes(REQUIRED_PROPERTY_ERROR) || error.includes('required property')) ? `${label} is required` : error;
12155
12150
  return jsx("tr", {
12156
12151
  children: jsxs(PageReviewContainer, {
12157
12152
  colSpan: 3,
@@ -12168,11 +12163,9 @@ const AddressLoopUpControlTableReview = props => {
12168
12163
  children: "Change"
12169
12164
  })]
12170
12165
  }), jsxs(ReviewValue, {
12171
- children: [value, error && jsxs(WarningIconDiv, {
12172
- children: [jsx(GoabIcon, {
12173
- type: "warning",
12174
- size: "small"
12175
- }), (_error = error) != null && _error.includes('is a required property') || (_error2 = error) != null && _error2.includes('required property') ? `${label} is required` : error]
12166
+ children: [value, errorMessage && jsx(GoabFormItem, {
12167
+ error: errorMessage,
12168
+ label: ""
12176
12169
  })]
12177
12170
  })]
12178
12171
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.52.4",
3
+ "version": "2.52.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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-03-11T20:34:29.251Z",
4
- "sourceCommit": "f6ef75a475c4b947ccfa5973b95b3863c853bd54",
3
+ "generatedAt": "2026-03-12T16:07:35.526Z",
4
+ "sourceCommit": "eb39e14e128ca827f5b003925333aaeacc8e8e87",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 32,
7
7
  "renderers": [
@@ -1,3 +1,4 @@
1
1
  export declare const sinTitle = "Social insurance number";
2
2
  export declare const invalidSin = "Social insurance number is invalid";
3
3
  export declare const DEFAULT_MAX_ITEMS = 50;
4
+ export declare const REQUIRED_PROPERTY_ERROR = "is a required property";