@ukhomeoffice/cop-react-form-renderer 5.83.2 → 5.83.3

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.
@@ -82,6 +82,7 @@ var SummaryCardDetails = function SummaryCardDetails(_ref) {
82
82
  formData: _objectSpread(_objectSpread({}, childPage.formData), entryData)
83
83
  }), component, entryData[component.id]);
84
84
  rowIndex += 1;
85
+ var collectionHeadingIndex = 0;
85
86
  return /*#__PURE__*/_react.default.createElement("div", {
86
87
  key: fieldId,
87
88
  className: classes('field'),
@@ -93,9 +94,21 @@ var SummaryCardDetails = function SummaryCardDetails(_ref) {
93
94
  var _entryData$component$2;
94
95
  // Put value for current subComponent at the top level
95
96
  var modEntry = _objectSpread(_objectSpread({}, entryData), _defineProperty({}, subComponent.fieldId, (_entryData$component$2 = entryData[component.fieldId]) === null || _entryData$component$2 === void 0 ? void 0 : _entryData$component$2[subComponent.fieldId]));
96
- return (0, _getSummaryListRowForDetails.default)(childPage, _objectSpread(_objectSpread({}, subComponent), {
97
+ var rowContent = (0, _getSummaryListRowForDetails.default)(childPage, _objectSpread(_objectSpread({}, subComponent), {
97
98
  label: subComponent.key
98
99
  }), classes, modEntry);
100
+ // Because collections are flat, we need to identify the subsequent titles (2, 3, 4... etc) in order to apply appropriate spacing
101
+ if (subComponent.type === 'title') {
102
+ collectionHeadingIndex += 1;
103
+ if (collectionHeadingIndex > 1) {
104
+ return /*#__PURE__*/_react.default.createElement("div", {
105
+ style: {
106
+ marginTop: '40px'
107
+ }
108
+ }, rowContent);
109
+ }
110
+ }
111
+ return rowContent;
99
112
  }));
100
113
  }
101
114
  rowIndex += 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "5.83.2",
3
+ "version": "5.83.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",