carbon-react 117.7.0 → 118.0.0
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/LICENSE +1 -1
- package/esm/components/link/link.component.js +7 -1
- package/esm/components/pager/__internal__/pager-navigation-link.component.js +2 -2
- package/lib/components/link/link.component.js +7 -1
- package/lib/components/pager/__internal__/pager-navigation-link.component.js +2 -2
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2016
|
|
189
|
+
Copyright 2016-2023 Sage (UK) Ltd
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -81,6 +81,9 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
81
81
|
"aria-label": ariaLabel,
|
|
82
82
|
...ariaProps
|
|
83
83
|
};
|
|
84
|
+
const buttonProps = {
|
|
85
|
+
type: "button"
|
|
86
|
+
};
|
|
84
87
|
|
|
85
88
|
const createLinkBasedOnType = () => {
|
|
86
89
|
let type = "a";
|
|
@@ -89,7 +92,10 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
89
92
|
type = "button";
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
return /*#__PURE__*/React.createElement(type, { ...componentProps,
|
|
95
|
+
return /*#__PURE__*/React.createElement(type, type === "button" ? { ...componentProps,
|
|
96
|
+
...buttonProps,
|
|
97
|
+
placeholderTabIndex
|
|
98
|
+
} : { ...componentProps,
|
|
93
99
|
...(placeholderTabIndex && href === undefined && !onClick && {
|
|
94
100
|
tabIndex: -1
|
|
95
101
|
})
|
|
@@ -49,7 +49,7 @@ const PagerNavigationLink = ({
|
|
|
49
49
|
}
|
|
50
50
|
}, [disabled]);
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const handleOnClick = ev => {
|
|
53
53
|
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
|
54
54
|
onPagination === null || onPagination === void 0 ? void 0 : onPagination(navLinkConfig[type].destination, pageSize, type);
|
|
55
55
|
};
|
|
@@ -64,7 +64,7 @@ const PagerNavigationLink = ({
|
|
|
64
64
|
disabled: disabled(),
|
|
65
65
|
onClick: // Type assertion due to the fact that StyledPagerLink
|
|
66
66
|
// will always return a button element
|
|
67
|
-
|
|
67
|
+
handleOnClick,
|
|
68
68
|
ref: linkRef
|
|
69
69
|
}, text);
|
|
70
70
|
};
|
|
@@ -102,6 +102,9 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
102
102
|
"aria-label": ariaLabel,
|
|
103
103
|
...ariaProps
|
|
104
104
|
};
|
|
105
|
+
const buttonProps = {
|
|
106
|
+
type: "button"
|
|
107
|
+
};
|
|
105
108
|
|
|
106
109
|
const createLinkBasedOnType = () => {
|
|
107
110
|
let type = "a";
|
|
@@ -110,7 +113,10 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
110
113
|
type = "button";
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
return /*#__PURE__*/_react.default.createElement(type, { ...componentProps,
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement(type, type === "button" ? { ...componentProps,
|
|
117
|
+
...buttonProps,
|
|
118
|
+
placeholderTabIndex
|
|
119
|
+
} : { ...componentProps,
|
|
114
120
|
...(placeholderTabIndex && href === undefined && !onClick && {
|
|
115
121
|
tabIndex: -1
|
|
116
122
|
})
|
|
@@ -65,7 +65,7 @@ const PagerNavigationLink = ({
|
|
|
65
65
|
}
|
|
66
66
|
}, [disabled]);
|
|
67
67
|
|
|
68
|
-
const
|
|
68
|
+
const handleOnClick = ev => {
|
|
69
69
|
onClick === null || onClick === void 0 ? void 0 : onClick(ev);
|
|
70
70
|
onPagination === null || onPagination === void 0 ? void 0 : onPagination(navLinkConfig[type].destination, pageSize, type);
|
|
71
71
|
};
|
|
@@ -80,7 +80,7 @@ const PagerNavigationLink = ({
|
|
|
80
80
|
disabled: disabled(),
|
|
81
81
|
onClick: // Type assertion due to the fact that StyledPagerLink
|
|
82
82
|
// will always return a button element
|
|
83
|
-
|
|
83
|
+
handleOnClick,
|
|
84
84
|
ref: linkRef
|
|
85
85
|
}, text);
|
|
86
86
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "118.0.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"fs-extra": "^10.0.0",
|
|
143
143
|
"husky": "^4.3.6",
|
|
144
144
|
"jest": "^27.5.1",
|
|
145
|
-
"jest-canvas-mock": "^2.
|
|
145
|
+
"jest-canvas-mock": "^2.5.0",
|
|
146
146
|
"jest-environment-jsdom": "^27.5.1",
|
|
147
147
|
"jest-fetch-mock": "^3.0.3",
|
|
148
148
|
"jest-styled-components": "^6.3.1",
|