@ukhomeoffice/cop-react-form-renderer 5.85.0 → 5.85.2

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.
@@ -22,7 +22,7 @@ var Answer = function Answer(_ref) {
22
22
  formData = _ref.formData,
23
23
  placeholder = _ref.placeholder;
24
24
  if (!value) {
25
- var placeholderValue = (component === null || component === void 0 ? void 0 : component.cyaPlaceholder) || placeholder;
25
+ var placeholderValue = Object.prototype.hasOwnProperty.call(component || {}, 'cyaPlaceholder') ? component === null || component === void 0 ? void 0 : component.cyaPlaceholder : placeholder;
26
26
  return placeholderValue || /*#__PURE__*/_react.default.createElement(_VisuallyHidden.default, null, "No answer");
27
27
  }
28
28
  if (!component) {
@@ -35,7 +35,8 @@ var RenderListView = function RenderListView(_ref) {
35
35
  onFullEdit = _ref.onFullEdit,
36
36
  onDelete = _ref.onDelete,
37
37
  masterPage = _ref.masterPage,
38
- classModifiers = _ref.classModifiers;
38
+ classModifiers = _ref.classModifiers,
39
+ optionalFieldPlaceholder = _ref.optionalFieldPlaceholder;
39
40
  var classes = _copReactComponents.Utils.classBuilder(DEFAULT_CLASS, classModifiers);
40
41
  var listClass = _copReactComponents.Utils.classBuilder(DEFAULT_LIST_CLASS);
41
42
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -95,7 +96,7 @@ var RenderListView = function RenderListView(_ref) {
95
96
  if (!component) {
96
97
  return null;
97
98
  }
98
- return (0, _getSummaryListRowForDetails.default)(childPage, component, listClass, entryData);
99
+ return (0, _getSummaryListRowForDetails.default)(childPage, component, listClass, entryData, optionalFieldPlaceholder);
99
100
  });
100
101
  }
101
102
  return null;
@@ -128,9 +129,11 @@ RenderListView.propTypes = {
128
129
  components: _propTypes.default.arrayOf(_propTypes.default.shape())
129
130
  })).isRequired
130
131
  }).isRequired,
131
- classModifiers: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)])
132
+ classModifiers: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
133
+ optionalFieldPlaceholder: _propTypes.default.string
132
134
  };
133
135
  RenderListView.defaultProps = {
134
- classModifiers: null
136
+ classModifiers: null,
137
+ optionalFieldPlaceholder: null
135
138
  };
136
139
  var _default = exports.default = RenderListView;
@@ -47,7 +47,7 @@ var DEFAULT_DUPLICATE_BUTTON_LABEL = exports.DEFAULT_DUPLICATE_BUTTON_LABEL = 'D
47
47
  var DEFAULT_DETAILS_TITLE = exports.DEFAULT_DETAILS_TITLE = 'Full details';
48
48
  var DEFAULT_CHANGE_BUTTON_CLASS = exports.DEFAULT_CHANGE_BUTTON_CLASS = 'secondary';
49
49
  var SummaryCard = function SummaryCard(_ref) {
50
- var _config$changeAction2, _config$changeAction3, _config$changeAction4, _config$deleteAction, _config$deleteAction2, _config$duplicateActi, _config$duplicateActi2, _config$fullDetails;
50
+ var _config$changeAction2, _config$changeAction3, _config$changeAction4, _config$deleteAction, _config$deleteAction2, _config$duplicateActi, _config$duplicateActi2, _config$fullDetails2;
51
51
  var id = _ref.id,
52
52
  entryData = _ref.entryData,
53
53
  config = _ref.config,
@@ -148,6 +148,7 @@ var SummaryCard = function SummaryCard(_ref) {
148
148
 
149
149
  // To render summary card in list view as per https://design-system.service.gov.uk/components/summary-list
150
150
  if (config.listView) {
151
+ var _config$fullDetails;
151
152
  return /*#__PURE__*/_react.default.createElement(_RenderListView.default, {
152
153
  id: id,
153
154
  entryData: entryData,
@@ -155,7 +156,8 @@ var SummaryCard = function SummaryCard(_ref) {
155
156
  onFullEdit: onFullEdit,
156
157
  onDelete: onDelete,
157
158
  masterPage: masterPage,
158
- classModifiers: classModifiers
159
+ classModifiers: classModifiers,
160
+ optionalFieldPlaceholder: (_config$fullDetails = config.fullDetails) === null || _config$fullDetails === void 0 ? void 0 : _config$fullDetails.optionalFieldPlaceholder
159
161
  });
160
162
  }
161
163
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -234,7 +236,7 @@ var SummaryCard = function SummaryCard(_ref) {
234
236
  childCollections: childCollections,
235
237
  formData: formData,
236
238
  entryData: entryData,
237
- optionalFieldPlaceholder: ((_config$fullDetails = config.fullDetails) === null || _config$fullDetails === void 0 ? void 0 : _config$fullDetails.optionalFieldPlaceholder) || ''
239
+ optionalFieldPlaceholder: (_config$fullDetails2 = config.fullDetails) === null || _config$fullDetails2 === void 0 ? void 0 : _config$fullDetails2.optionalFieldPlaceholder
238
240
  }))));
239
241
  };
240
242
  SummaryCard.propTypes = {
@@ -168,7 +168,8 @@ var SummaryCardDetails = function SummaryCardDetails(_ref) {
168
168
  childMasterPages: [],
169
169
  formData: _objectSpread(_objectSpread(_objectSpread({}, formData), entryData), entry),
170
170
  entryData: entry,
171
- hideChildSectionTitles: true
171
+ hideChildSectionTitles: true,
172
+ optionalFieldPlaceholder: optionalFieldPlaceholder
172
173
  });
173
174
  }));
174
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "5.85.0",
3
+ "version": "5.85.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",