@ukhomeoffice/cop-react-form-renderer 3.23.2 → 3.23.5
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.
- package/dist/components/FormRenderer/helpers/getRelevantPages.js +1 -1
- package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +10 -10
- package/dist/components/SummaryList/RowAction.js +2 -12
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +7 -1
- package/dist/components/SummaryList/helpers/getRowActionAttributes.js +7 -1
- package/package.json +1 -1
|
@@ -12,26 +12,26 @@ describe('components', function () {
|
|
|
12
12
|
describe('helpers', function () {
|
|
13
13
|
describe('getRelevantPages', function () {
|
|
14
14
|
var pages = [{
|
|
15
|
-
|
|
15
|
+
id: 'page1'
|
|
16
16
|
}, {
|
|
17
|
-
|
|
17
|
+
id: 'page2'
|
|
18
18
|
}, {
|
|
19
|
-
|
|
19
|
+
id: 'page3'
|
|
20
20
|
}, {
|
|
21
|
-
|
|
21
|
+
id: 'page4'
|
|
22
22
|
}, {
|
|
23
|
-
|
|
23
|
+
id: 'page5'
|
|
24
24
|
}];
|
|
25
25
|
var taskListPages = [{
|
|
26
|
-
|
|
26
|
+
id: 'taskPage1'
|
|
27
27
|
}, {
|
|
28
|
-
|
|
28
|
+
id: 'taskPage2'
|
|
29
29
|
}, {
|
|
30
|
-
|
|
30
|
+
id: 'taskPage3'
|
|
31
31
|
}, {
|
|
32
|
-
|
|
32
|
+
id: 'taskPage4'
|
|
33
33
|
}, {
|
|
34
|
-
|
|
34
|
+
id: 'taskPage5'
|
|
35
35
|
}];
|
|
36
36
|
it('return all pages from the start of the given list to the current page outside of a task when the page type is partial-cya', function () {
|
|
37
37
|
var formState = {
|
|
@@ -21,8 +21,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
-
|
|
26
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
25
|
|
|
28
26
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -36,8 +34,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
36
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
35
|
|
|
38
36
|
var RowAction = function RowAction(_ref) {
|
|
39
|
-
var row = _ref.row
|
|
40
|
-
onClick = _ref.onClick;
|
|
37
|
+
var row = _ref.row;
|
|
41
38
|
|
|
42
39
|
var _useState = (0, _react.useState)({}),
|
|
43
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -52,14 +49,7 @@ var RowAction = function RowAction(_ref) {
|
|
|
52
49
|
return null;
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_copReactComponents.Link,
|
|
56
|
-
onKeyPress: function onKeyPress(event) {
|
|
57
|
-
if (event.key === 'Enter') {
|
|
58
|
-
row.action.onAction(row);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
tabIndex: "0"
|
|
62
|
-
}), row.action.label, row.action.aria_suffix && /*#__PURE__*/_react.default.createElement(_copReactComponents.VisuallyHidden, null, " ", row.action.aria_suffix));
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_copReactComponents.Link, attrs, row.action.label, row.action.aria_suffix && /*#__PURE__*/_react.default.createElement(_copReactComponents.VisuallyHidden, null, " ", row.action.aria_suffix));
|
|
63
53
|
};
|
|
64
54
|
|
|
65
55
|
RowAction.propTypes = {
|
|
@@ -11,7 +11,13 @@ var getGroupActionAttributes = function getGroupActionAttributes(groupRow) {
|
|
|
11
11
|
return {
|
|
12
12
|
onClick: function onClick() {
|
|
13
13
|
return groupRow.action.onAction(groupRow);
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
onKeyPress: function onKeyPress(event) {
|
|
16
|
+
if (event.key === 'Enter') {
|
|
17
|
+
groupRow.action.onAction(groupRow);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
tabIndex: '0'
|
|
15
21
|
};
|
|
16
22
|
} else if (groupRow.action.page) {
|
|
17
23
|
return {
|
|
@@ -11,7 +11,13 @@ var getRowActionAttributes = function getRowActionAttributes(row) {
|
|
|
11
11
|
return {
|
|
12
12
|
onClick: function onClick() {
|
|
13
13
|
return row.action.onAction(row);
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
onKeyPress: function onKeyPress(event) {
|
|
16
|
+
if (event.key === 'Enter') {
|
|
17
|
+
row.action.onAction(row);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
tabIndex: '0'
|
|
15
21
|
};
|
|
16
22
|
} else if (row.action.page) {
|
|
17
23
|
return {
|