@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.
- package/es/Pagination/PaginationPageInput/index.js +1 -1
- package/lib/Pagination/PaginationPageInput/index.js +3 -1
- package/package.json +22 -22
- package/src/Pagination/PaginationPageInput/index.tsx +14 -7
- package/src/Pagination/PaginationPageInput/props.ts +4 -1
- package/src/Pagination/index.tsx +6 -7
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Pagination/PaginationPageInput/index.d.ts +11 -11
- package/types/Pagination/PaginationPageInput/index.d.ts.map +1 -1
- package/types/Pagination/PaginationPageInput/props.d.ts +1 -1
- package/types/Pagination/PaginationPageInput/props.d.ts.map +1 -1
- package/types/Pagination/index.d.ts +1 -1
- package/types/Pagination/index.d.ts.map +1 -1
|
@@ -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.
|
|
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.
|
|
28
|
-
"@instructure/ui-test-locator": "8.13.1-snapshot.
|
|
29
|
-
"@instructure/ui-test-queries": "8.13.1-snapshot.
|
|
30
|
-
"@instructure/ui-test-utils": "8.13.1-snapshot.
|
|
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.
|
|
35
|
-
"@instructure/shared-types": "8.13.1-snapshot.
|
|
36
|
-
"@instructure/ui-a11y-content": "8.13.1-snapshot.
|
|
37
|
-
"@instructure/ui-a11y-utils": "8.13.1-snapshot.
|
|
38
|
-
"@instructure/ui-buttons": "8.13.1-snapshot.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.13.1-snapshot.
|
|
40
|
-
"@instructure/ui-icons": "8.13.1-snapshot.
|
|
41
|
-
"@instructure/ui-number-input": "8.13.1-snapshot.
|
|
42
|
-
"@instructure/ui-portal": "8.13.1-snapshot.
|
|
43
|
-
"@instructure/ui-prop-types": "8.13.1-snapshot.
|
|
44
|
-
"@instructure/ui-react-utils": "8.13.1-snapshot.
|
|
45
|
-
"@instructure/ui-testable": "8.13.1-snapshot.
|
|
46
|
-
"@instructure/ui-tooltip": "8.13.1-snapshot.
|
|
47
|
-
"@instructure/ui-utils": "8.13.1-snapshot.
|
|
48
|
-
"@instructure/ui-view": "8.13.1-snapshot.
|
|
49
|
-
"@instructure/uid": "8.13.1-snapshot.
|
|
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": "
|
|
60
|
+
"gitHead": "91649223270a5799900148665aa0e3e67683634e"
|
|
61
61
|
}
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
/** @jsx jsx */
|
|
25
|
-
|
|
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 = (
|
|
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:
|
|
154
|
+
handleDecrement = (event: React.UIEvent<HTMLInputElement>) => {
|
|
151
155
|
this.setNewPage(event, Math.floor(this.currentPage - 1))
|
|
152
156
|
}
|
|
153
157
|
|
|
154
|
-
handleIncrement = (event:
|
|
158
|
+
handleIncrement = (event: React.UIEvent<HTMLInputElement>) => {
|
|
155
159
|
this.setNewPage(event, Math.floor(this.currentPage + 1))
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
handleBlur = (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(
|
|
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: (
|
|
46
|
+
onChange: (
|
|
47
|
+
event: React.SyntheticEvent<HTMLInputElement>,
|
|
48
|
+
pageIndex: number
|
|
49
|
+
) => void
|
|
47
50
|
/**
|
|
48
51
|
* ScreenReaderLabel for number input
|
|
49
52
|
*/
|
package/src/Pagination/index.tsx
CHANGED
|
@@ -266,7 +266,10 @@ class Pagination extends Component<PaginationProps> {
|
|
|
266
266
|
)
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
handleInputChange(
|
|
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
|
-
|
|
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
|
|