@instructure/ui-pagination 8.13.1-snapshot.41 → 8.13.1-snapshot.47

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.
@@ -25,7 +25,7 @@ var _dec, _dec2, _class, _class2, _temp;
25
25
  */
26
26
 
27
27
  /** @jsx jsx */
28
- import { Component } from 'react';
28
+ import React, { Component } from 'react';
29
29
  import { testable } from '@instructure/ui-testable';
30
30
  import { withStyle, jsx } from '@instructure/emotion';
31
31
  import { NumberInput } from '@instructure/ui-number-input';
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+
3
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
6
 
5
7
  Object.defineProperty(exports, "__esModule", {
@@ -7,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
7
9
  });
8
10
  exports.default = exports.PaginationPageInput = void 0;
9
11
 
10
- var _react = require("react");
12
+ var _react = _interopRequireWildcard(require("react"));
11
13
 
12
14
  var _testable = require("@instructure/ui-testable/lib/testable.js");
13
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-pagination",
3
- "version": "8.13.1-snapshot.41+add2332d5",
3
+ "version": "8.13.1-snapshot.47+916492232",
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,29 +24,29 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/ui-babel-preset": "8.13.1-snapshot.41+add2332d5",
28
- "@instructure/ui-test-locator": "8.13.1-snapshot.41+add2332d5",
29
- "@instructure/ui-test-queries": "8.13.1-snapshot.41+add2332d5",
30
- "@instructure/ui-test-utils": "8.13.1-snapshot.41+add2332d5"
27
+ "@instructure/ui-babel-preset": "8.13.1-snapshot.47+916492232",
28
+ "@instructure/ui-test-locator": "8.13.1-snapshot.47+916492232",
29
+ "@instructure/ui-test-queries": "8.13.1-snapshot.47+916492232",
30
+ "@instructure/ui-test-utils": "8.13.1-snapshot.47+916492232"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.13.1-snapshot.41+add2332d5",
35
- "@instructure/shared-types": "8.13.1-snapshot.41+add2332d5",
36
- "@instructure/ui-a11y-content": "8.13.1-snapshot.41+add2332d5",
37
- "@instructure/ui-a11y-utils": "8.13.1-snapshot.41+add2332d5",
38
- "@instructure/ui-buttons": "8.13.1-snapshot.41+add2332d5",
39
- "@instructure/ui-dom-utils": "8.13.1-snapshot.41+add2332d5",
40
- "@instructure/ui-icons": "8.13.1-snapshot.41+add2332d5",
41
- "@instructure/ui-number-input": "8.13.1-snapshot.41+add2332d5",
42
- "@instructure/ui-portal": "8.13.1-snapshot.41+add2332d5",
43
- "@instructure/ui-prop-types": "8.13.1-snapshot.41+add2332d5",
44
- "@instructure/ui-react-utils": "8.13.1-snapshot.41+add2332d5",
45
- "@instructure/ui-testable": "8.13.1-snapshot.41+add2332d5",
46
- "@instructure/ui-tooltip": "8.13.1-snapshot.41+add2332d5",
47
- "@instructure/ui-utils": "8.13.1-snapshot.41+add2332d5",
48
- "@instructure/ui-view": "8.13.1-snapshot.41+add2332d5",
49
- "@instructure/uid": "8.13.1-snapshot.41+add2332d5",
34
+ "@instructure/emotion": "8.13.1-snapshot.47+916492232",
35
+ "@instructure/shared-types": "8.13.1-snapshot.47+916492232",
36
+ "@instructure/ui-a11y-content": "8.13.1-snapshot.47+916492232",
37
+ "@instructure/ui-a11y-utils": "8.13.1-snapshot.47+916492232",
38
+ "@instructure/ui-buttons": "8.13.1-snapshot.47+916492232",
39
+ "@instructure/ui-dom-utils": "8.13.1-snapshot.47+916492232",
40
+ "@instructure/ui-icons": "8.13.1-snapshot.47+916492232",
41
+ "@instructure/ui-number-input": "8.13.1-snapshot.47+916492232",
42
+ "@instructure/ui-portal": "8.13.1-snapshot.47+916492232",
43
+ "@instructure/ui-prop-types": "8.13.1-snapshot.47+916492232",
44
+ "@instructure/ui-react-utils": "8.13.1-snapshot.47+916492232",
45
+ "@instructure/ui-testable": "8.13.1-snapshot.47+916492232",
46
+ "@instructure/ui-tooltip": "8.13.1-snapshot.47+916492232",
47
+ "@instructure/ui-utils": "8.13.1-snapshot.47+916492232",
48
+ "@instructure/ui-view": "8.13.1-snapshot.47+916492232",
49
+ "@instructure/uid": "8.13.1-snapshot.47+916492232",
50
50
  "keycode": "^2",
51
51
  "prop-types": "^15"
52
52
  },
@@ -57,5 +57,5 @@
57
57
  "access": "public"
58
58
  },
59
59
  "sideEffects": false,
60
- "gitHead": "add2332d5dd43d3d931c4a1631748be96f09b49a"
60
+ "gitHead": "91649223270a5799900148665aa0e3e67683634e"
61
61
  }
@@ -22,7 +22,8 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
  /** @jsx jsx */
25
- import { Component } from 'react'
25
+
26
+ import React, { Component } from 'react'
26
27
 
27
28
  import { testable } from '@instructure/ui-testable'
28
29
  import { withStyle, jsx } from '@instructure/emotion'
@@ -117,7 +118,10 @@ class PaginationPageInput extends Component<
117
118
  }
118
119
  }
119
120
 
120
- handleChange = (_event: Event, value: string) => {
121
+ handleChange = (
122
+ _event: React.ChangeEvent<HTMLInputElement>,
123
+ value: string
124
+ ) => {
121
125
  let newValue = value
122
126
 
123
127
  // if the last character was not a number, don't accept it
@@ -131,7 +135,7 @@ class PaginationPageInput extends Component<
131
135
  })
132
136
  }
133
137
 
134
- handleKeyDown(event: KeyboardEvent) {
138
+ handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {
135
139
  const { key } = event
136
140
 
137
141
  if (key.toLowerCase() === 'enter') {
@@ -147,15 +151,15 @@ class PaginationPageInput extends Component<
147
151
  }
148
152
  }
149
153
 
150
- handleDecrement = (event: Event) => {
154
+ handleDecrement = (event: React.UIEvent<HTMLInputElement>) => {
151
155
  this.setNewPage(event, Math.floor(this.currentPage - 1))
152
156
  }
153
157
 
154
- handleIncrement = (event: Event) => {
158
+ handleIncrement = (event: React.UIEvent<HTMLInputElement>) => {
155
159
  this.setNewPage(event, Math.floor(this.currentPage + 1))
156
160
  }
157
161
 
158
- handleBlur = (event: Event) => {
162
+ handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {
159
163
  this.setNewPage(event, Math.round(this.state.number))
160
164
  }
161
165
 
@@ -165,7 +169,10 @@ class PaginationPageInput extends Component<
165
169
  return n
166
170
  }
167
171
 
168
- setNewPage(event: Event, n: number) {
172
+ setNewPage(
173
+ event: React.UIEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement>,
174
+ n: number
175
+ ) {
169
176
  const number = this.getNumberWithinRange(n)
170
177
 
171
178
  this.setState({
@@ -43,7 +43,10 @@ type PaginationPageInputOwnProps = {
43
43
  /**
44
44
  * Fires when a new page index is selected
45
45
  */
46
- onChange: (event: Event, pageIndex: number) => void
46
+ onChange: (
47
+ event: React.SyntheticEvent<HTMLInputElement>,
48
+ pageIndex: number
49
+ ) => void
47
50
  /**
48
51
  * ScreenReaderLabel for number input
49
52
  */
@@ -266,7 +266,10 @@ class Pagination extends Component<PaginationProps> {
266
266
  )
267
267
  }
268
268
 
269
- handleInputChange(event: Event, pageIndex: number) {
269
+ handleInputChange(
270
+ event: React.SyntheticEvent<HTMLInputElement>,
271
+ pageIndex: number
272
+ ) {
270
273
  this.childPages[pageIndex].props.onClick?.(event as any)
271
274
  }
272
275
 
@@ -375,12 +378,8 @@ class Pagination extends Component<PaginationProps> {
375
378
  return null
376
379
  }
377
380
 
378
- const {
379
- pageIndex,
380
- label,
381
- shouldEnableIcon,
382
- handleButtonRef
383
- } = this.getArrowVariant(direction, currentPageIndex, childPages.length)
381
+ const { pageIndex, label, shouldEnableIcon, handleButtonRef } =
382
+ this.getArrowVariant(direction, currentPageIndex, childPages.length)
384
383
 
385
384
  const page = childPages[pageIndex]
386
385