@abgov/jsonforms-components 1.17.1 → 1.18.0

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 +8 -2
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -2948,7 +2948,8 @@ const GoAInputBaseControl = props => {
2948
2948
  label,
2949
2949
  input,
2950
2950
  required,
2951
- errors
2951
+ errors,
2952
+ path
2952
2953
  } = props;
2953
2954
  const InnerComponent = input;
2954
2955
  const labelToUpdate = getLabelText(uischema.scope, label || '');
@@ -2985,6 +2986,7 @@ const GoAInputBaseControl = props => {
2985
2986
  children: jsx(GoAFormItem, {
2986
2987
  requirement: required ? 'required' : undefined,
2987
2988
  error: '',
2989
+ testId: `${path}`,
2988
2990
  label: (props === null || props === void 0 ? void 0 : props.noLabel) === true ? '' : labelToUpdate,
2989
2991
  helpText: typeof ((_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.help) === 'string' ? (_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.help : '',
2990
2992
  children: jsx(InnerComponent, Object.assign({}, modifiedProps))
@@ -3166,12 +3168,15 @@ const MultiLineTextControl = withJsonFormsControlProps(MultiLineTextControlInput
3166
3168
 
3167
3169
  // Used locally for callout presentation
3168
3170
  const callout = props => {
3171
+ var _a;
3169
3172
  const componentProps = Object.assign({
3170
3173
  size: 'medium',
3171
3174
  type: 'emergency',
3172
3175
  message: 'unknown'
3173
3176
  }, props);
3177
+ const testid = (_a = componentProps.message) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, '');
3174
3178
  return jsx(GoACallout, Object.assign({}, componentProps, {
3179
+ "data-testid": testid,
3175
3180
  children: componentProps.message
3176
3181
  }));
3177
3182
  };
@@ -4642,7 +4647,7 @@ fileList, downloadFile) => {
4642
4647
  const asterisk = isRequired ? ' *' : '';
4643
4648
  const values = fieldValues.value;
4644
4649
  return jsxs(React.Fragment, {
4645
- children: [fieldValues.type === 'primitive' && renderValue(`${label}${asterisk}:`, `${index}`, fieldValues.value, fileUploaderElement, downloadFile), fieldValues.type === 'object' && values && values.length > 0 && values.map((v, i) => {
4650
+ children: [fieldValues.type === 'primitive' && renderValue(`${label}${asterisk}: `, `${index}`, fieldValues.value, fileUploaderElement, downloadFile), fieldValues.type === 'object' && values && values.length > 0 && values.map((v, i) => {
4646
4651
  return renderValue(`${v[0]}: `, `${index}:${i}`, v[1]);
4647
4652
  })]
4648
4653
  }, index);
@@ -5856,6 +5861,7 @@ const HelpContentComponent = _a => {
5856
5861
  className: marginClass,
5857
5862
  children: [label && !((_c = uischema.options) === null || _c === void 0 ? void 0 : _c.variant) && ((_d = uischema.options) === null || _d === void 0 ? void 0 : _d.variant) !== 'details' && jsxs("div", {
5858
5863
  className: labelClass,
5864
+ "data-testid": label,
5859
5865
  children: [label, jsx("br", {})]
5860
5866
  }), (!((_e = uischema.options) === null || _e === void 0 ? void 0 : _e.variant) || ((_f = uischema.options) === null || _f === void 0 ? void 0 : _f.variant) !== 'details') && renderHelp(), ((_g = uischema.options) === null || _g === void 0 ? void 0 : _g.variant) && ((_h = uischema.options) === null || _h === void 0 ? void 0 : _h.variant) === 'details' && jsxs(GoADetails, {
5861
5867
  heading: label ? label : '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
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",