@instructure/ui-pagination 8.11.2-snapshot.17 → 8.11.2-snapshot.39
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/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/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.11.2-snapshot.
|
|
3
|
+
"version": "8.11.2-snapshot.39+5b3b94d60",
|
|
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.11.2-snapshot.
|
|
28
|
-
"@instructure/ui-test-locator": "8.11.2-snapshot.
|
|
29
|
-
"@instructure/ui-test-queries": "8.11.2-snapshot.
|
|
30
|
-
"@instructure/ui-test-utils": "8.11.2-snapshot.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.11.2-snapshot.39+5b3b94d60",
|
|
28
|
+
"@instructure/ui-test-locator": "8.11.2-snapshot.39+5b3b94d60",
|
|
29
|
+
"@instructure/ui-test-queries": "8.11.2-snapshot.39+5b3b94d60",
|
|
30
|
+
"@instructure/ui-test-utils": "8.11.2-snapshot.39+5b3b94d60"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.11.2-snapshot.
|
|
35
|
-
"@instructure/shared-types": "8.11.2-snapshot.
|
|
36
|
-
"@instructure/ui-a11y-content": "8.11.2-snapshot.
|
|
37
|
-
"@instructure/ui-a11y-utils": "8.11.2-snapshot.
|
|
38
|
-
"@instructure/ui-buttons": "8.11.2-snapshot.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.11.2-snapshot.
|
|
40
|
-
"@instructure/ui-icons": "8.11.2-snapshot.
|
|
41
|
-
"@instructure/ui-portal": "8.11.2-snapshot.
|
|
42
|
-
"@instructure/ui-prop-types": "8.11.2-snapshot.
|
|
43
|
-
"@instructure/ui-react-utils": "8.11.2-snapshot.
|
|
44
|
-
"@instructure/ui-testable": "8.11.2-snapshot.
|
|
45
|
-
"@instructure/ui-tooltip": "8.11.2-snapshot.
|
|
46
|
-
"@instructure/ui-utils": "8.11.2-snapshot.
|
|
47
|
-
"@instructure/ui-view": "8.11.2-snapshot.
|
|
48
|
-
"@instructure/uid": "8.11.2-snapshot.
|
|
34
|
+
"@instructure/emotion": "8.11.2-snapshot.39+5b3b94d60",
|
|
35
|
+
"@instructure/shared-types": "8.11.2-snapshot.39+5b3b94d60",
|
|
36
|
+
"@instructure/ui-a11y-content": "8.11.2-snapshot.39+5b3b94d60",
|
|
37
|
+
"@instructure/ui-a11y-utils": "8.11.2-snapshot.39+5b3b94d60",
|
|
38
|
+
"@instructure/ui-buttons": "8.11.2-snapshot.39+5b3b94d60",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.11.2-snapshot.39+5b3b94d60",
|
|
40
|
+
"@instructure/ui-icons": "8.11.2-snapshot.39+5b3b94d60",
|
|
41
|
+
"@instructure/ui-portal": "8.11.2-snapshot.39+5b3b94d60",
|
|
42
|
+
"@instructure/ui-prop-types": "8.11.2-snapshot.39+5b3b94d60",
|
|
43
|
+
"@instructure/ui-react-utils": "8.11.2-snapshot.39+5b3b94d60",
|
|
44
|
+
"@instructure/ui-testable": "8.11.2-snapshot.39+5b3b94d60",
|
|
45
|
+
"@instructure/ui-tooltip": "8.11.2-snapshot.39+5b3b94d60",
|
|
46
|
+
"@instructure/ui-utils": "8.11.2-snapshot.39+5b3b94d60",
|
|
47
|
+
"@instructure/ui-view": "8.11.2-snapshot.39+5b3b94d60",
|
|
48
|
+
"@instructure/uid": "8.11.2-snapshot.39+5b3b94d60",
|
|
49
49
|
"prop-types": "^15"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"sideEffects": false,
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "5b3b94d60693dc069b6ff4fde8f2ca1a72462ab7"
|
|
59
59
|
}
|
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,MAAM,SAAS,CAAA;AAwB9C;;;;GAIG;AAEH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,C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