@abgov/jsonforms-components 1.23.0 → 1.23.1

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 +11 -8
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -5382,8 +5382,9 @@ const ObjectArrayToolBar = /*#__PURE__*/React.memo(function TableToolbar({
5382
5382
  rootSchema,
5383
5383
  uischema
5384
5384
  }) {
5385
- var _a, _b;
5385
+ var _a, _b, _c, _d;
5386
5386
  const buttonPosition = ((_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.addButtonPosition) || 'left';
5387
+ const arrayLabel = getLabelText(uischema.scope, label);
5387
5388
  return jsx(Fragment, {
5388
5389
  children: jsx("div", {
5389
5390
  style: {
@@ -5394,7 +5395,8 @@ const ObjectArrayToolBar = /*#__PURE__*/React.memo(function TableToolbar({
5394
5395
  testId: `object-array-toolbar-${label}`,
5395
5396
  "aria-label": translations.addAriaLabel,
5396
5397
  onClick: addItem(path, createDefaultValue(schema, rootSchema)),
5397
- children: ((_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.addButtonText) || 'Add'
5398
+ type: (_c = (_b = uischema.options) === null || _b === void 0 ? void 0 : _b.addButtonType) !== null && _c !== void 0 ? _c : 'primary',
5399
+ children: ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.addButtonText) || capitalizeFirstLetter(`Add ${arrayLabel}`)
5398
5400
  })
5399
5401
  })
5400
5402
  });
@@ -5981,7 +5983,7 @@ const RenderLink = props => {
5981
5983
  };
5982
5984
 
5983
5985
  const HelpContentComponent = _a => {
5984
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
5986
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
5985
5987
  var {
5986
5988
  isParent = true
5987
5989
  } = _a,
@@ -6019,24 +6021,25 @@ const HelpContentComponent = _a => {
6019
6021
  alt: alt
6020
6022
  });
6021
6023
  };
6024
+ const textVariant = !((_c = uischema.options) === null || _c === void 0 ? void 0 : _c.variant) || ((_d = uischema.options) === null || _d === void 0 ? void 0 : _d.variant) !== 'details' && ((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.variant) !== 'link';
6022
6025
  return jsx(Visible, {
6023
6026
  visible: visible,
6024
6027
  children: jsx(HelpContentDiv, {
6025
- "aria-label": (_c = uischema.options) === null || _c === void 0 ? void 0 : _c.ariaLabel,
6028
+ "aria-label": (_f = uischema.options) === null || _f === void 0 ? void 0 : _f.ariaLabel,
6026
6029
  children: jsxs("div", {
6027
6030
  className: marginClass,
6028
- children: [label && !((_d = uischema.options) === null || _d === void 0 ? void 0 : _d.variant) && ((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.variant) !== 'details' && jsxs("div", {
6031
+ children: [label && (!((_g = uischema.options) === null || _g === void 0 ? void 0 : _g.variant) || ((_h = uischema.options) === null || _h === void 0 ? void 0 : _h.variant) === 'link') && jsxs("div", {
6029
6032
  className: labelClass,
6030
6033
  "data-testid": label,
6031
6034
  children: [label, jsx("br", {})]
6032
- }), ((_f = uischema.options) === null || _f === void 0 ? void 0 : _f.variant) && ((_g = uischema.options) === null || _g === void 0 ? void 0 : _g.variant) === 'img' && renderImage(uischema.options), ((_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.link) && link !== '' && RenderLink(uischema === null || uischema === void 0 ? void 0 : uischema.options), (!((_j = uischema.options) === null || _j === void 0 ? void 0 : _j.variant) || ((_k = uischema.options) === null || _k === void 0 ? void 0 : _k.variant) !== 'details') && !link && renderHelp(), ((_l = uischema.options) === null || _l === void 0 ? void 0 : _l.variant) && ((_m = uischema.options) === null || _m === void 0 ? void 0 : _m.variant) === 'details' && jsxs(GoADetails, {
6035
+ }), ((_j = uischema.options) === null || _j === void 0 ? void 0 : _j.variant) && ((_k = uischema.options) === null || _k === void 0 ? void 0 : _k.variant) === 'img' && renderImage(uischema.options), ((_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.variant) && ((_m = uischema.options) === null || _m === void 0 ? void 0 : _m.variant) === 'link' && link && RenderLink(uischema === null || uischema === void 0 ? void 0 : uischema.options), textVariant && renderHelp(), ((_o = uischema.options) === null || _o === void 0 ? void 0 : _o.variant) && ((_p = uischema.options) === null || _p === void 0 ? void 0 : _p.variant) === 'details' && jsxs(GoADetails, {
6033
6036
  heading: label ? label : '',
6034
6037
  mt: "3xs",
6035
6038
  mb: "none",
6036
- children: [renderHelp(), (uischema === null || uischema === void 0 ? void 0 : uischema.elements) && ((_o = uischema === null || uischema === void 0 ? void 0 : uischema.elements) === null || _o === void 0 ? void 0 : _o.length) > 0 && jsx(HelpContents, {
6039
+ children: [renderHelp(), (uischema === null || uischema === void 0 ? void 0 : uischema.elements) && ((_q = uischema === null || uischema === void 0 ? void 0 : uischema.elements) === null || _q === void 0 ? void 0 : _q.length) > 0 && jsx(HelpContents, {
6037
6040
  elements: uischema === null || uischema === void 0 ? void 0 : uischema.elements
6038
6041
  })]
6039
- }), (uischema === null || uischema === void 0 ? void 0 : uischema.elements) && (uischema === null || uischema === void 0 ? void 0 : uischema.elements.length) > 0 && ((_p = uischema.options) === null || _p === void 0 ? void 0 : _p.variant) !== 'details' && jsx(HelpContents, {
6042
+ }), (uischema === null || uischema === void 0 ? void 0 : uischema.elements) && (uischema === null || uischema === void 0 ? void 0 : uischema.elements.length) > 0 && ((_r = uischema.options) === null || _r === void 0 ? void 0 : _r.variant) !== 'details' && jsx(HelpContents, {
6040
6043
  elements: uischema.elements,
6041
6044
  isParent: false
6042
6045
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
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",