@instructure/ui-pagination 8.11.2-snapshot.5 → 8.11.2-snapshot.54

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.
@@ -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._root);
112
+ const focusable = findTabbable(this.ref);
111
113
  const focusIndex = prevButtonFocused ? 0 : focusable.length - 1;
112
114
  focusable[focusIndex].focus();
113
115
  }
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -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._root);
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.5+fd40a2f7b",
3
+ "version": "8.11.2-snapshot.54+a6aaef205",
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.5+fd40a2f7b",
28
- "@instructure/ui-test-locator": "8.11.2-snapshot.5+fd40a2f7b",
29
- "@instructure/ui-test-queries": "8.11.2-snapshot.5+fd40a2f7b",
30
- "@instructure/ui-test-utils": "8.11.2-snapshot.5+fd40a2f7b"
27
+ "@instructure/ui-babel-preset": "8.11.2-snapshot.54+a6aaef205",
28
+ "@instructure/ui-test-locator": "8.11.2-snapshot.54+a6aaef205",
29
+ "@instructure/ui-test-queries": "8.11.2-snapshot.54+a6aaef205",
30
+ "@instructure/ui-test-utils": "8.11.2-snapshot.54+a6aaef205"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.11.2-snapshot.5+fd40a2f7b",
35
- "@instructure/shared-types": "8.11.2-snapshot.5+fd40a2f7b",
36
- "@instructure/ui-a11y-content": "8.11.2-snapshot.5+fd40a2f7b",
37
- "@instructure/ui-a11y-utils": "8.11.2-snapshot.5+fd40a2f7b",
38
- "@instructure/ui-buttons": "8.11.2-snapshot.5+fd40a2f7b",
39
- "@instructure/ui-dom-utils": "8.11.2-snapshot.5+fd40a2f7b",
40
- "@instructure/ui-icons": "8.11.2-snapshot.5+fd40a2f7b",
41
- "@instructure/ui-portal": "8.11.2-snapshot.5+fd40a2f7b",
42
- "@instructure/ui-prop-types": "8.11.2-snapshot.5+fd40a2f7b",
43
- "@instructure/ui-react-utils": "8.11.2-snapshot.5+fd40a2f7b",
44
- "@instructure/ui-testable": "8.11.2-snapshot.5+fd40a2f7b",
45
- "@instructure/ui-tooltip": "8.11.2-snapshot.5+fd40a2f7b",
46
- "@instructure/ui-utils": "8.11.2-snapshot.5+fd40a2f7b",
47
- "@instructure/ui-view": "8.11.2-snapshot.5+fd40a2f7b",
48
- "@instructure/uid": "8.11.2-snapshot.5+fd40a2f7b",
34
+ "@instructure/emotion": "8.11.2-snapshot.54+a6aaef205",
35
+ "@instructure/shared-types": "8.11.2-snapshot.54+a6aaef205",
36
+ "@instructure/ui-a11y-content": "8.11.2-snapshot.54+a6aaef205",
37
+ "@instructure/ui-a11y-utils": "8.11.2-snapshot.54+a6aaef205",
38
+ "@instructure/ui-buttons": "8.11.2-snapshot.54+a6aaef205",
39
+ "@instructure/ui-dom-utils": "8.11.2-snapshot.54+a6aaef205",
40
+ "@instructure/ui-icons": "8.11.2-snapshot.54+a6aaef205",
41
+ "@instructure/ui-portal": "8.11.2-snapshot.54+a6aaef205",
42
+ "@instructure/ui-prop-types": "8.11.2-snapshot.54+a6aaef205",
43
+ "@instructure/ui-react-utils": "8.11.2-snapshot.54+a6aaef205",
44
+ "@instructure/ui-testable": "8.11.2-snapshot.54+a6aaef205",
45
+ "@instructure/ui-tooltip": "8.11.2-snapshot.54+a6aaef205",
46
+ "@instructure/ui-utils": "8.11.2-snapshot.54+a6aaef205",
47
+ "@instructure/ui-view": "8.11.2-snapshot.54+a6aaef205",
48
+ "@instructure/uid": "8.11.2-snapshot.54+a6aaef205",
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": "fd40a2f7b84bb29103569d826f4babdd5af84733"
58
+ "gitHead": "a6aaef20508325ae9e5bfbbb29317174edebce9c"
59
59
  }
@@ -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
- // @ts-expect-error ts-migrate(2339) FIXME:
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"],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