@abgov/jsonforms-components 2.6.3 → 2.6.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 +16 -4
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -9871,6 +9871,11 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
9871
9871
  };
9872
9872
  })
9873
9873
  };
9874
+ const hasNoElements = () => {
9875
+ var _a, _b, _c, _d;
9876
+ const hasNoLayoutElements = ((_a = uischema === null || uischema === void 0 ? void 0 : uischema.elements) === null || _a === void 0 ? void 0 : _a.length) === 0 && ((_d = (_c = (_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.detail) === null || _c === void 0 ? void 0 : _c.elements) === null || _d === void 0 ? void 0 : _d.length) === 0;
9877
+ return hasNoLayoutElements;
9878
+ };
9874
9879
  return jsxs(Fragment, {
9875
9880
  children: [
9876
9881
  // eslint-disable-next-line
@@ -9896,7 +9901,7 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
9896
9901
  renderers: renderers,
9897
9902
  cells: cells
9898
9903
  }, `${rowPath}-${index}`);
9899
- }), ((_e = uiSchemaElementsForNotDefined === null || uiSchemaElementsForNotDefined === void 0 ? void 0 : uiSchemaElementsForNotDefined.elements) === null || _e === void 0 ? void 0 : _e.length) > 0 && jsx(JsonFormsDispatch, {
9904
+ }), hasNoElements() && ((_e = uiSchemaElementsForNotDefined === null || uiSchemaElementsForNotDefined === void 0 ? void 0 : uiSchemaElementsForNotDefined.elements) === null || _e === void 0 ? void 0 : _e.length) > 0 && jsx(JsonFormsDispatch, {
9900
9905
  schema: schema,
9901
9906
  uischema: uiSchemaElementsForNotDefined,
9902
9907
  path: rowPath,
@@ -9921,10 +9926,14 @@ const NonEmptyRowComponent = ({
9921
9926
  cells,
9922
9927
  uischema
9923
9928
  }) => {
9929
+ var _a, _b;
9930
+ const isHorizontal = ((_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.detail) === null || _b === void 0 ? void 0 : _b.type) === 'HorizontalLayout';
9924
9931
  return jsx("div", {
9925
- children: enabled ? jsx(GoAGrid, {
9932
+ children: enabled && isHorizontal ? jsx(GoAGrid, {
9926
9933
  minChildWidth: "30ch",
9927
9934
  children: GenerateRows(NonEmptyCell, schema, childPath, enabled, cells, uischema)
9935
+ }) : enabled && !isHorizontal ? jsx(Fragment, {
9936
+ children: GenerateRows(NonEmptyCell, schema, childPath, enabled, cells, uischema)
9928
9937
  }) : null
9929
9938
  }, childPath);
9930
9939
  };
@@ -10702,8 +10711,11 @@ const HelpContentComponent = _ref => {
10702
10711
  };
10703
10712
  const textVariant = !((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.variant) || ((_f = uischema.options) === null || _f === void 0 ? void 0 : _f.variant) !== 'details' && ((_g = uischema.options) === null || _g === void 0 ? void 0 : _g.variant) !== 'hyperlink';
10704
10713
  if (markdown) {
10705
- return MarkdownComponent({
10706
- markdown: getMarkDownData((_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.help)
10714
+ return jsx(Visible, {
10715
+ visible: visible,
10716
+ children: MarkdownComponent({
10717
+ markdown: getMarkDownData((_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.help)
10718
+ })
10707
10719
  });
10708
10720
  }
10709
10721
  return jsx(Visible, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.6.3",
3
+ "version": "2.6.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",