@abgov/jsonforms-components 2.1.3 → 2.1.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.
Files changed (2) hide show
  1. package/index.esm.js +6 -7
  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 && isRequired && (isObjectArrayEmpty(currentData) || nestedErrors.length > 0)) {
7567
+ } else if (result.length > 0 && (isObjectArrayEmpty(currentData) || nestedErrors.length > 0)) {
7568
7568
  return jsx("pre", {
7569
7569
  children: renderWarningCell(JSON.stringify(currentData, null, 2))
7570
7570
  });
@@ -7678,7 +7678,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7678
7678
  const properties = (schema === null || schema === void 0 ? void 0 : schema.items) && 'properties' in schema.items && schema.items.properties || {};
7679
7679
  const required = (_a = schema.items) === null || _a === void 0 ? void 0 : _a.required;
7680
7680
  const propertyKeys = Object.keys(properties);
7681
- const nestedItems = extractNestedFields(properties, propertyKeys);
7681
+ extractNestedFields(properties, propertyKeys);
7682
7682
  let tableKeys = extractNames((_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.detail);
7683
7683
  if (Object.keys(tableKeys).length === 0) {
7684
7684
  Object.keys(properties).forEach(item => {
@@ -7715,7 +7715,6 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7715
7715
  children: [jsx("thead", {
7716
7716
  children: jsxs("tr", {
7717
7717
  children: [Object.entries(tableKeys).map(([value, index]) => {
7718
- var _a;
7719
7718
  if (!isInReview) {
7720
7719
  return jsx("th", {
7721
7720
  children: jsxs("p", {
@@ -7727,7 +7726,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7727
7726
  }
7728
7727
  return jsx(TableTHHeader, {
7729
7728
  children: jsxs("p", {
7730
- children: [`${convertToSentenceCase(index)}`, ((required === null || required === void 0 ? void 0 : required.includes(value)) || ((_a = nestedItems[value]) === null || _a === void 0 ? void 0 : _a.required.length) > 0) && jsxs(RequiredSpan, {
7729
+ children: [`${convertToSentenceCase(index)}`, (required === null || required === void 0 ? void 0 : required.includes(value)) && jsxs(RequiredSpan, {
7731
7730
  children: [jsx("br", {}), " (required)"]
7732
7731
  })]
7733
7732
  })
@@ -7743,7 +7742,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7743
7742
  const errorRow = errors === null || errors === void 0 ? void 0 : errors.find(error => error.instancePath.includes(`/${props.rowPath.replace(/\./g, '/')}/${i}`));
7744
7743
  return jsxs("tr", {
7745
7744
  children: [Object.keys(properties).map((element, ix) => {
7746
- var _a, _b;
7745
+ var _a;
7747
7746
  const dataObject = properties[element];
7748
7747
  const schemaName = element;
7749
7748
  const currentData = data && data[num] ? data[num][element] : '';
@@ -7763,7 +7762,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7763
7762
  children: renderCellColumn({
7764
7763
  currentData,
7765
7764
  error: error === null || error === void 0 ? void 0 : error.message,
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,
7765
+ isRequired: required === null || required === void 0 ? void 0 : required.includes(tableKeys[element]),
7767
7766
  errors: errors !== undefined ? errors : [],
7768
7767
  count: count !== undefined ? count : -1,
7769
7768
  element,
@@ -7775,7 +7774,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
7775
7774
  }
7776
7775
  return jsx("td", {
7777
7776
  children: jsx(GoAFormItem, {
7778
- error: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : '',
7777
+ error: (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : '',
7779
7778
  mb: errorRow && !error && '2xl' || 'xs',
7780
7779
  children: dataObject.type === 'number' || dataObject.type === 'string' && !dataObject.enum ? jsx(GoAInput, {
7781
7780
  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.3",
3
+ "version": "2.1.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",