@instructure/ui-pagination 10.24.3-snapshot-11 → 10.24.3-snapshot-13
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/CHANGELOG.md +5 -2
- package/es/Pagination/index.js +6 -0
- package/es/Pagination/props.js +2 -1
- package/lib/Pagination/index.js +6 -0
- package/lib/Pagination/props.js +2 -1
- package/package.json +20 -20
- package/src/Pagination/index.tsx +7 -0
- package/src/Pagination/props.ts +8 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Pagination/index.d.ts +3 -0
- package/types/Pagination/index.d.ts.map +1 -1
- package/types/Pagination/props.d.ts +4 -0
- package/types/Pagination/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [10.24.3-snapshot-
|
|
6
|
+
## [10.24.3-snapshot-13](https://github.com/instructure/instructure-ui/compare/v10.24.2...v10.24.3-snapshot-13) (2025-09-05)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui-pagination:** add onMouseEnter to Pagination ([327fe69](https://github.com/instructure/instructure-ui/commit/327fe69f15ac34e2efe5bb6d0580d8e07bcd6147))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
package/es/Pagination/index.js
CHANGED
|
@@ -107,6 +107,7 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
|
|
|
107
107
|
pages.push(_jsx(Pagination.Page, {
|
|
108
108
|
ref: e => i === currentPage ? this.currentPageRef = e : null,
|
|
109
109
|
onClick: () => this.handleNavigation(i, currentPage),
|
|
110
|
+
onMouseEnter: () => this.handleOnMouseEnter(i),
|
|
110
111
|
current: i === currentPage,
|
|
111
112
|
...(this.props.screenReaderLabelPageButton ? {
|
|
112
113
|
screenReaderLabel: this.props.screenReaderLabelPageButton(i, this.props.totalPageNumber)
|
|
@@ -209,6 +210,11 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
|
|
|
209
210
|
buttonRef: handleButtonRef
|
|
210
211
|
}) : null;
|
|
211
212
|
};
|
|
213
|
+
this.handleOnMouseEnter = page => {
|
|
214
|
+
if (typeof this.props.onMouseEnter === 'function') {
|
|
215
|
+
this.props.onMouseEnter(page);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
212
218
|
this._labelId = props.deterministicId();
|
|
213
219
|
}
|
|
214
220
|
get _root() {
|
package/es/Pagination/props.js
CHANGED
|
@@ -49,8 +49,9 @@ const propTypes = {
|
|
|
49
49
|
siblingCount: PropTypes.number,
|
|
50
50
|
boundaryCount: PropTypes.number,
|
|
51
51
|
onPageChange: PropTypes.func,
|
|
52
|
+
onMouseEnter: PropTypes.func,
|
|
52
53
|
renderPageIndicator: PropTypes.func,
|
|
53
54
|
ellipsis: PropTypes.node
|
|
54
55
|
};
|
|
55
|
-
const allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis'];
|
|
56
|
+
const allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis', 'onMouseEnter'];
|
|
56
57
|
export { propTypes, allowedProps };
|
package/lib/Pagination/index.js
CHANGED
|
@@ -122,6 +122,7 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
|
|
|
122
122
|
pages.push((0, _jsxRuntime.jsx)(Pagination.Page, {
|
|
123
123
|
ref: e => i === currentPage ? this.currentPageRef = e : null,
|
|
124
124
|
onClick: () => this.handleNavigation(i, currentPage),
|
|
125
|
+
onMouseEnter: () => this.handleOnMouseEnter(i),
|
|
125
126
|
current: i === currentPage,
|
|
126
127
|
...(this.props.screenReaderLabelPageButton ? {
|
|
127
128
|
screenReaderLabel: this.props.screenReaderLabelPageButton(i, this.props.totalPageNumber)
|
|
@@ -224,6 +225,11 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
|
|
|
224
225
|
buttonRef: handleButtonRef
|
|
225
226
|
}) : null;
|
|
226
227
|
};
|
|
228
|
+
this.handleOnMouseEnter = page => {
|
|
229
|
+
if (typeof this.props.onMouseEnter === 'function') {
|
|
230
|
+
this.props.onMouseEnter(page);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
227
233
|
this._labelId = props.deterministicId();
|
|
228
234
|
}
|
|
229
235
|
get _root() {
|
package/lib/Pagination/props.js
CHANGED
|
@@ -56,7 +56,8 @@ const propTypes = exports.propTypes = {
|
|
|
56
56
|
siblingCount: _propTypes.default.number,
|
|
57
57
|
boundaryCount: _propTypes.default.number,
|
|
58
58
|
onPageChange: _propTypes.default.func,
|
|
59
|
+
onMouseEnter: _propTypes.default.func,
|
|
59
60
|
renderPageIndicator: _propTypes.default.func,
|
|
60
61
|
ellipsis: _propTypes.default.node
|
|
61
62
|
};
|
|
62
|
-
const allowedProps = exports.allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis'];
|
|
63
|
+
const allowedProps = exports.allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis', 'onMouseEnter'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pagination",
|
|
3
|
-
"version": "10.24.3-snapshot-
|
|
3
|
+
"version": "10.24.3-snapshot-13",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.24.3-snapshot-
|
|
27
|
-
"@instructure/ui-babel-preset": "10.24.3-snapshot-
|
|
26
|
+
"@instructure/ui-axe-check": "10.24.3-snapshot-13",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.24.3-snapshot-13",
|
|
28
28
|
"@testing-library/jest-dom": "^6.6.3",
|
|
29
29
|
"@testing-library/react": "^16.0.1",
|
|
30
30
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -32,23 +32,23 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.27.6",
|
|
35
|
-
"@instructure/emotion": "10.24.3-snapshot-
|
|
36
|
-
"@instructure/shared-types": "10.24.3-snapshot-
|
|
37
|
-
"@instructure/ui-a11y-content": "10.24.3-snapshot-
|
|
38
|
-
"@instructure/ui-a11y-utils": "10.24.3-snapshot-
|
|
39
|
-
"@instructure/ui-buttons": "10.24.3-snapshot-
|
|
40
|
-
"@instructure/ui-dom-utils": "10.24.3-snapshot-
|
|
41
|
-
"@instructure/ui-icons": "10.24.3-snapshot-
|
|
42
|
-
"@instructure/ui-number-input": "10.24.3-snapshot-
|
|
43
|
-
"@instructure/ui-portal": "10.24.3-snapshot-
|
|
44
|
-
"@instructure/ui-prop-types": "10.24.3-snapshot-
|
|
45
|
-
"@instructure/ui-react-utils": "10.24.3-snapshot-
|
|
46
|
-
"@instructure/ui-testable": "10.24.3-snapshot-
|
|
47
|
-
"@instructure/ui-themes": "10.24.3-snapshot-
|
|
48
|
-
"@instructure/ui-tooltip": "10.24.3-snapshot-
|
|
49
|
-
"@instructure/ui-utils": "10.24.3-snapshot-
|
|
50
|
-
"@instructure/ui-view": "10.24.3-snapshot-
|
|
51
|
-
"@instructure/uid": "10.24.3-snapshot-
|
|
35
|
+
"@instructure/emotion": "10.24.3-snapshot-13",
|
|
36
|
+
"@instructure/shared-types": "10.24.3-snapshot-13",
|
|
37
|
+
"@instructure/ui-a11y-content": "10.24.3-snapshot-13",
|
|
38
|
+
"@instructure/ui-a11y-utils": "10.24.3-snapshot-13",
|
|
39
|
+
"@instructure/ui-buttons": "10.24.3-snapshot-13",
|
|
40
|
+
"@instructure/ui-dom-utils": "10.24.3-snapshot-13",
|
|
41
|
+
"@instructure/ui-icons": "10.24.3-snapshot-13",
|
|
42
|
+
"@instructure/ui-number-input": "10.24.3-snapshot-13",
|
|
43
|
+
"@instructure/ui-portal": "10.24.3-snapshot-13",
|
|
44
|
+
"@instructure/ui-prop-types": "10.24.3-snapshot-13",
|
|
45
|
+
"@instructure/ui-react-utils": "10.24.3-snapshot-13",
|
|
46
|
+
"@instructure/ui-testable": "10.24.3-snapshot-13",
|
|
47
|
+
"@instructure/ui-themes": "10.24.3-snapshot-13",
|
|
48
|
+
"@instructure/ui-tooltip": "10.24.3-snapshot-13",
|
|
49
|
+
"@instructure/ui-utils": "10.24.3-snapshot-13",
|
|
50
|
+
"@instructure/ui-view": "10.24.3-snapshot-13",
|
|
51
|
+
"@instructure/uid": "10.24.3-snapshot-13",
|
|
52
52
|
"prop-types": "^15.8.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
package/src/Pagination/index.tsx
CHANGED
|
@@ -331,6 +331,7 @@ class Pagination extends Component<PaginationProps> {
|
|
|
331
331
|
ref={(e) => (i === currentPage ? (this.currentPageRef = e) : null)}
|
|
332
332
|
key={i}
|
|
333
333
|
onClick={() => this.handleNavigation(i, currentPage)}
|
|
334
|
+
onMouseEnter={() => this.handleOnMouseEnter(i)}
|
|
334
335
|
current={i === currentPage}
|
|
335
336
|
{...(this.props.screenReaderLabelPageButton
|
|
336
337
|
? {
|
|
@@ -615,6 +616,12 @@ class Pagination extends Component<PaginationProps> {
|
|
|
615
616
|
) : null
|
|
616
617
|
}
|
|
617
618
|
|
|
619
|
+
handleOnMouseEnter = (page: number) => {
|
|
620
|
+
if (typeof this.props.onMouseEnter === 'function') {
|
|
621
|
+
this.props.onMouseEnter(page)
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
618
625
|
render() {
|
|
619
626
|
const currentPageIndex = fastFindIndex(
|
|
620
627
|
this.childPages,
|
package/src/Pagination/props.ts
CHANGED
|
@@ -182,6 +182,11 @@ type PaginationOwnProps = {
|
|
|
182
182
|
*/
|
|
183
183
|
onPageChange?: (next: number, prev: number) => void
|
|
184
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Called when a page is hovered.
|
|
187
|
+
*/
|
|
188
|
+
onMouseEnter?: (page: number) => void
|
|
189
|
+
|
|
185
190
|
/**
|
|
186
191
|
* Renders the visible pages
|
|
187
192
|
*/
|
|
@@ -234,6 +239,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
234
239
|
siblingCount: PropTypes.number,
|
|
235
240
|
boundaryCount: PropTypes.number,
|
|
236
241
|
onPageChange: PropTypes.func,
|
|
242
|
+
onMouseEnter: PropTypes.func,
|
|
237
243
|
renderPageIndicator: PropTypes.func,
|
|
238
244
|
ellipsis: PropTypes.node
|
|
239
245
|
}
|
|
@@ -263,7 +269,8 @@ const allowedProps: AllowedPropKeys = [
|
|
|
263
269
|
'siblingCount',
|
|
264
270
|
'boundaryCount',
|
|
265
271
|
'renderPageIndicator',
|
|
266
|
-
'ellipsis'
|
|
272
|
+
'ellipsis',
|
|
273
|
+
'onMouseEnter'
|
|
267
274
|
]
|
|
268
275
|
|
|
269
276
|
type PaginationSnapshot = {
|