@instructure/ui-pagination 8.11.2-snapshot.7 → 8.12.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/CHANGELOG.md +4 -0
- package/es/Pagination/index.js +5 -3
- package/es/package.json +1 -0
- package/lib/Pagination/index.js +5 -3
- package/package.json +21 -22
- package/src/Pagination/index.tsx +8 -4
- package/types/Pagination/index.d.ts +1 -0
- package/types/Pagination/index.d.ts.map +1 -1
- package/LICENSE.md +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
# [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-pagination
|
|
9
|
+
|
|
6
10
|
## [8.11.1](https://github.com/instructure/instructure-ui/compare/v8.11.0...v8.11.1) (2021-10-19)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @instructure/ui-pagination
|
package/es/Pagination/index.js
CHANGED
|
@@ -70,8 +70,6 @@ let Pagination = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _de
|
|
|
70
70
|
this.ref = el;
|
|
71
71
|
|
|
72
72
|
if (el) {
|
|
73
|
-
this._root = el;
|
|
74
|
-
|
|
75
73
|
if (typeof this.props.elementRef === 'function') {
|
|
76
74
|
this.props.elementRef(el);
|
|
77
75
|
}
|
|
@@ -83,6 +81,10 @@ let Pagination = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _de
|
|
|
83
81
|
this._nextButton = null;
|
|
84
82
|
}
|
|
85
83
|
|
|
84
|
+
get _root() {
|
|
85
|
+
return this.ref;
|
|
86
|
+
}
|
|
87
|
+
|
|
86
88
|
getSnapshotBeforeUpdate() {
|
|
87
89
|
const activeElement = getActiveElement();
|
|
88
90
|
return {
|
|
@@ -107,7 +109,7 @@ let Pagination = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _de
|
|
|
107
109
|
nextButtonFocused = _ref.nextButtonFocused;
|
|
108
110
|
|
|
109
111
|
if (prevButtonFocused || nextButtonFocused) {
|
|
110
|
-
const focusable = findTabbable(this.
|
|
112
|
+
const focusable = findTabbable(this.ref);
|
|
111
113
|
const focusIndex = prevButtonFocused ? 0 : focusable.length - 1;
|
|
112
114
|
focusable[focusIndex].focus();
|
|
113
115
|
}
|
package/es/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
package/lib/Pagination/index.js
CHANGED
|
@@ -75,8 +75,6 @@ let Pagination = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
75
75
|
this.ref = el;
|
|
76
76
|
|
|
77
77
|
if (el) {
|
|
78
|
-
this._root = el;
|
|
79
|
-
|
|
80
78
|
if (typeof this.props.elementRef === 'function') {
|
|
81
79
|
this.props.elementRef(el);
|
|
82
80
|
}
|
|
@@ -88,6 +86,10 @@ let Pagination = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
88
86
|
this._nextButton = null;
|
|
89
87
|
}
|
|
90
88
|
|
|
89
|
+
get _root() {
|
|
90
|
+
return this.ref;
|
|
91
|
+
}
|
|
92
|
+
|
|
91
93
|
getSnapshotBeforeUpdate() {
|
|
92
94
|
const activeElement = (0, _getActiveElement.getActiveElement)();
|
|
93
95
|
return {
|
|
@@ -112,7 +114,7 @@ let Pagination = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
112
114
|
nextButtonFocused = _ref.nextButtonFocused;
|
|
113
115
|
|
|
114
116
|
if (prevButtonFocused || nextButtonFocused) {
|
|
115
|
-
const focusable = (0, _findTabbable.findTabbable)(this.
|
|
117
|
+
const focusable = (0, _findTabbable.findTabbable)(this.ref);
|
|
116
118
|
const focusIndex = prevButtonFocused ? 0 : focusable.length - 1;
|
|
117
119
|
focusable[focusIndex].focus();
|
|
118
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pagination",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.
|
|
28
|
-
"@instructure/ui-test-locator": "8.
|
|
29
|
-
"@instructure/ui-test-queries": "8.
|
|
30
|
-
"@instructure/ui-test-utils": "8.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.12.0",
|
|
28
|
+
"@instructure/ui-test-locator": "8.12.0",
|
|
29
|
+
"@instructure/ui-test-queries": "8.12.0",
|
|
30
|
+
"@instructure/ui-test-utils": "8.12.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.
|
|
35
|
-
"@instructure/shared-types": "8.
|
|
36
|
-
"@instructure/ui-a11y-content": "8.
|
|
37
|
-
"@instructure/ui-a11y-utils": "8.
|
|
38
|
-
"@instructure/ui-buttons": "8.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.
|
|
40
|
-
"@instructure/ui-icons": "8.
|
|
41
|
-
"@instructure/ui-portal": "8.
|
|
42
|
-
"@instructure/ui-prop-types": "8.
|
|
43
|
-
"@instructure/ui-react-utils": "8.
|
|
44
|
-
"@instructure/ui-testable": "8.
|
|
45
|
-
"@instructure/ui-tooltip": "8.
|
|
46
|
-
"@instructure/ui-utils": "8.
|
|
47
|
-
"@instructure/ui-view": "8.
|
|
48
|
-
"@instructure/uid": "8.
|
|
34
|
+
"@instructure/emotion": "8.12.0",
|
|
35
|
+
"@instructure/shared-types": "8.12.0",
|
|
36
|
+
"@instructure/ui-a11y-content": "8.12.0",
|
|
37
|
+
"@instructure/ui-a11y-utils": "8.12.0",
|
|
38
|
+
"@instructure/ui-buttons": "8.12.0",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.12.0",
|
|
40
|
+
"@instructure/ui-icons": "8.12.0",
|
|
41
|
+
"@instructure/ui-portal": "8.12.0",
|
|
42
|
+
"@instructure/ui-prop-types": "8.12.0",
|
|
43
|
+
"@instructure/ui-react-utils": "8.12.0",
|
|
44
|
+
"@instructure/ui-testable": "8.12.0",
|
|
45
|
+
"@instructure/ui-tooltip": "8.12.0",
|
|
46
|
+
"@instructure/ui-utils": "8.12.0",
|
|
47
|
+
"@instructure/ui-view": "8.12.0",
|
|
48
|
+
"@instructure/uid": "8.12.0",
|
|
49
49
|
"prop-types": "^15"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
@@ -54,6 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"sideEffects": false
|
|
58
|
-
"gitHead": "2681e145ad469e1396536d3e9eed75a19995eb8a"
|
|
57
|
+
"sideEffects": false
|
|
59
58
|
}
|
package/src/Pagination/index.tsx
CHANGED
|
@@ -103,6 +103,13 @@ class Pagination extends Component<PaginationProps> {
|
|
|
103
103
|
// @ts-expect-error ts-migrate(2339) FIXME: Property '_nextButton' does not exist on type 'Pag... Remove this comment to see the full error message
|
|
104
104
|
this._nextButton = null
|
|
105
105
|
}
|
|
106
|
+
get _root() {
|
|
107
|
+
console.warn(
|
|
108
|
+
'_root property is deprecated and will be removed in v9, please use ref instead'
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
return this.ref
|
|
112
|
+
}
|
|
106
113
|
|
|
107
114
|
getSnapshotBeforeUpdate() {
|
|
108
115
|
const activeElement = getActiveElement()
|
|
@@ -134,8 +141,7 @@ class Pagination extends Component<PaginationProps> {
|
|
|
134
141
|
const { prevButtonFocused, nextButtonFocused } = snapshot || {}
|
|
135
142
|
|
|
136
143
|
if (prevButtonFocused || nextButtonFocused) {
|
|
137
|
-
|
|
138
|
-
const focusable = findTabbable(this._root)
|
|
144
|
+
const focusable = findTabbable(this.ref)
|
|
139
145
|
const focusIndex = prevButtonFocused ? 0 : focusable.length - 1
|
|
140
146
|
// @ts-expect-error ts-migrate(2554) FIXME:
|
|
141
147
|
focusable[focusIndex].focus()
|
|
@@ -159,8 +165,6 @@ class Pagination extends Component<PaginationProps> {
|
|
|
159
165
|
handleElementRef = (el) => {
|
|
160
166
|
this.ref = el
|
|
161
167
|
if (el) {
|
|
162
|
-
// @ts-expect-error ts-migrate(2339) FIXME: Property '_root' does not exist on type 'Paginatio... Remove this comment to see the full error message
|
|
163
|
-
this._root = el
|
|
164
168
|
if (typeof this.props.elementRef === 'function') {
|
|
165
169
|
this.props.elementRef(el)
|
|
166
170
|
}
|
|
@@ -47,6 +47,7 @@ declare class Pagination extends Component<PaginationProps> {
|
|
|
47
47
|
static Navigation: typeof PaginationArrowButton;
|
|
48
48
|
ref: Element | null;
|
|
49
49
|
constructor(...args: any[]);
|
|
50
|
+
get _root(): Element | null;
|
|
50
51
|
getSnapshotBeforeUpdate(): {
|
|
51
52
|
prevButtonFocused: boolean;
|
|
52
53
|
nextButtonFocused: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pagination/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQxC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAK/D,OAAO,KAAK,EAAE,eAAe,EAAE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KAAA,EAAE,QAAQ,KAAA;IAoBjD,IAAI,WAAW,YAEd;IAGD,8BAA8B,CAAC,QAAQ,KAAA;IASvC,gBAAgB,oBAOf;IAED,WAAW;IAkBX,WAAW,CAAC,gBAAgB,KAAA;IAmD5B,iBAAiB,CAAC,KAAK,KAAA,EAAE,SAAS,KAAA,EAAE,gBAAgB,KAAA;IA4BpD,MAAM;CAoCP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA"}
|
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|