@abgov/jsonforms-components 2.1.2 → 2.1.3

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.
Files changed (2) hide show
  1. package/index.esm.js +4 -4
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -7564,7 +7564,7 @@ const renderCellColumn = ({
7564
7564
  const result = Object.keys(currentData);
7565
7565
  if (result.length === 0) {
7566
7566
  return renderWarningCell();
7567
- } else if (result.length > 0 && (isObjectArrayEmpty(currentData) || nestedErrors.length > 0)) {
7567
+ } else if (result.length > 0 && isRequired && (isObjectArrayEmpty(currentData) || nestedErrors.length > 0)) {
7568
7568
  return jsx("pre", {
7569
7569
  children: renderWarningCell(JSON.stringify(currentData, null, 2))
7570
7570
  });
@@ -7743,7 +7743,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7743
7743
  const errorRow = errors === null || errors === void 0 ? void 0 : errors.find(error => error.instancePath.includes(`/${props.rowPath.replace(/\./g, '/')}/${i}`));
7744
7744
  return jsxs("tr", {
7745
7745
  children: [Object.keys(properties).map((element, ix) => {
7746
- var _a;
7746
+ var _a, _b;
7747
7747
  const dataObject = properties[element];
7748
7748
  const schemaName = element;
7749
7749
  const currentData = data && data[num] ? data[num][element] : '';
@@ -7763,7 +7763,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7763
7763
  children: renderCellColumn({
7764
7764
  currentData,
7765
7765
  error: error === null || error === void 0 ? void 0 : error.message,
7766
- isRequired: required === null || required === void 0 ? void 0 : required.includes(tableKeys[element]),
7766
+ isRequired: (required === null || required === void 0 ? void 0 : required.includes(tableKeys[element])) || ((_a = nestedItems[element]) === null || _a === void 0 ? void 0 : _a.required.length) > 0,
7767
7767
  errors: errors !== undefined ? errors : [],
7768
7768
  count: count !== undefined ? count : -1,
7769
7769
  element,
@@ -7775,7 +7775,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7775
7775
  }
7776
7776
  return jsx("td", {
7777
7777
  children: jsx(GoAFormItem, {
7778
- error: (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : '',
7778
+ error: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : '',
7779
7779
  mb: errorRow && !error && '2xl' || 'xs',
7780
7780
  children: dataObject.type === 'number' || dataObject.type === 'string' && !dataObject.enum ? jsx(GoAInput, {
7781
7781
  error: (error === null || error === void 0 ? void 0 : error.message.length) > 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
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",