@ukhomeoffice/cop-react-form-renderer 6.14.12-alpha → 6.14.12-alpha-b

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.
@@ -10,13 +10,14 @@ exports.default = void 0;
10
10
  * @returns The updated target.
11
11
  */
12
12
  const addLabel = (paramTarget, component, data) => {
13
+ var _target$value;
13
14
  const target = paramTarget;
14
15
  // target.value can be an object in which case use value in object attribute
15
- const value = typeof target.value === 'object' ? target.value.value : target.value;
16
+ const value = typeof target.value === 'object' ? (_target$value = target.value) === null || _target$value === void 0 ? void 0 : _target$value.value : target.value;
16
17
  // find the reference data item using the value
17
18
  const item = data.find(e => String(e.id) === value);
18
19
  // if item is null it means that the target.value can be used as a label otherwise use item.label
19
- target.label = item === undefined ? target.value : item.label;
20
+ target.label = item === undefined ? target.value || '' : item.label;
20
21
  target.component = component.cya_label;
21
22
  return target;
22
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "6.14.12-alpha",
3
+ "version": "6.14.12-alpha-b",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",