@ukhomeoffice/cop-react-form-renderer 4.55.0 → 4.56.0-alpha

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.
@@ -85,6 +85,9 @@ var CheckYourAnswers = function CheckYourAnswers(_ref) {
85
85
  var _useValidation = (0, _hooks.useValidation)(),
86
86
  errors = _useValidation.errors;
87
87
 
88
+ var _useHooks = (0, _hooks.useHooks)(),
89
+ hooks = _useHooks.hooks;
90
+
88
91
  (0, _react.useEffect)(function () {
89
92
  var getRows = function getRows(page, pageIndex) {
90
93
  var rows = _utils.default.CheckYourAnswers.getRows(page, onRowAction);
@@ -130,6 +133,26 @@ var CheckYourAnswers = function CheckYourAnswers(_ref) {
130
133
 
131
134
  groupsList();
132
135
  }, [setListOfGroups, groups]);
136
+ var override = hooks.onGetCYA({
137
+ title: title,
138
+ pages: _pages,
139
+ actions: actions,
140
+ onAction: _onAction,
141
+ onRowAction: onRowAction,
142
+ hidePageTitles: hide_page_titles,
143
+ hideActions: hide_actions,
144
+ hideTitle: hide_title,
145
+ summaryListClassModifiers: summaryListClassModifiers,
146
+ noChangeAction: noChangeAction,
147
+ noGroupAction: noGroupAction,
148
+ groups: groups,
149
+ sections: sections,
150
+ type: type
151
+ });
152
+
153
+ if (override) {
154
+ return override;
155
+ }
133
156
 
134
157
  var isGroup = function isGroup(pageId) {
135
158
  return listOfGroups.includes(pageId);
@@ -40,6 +40,9 @@ var DEFAULT_HOOKS = {
40
40
  onGetComponent: function onGetComponent(config, wrap) {
41
41
  return null;
42
42
  },
43
+ onGetCYA: function onGetCYA(config) {
44
+ return null;
45
+ },
43
46
  onGoingBack: function onGoingBack() {},
44
47
  onPageChange: function onPageChange(pageId) {
45
48
  return pageId;
@@ -67,6 +70,7 @@ var HooksContextProvider = function HooksContextProvider(_ref) {
67
70
  onFormComplete: (overrides === null || overrides === void 0 ? void 0 : overrides.onFormComplete) || DEFAULT_HOOKS.onFormComplete,
68
71
  onFormLoad: (overrides === null || overrides === void 0 ? void 0 : overrides.onFormLoad) || DEFAULT_HOOKS.onFormLoad,
69
72
  onGetComponent: (overrides === null || overrides === void 0 ? void 0 : overrides.onGetComponent) || DEFAULT_HOOKS.onGetComponent,
73
+ onGetCYA: (overrides === null || overrides === void 0 ? void 0 : overrides.onGetCYA) || DEFAULT_HOOKS.onGetCYA,
70
74
  onGoingBack: (overrides === null || overrides === void 0 ? void 0 : overrides.onGoingBack) || DEFAULT_HOOKS.onGoingBack,
71
75
  onPageChange: (overrides === null || overrides === void 0 ? void 0 : overrides.onPageChange) || DEFAULT_HOOKS.onPageChange,
72
76
  onRequest: (overrides === null || overrides === void 0 ? void 0 : overrides.onRequest) || DEFAULT_HOOKS.onRequest,
@@ -14,11 +14,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
14
14
  var getComponentToUse = function getComponentToUse(toUse, formComponents) {
15
15
  var path = toUse.use.split('.');
16
16
  var firstId = path.shift();
17
-
18
- var wrapper = _objectSpread({}, formComponents.find(function (fc) {
17
+ var wrapper = JSON.parse(JSON.stringify(_objectSpread({}, formComponents.find(function (fc) {
19
18
  return fc.id === firstId;
20
- }));
21
-
19
+ }))));
22
20
  var component = wrapper;
23
21
  var parent = wrapper;
24
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "4.55.0",
3
+ "version": "4.56.0-alpha",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",