@instructure/ui-pagination 10.26.1 → 11.0.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 +23 -2
- package/es/Pagination/PaginationArrowButton/index.js +8 -5
- package/es/Pagination/PaginationArrowButton/props.js +1 -8
- package/es/Pagination/PaginationButton/index.js +10 -6
- package/es/Pagination/PaginationButton/props.js +1 -8
- package/es/Pagination/PaginationPageInput/index.js +6 -6
- package/es/Pagination/PaginationPageInput/props.js +1 -11
- package/es/Pagination/index.js +11 -8
- package/es/Pagination/props.js +1 -32
- package/lib/Pagination/PaginationArrowButton/index.js +8 -4
- package/lib/Pagination/PaginationArrowButton/props.js +1 -9
- package/lib/Pagination/PaginationButton/index.js +11 -5
- package/lib/Pagination/PaginationButton/props.js +1 -9
- package/lib/Pagination/PaginationPageInput/index.js +5 -5
- package/lib/Pagination/PaginationPageInput/props.js +1 -12
- package/lib/Pagination/index.js +10 -6
- package/lib/Pagination/props.js +1 -33
- package/package.json +20 -23
- package/src/Pagination/PaginationArrowButton/index.tsx +2 -4
- package/src/Pagination/PaginationArrowButton/props.ts +1 -12
- package/src/Pagination/PaginationButton/index.tsx +2 -4
- package/src/Pagination/PaginationButton/props.ts +2 -12
- package/src/Pagination/PaginationPageInput/index.tsx +6 -5
- package/src/Pagination/PaginationPageInput/props.ts +2 -19
- package/src/Pagination/index.tsx +7 -6
- package/src/Pagination/props.ts +2 -38
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Pagination/PaginationArrowButton/index.d.ts +0 -6
- package/types/Pagination/PaginationArrowButton/index.d.ts.map +1 -1
- package/types/Pagination/PaginationArrowButton/props.d.ts +2 -3
- package/types/Pagination/PaginationArrowButton/props.d.ts.map +1 -1
- package/types/Pagination/PaginationButton/index.d.ts +0 -6
- package/types/Pagination/PaginationButton/index.d.ts.map +1 -1
- package/types/Pagination/PaginationButton/props.d.ts +2 -3
- package/types/Pagination/PaginationButton/props.d.ts.map +1 -1
- package/types/Pagination/PaginationPageInput/index.d.ts +0 -9
- package/types/Pagination/PaginationPageInput/index.d.ts.map +1 -1
- package/types/Pagination/PaginationPageInput/props.d.ts +2 -3
- package/types/Pagination/PaginationPageInput/props.d.ts.map +1 -1
- package/types/Pagination/index.d.ts +0 -28
- package/types/Pagination/index.d.ts.map +1 -1
- package/types/Pagination/props.d.ts +2 -3
- package/types/Pagination/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,30 @@
|
|
|
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
|
-
|
|
6
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
17
|
+
- React 16 and 17 are no longer supported
|
|
18
|
+
- remove `PropTypes` from all packages
|
|
19
|
+
- remove `CodeEditor` component
|
|
20
|
+
- remove `@instui/theme-registry` package
|
|
21
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
+
- `variables` field on theme objects are removed
|
|
26
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
+
`isStacked`, `hover`, and `headers`
|
|
28
|
+
- `Table`'s `caption` prop is now required
|
|
29
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
9
30
|
|
|
10
31
|
|
|
11
32
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["label", "direction", "buttonRef"];
|
|
3
|
-
var _dec, _class, _PaginationArrowButton;
|
|
4
3
|
/*
|
|
5
4
|
* The MIT License (MIT)
|
|
6
5
|
*
|
|
@@ -30,8 +29,7 @@ import { IconButton } from '@instructure/ui-buttons';
|
|
|
30
29
|
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
31
30
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
32
31
|
import { IconArrowOpenStartSolid, IconArrowOpenEndSolid, IconArrowDoubleStartSolid, IconArrowDoubleEndSolid } from '@instructure/ui-icons';
|
|
33
|
-
import {
|
|
34
|
-
import { allowedProps, propTypes } from './props';
|
|
32
|
+
import { allowedProps } from './props';
|
|
35
33
|
|
|
36
34
|
/**
|
|
37
35
|
---
|
|
@@ -40,7 +38,7 @@ id: Pagination.Navigation
|
|
|
40
38
|
---
|
|
41
39
|
**/
|
|
42
40
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
43
|
-
|
|
41
|
+
class PaginationArrowButton extends Component {
|
|
44
42
|
constructor(...args) {
|
|
45
43
|
super(...args);
|
|
46
44
|
this.ref = null;
|
|
@@ -93,10 +91,15 @@ let PaginationArrowButton = (_dec = testable(), _dec(_class = (_PaginationArrowB
|
|
|
93
91
|
rel: props.href || props.to ? direction : void 0,
|
|
94
92
|
elementRef: buttonRef,
|
|
95
93
|
margin: this.margin,
|
|
94
|
+
"data-cid": "PaginationArrowButton",
|
|
96
95
|
children: this.Icon
|
|
97
96
|
})
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
|
-
}
|
|
99
|
+
}
|
|
100
|
+
PaginationArrowButton.displayName = "PaginationArrowButton";
|
|
101
|
+
PaginationArrowButton.componentId = 'Pagination.Navigation';
|
|
102
|
+
PaginationArrowButton.allowedProps = allowedProps;
|
|
103
|
+
PaginationArrowButton.defaultProps = {};
|
|
101
104
|
export default PaginationArrowButton;
|
|
102
105
|
export { PaginationArrowButton };
|
|
@@ -22,16 +22,9 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
direction: PropTypes.oneOf(['first', 'prev', 'next', 'last']),
|
|
28
|
-
label: PropTypes.string.isRequired,
|
|
29
|
-
buttonRef: PropTypes.func,
|
|
30
|
-
onClick: PropTypes.func
|
|
31
|
-
};
|
|
32
25
|
const allowedProps = ['direction', 'label', 'buttonRef'
|
|
33
26
|
|
|
34
27
|
// we don't want to pass onClick
|
|
35
28
|
// 'onClick'
|
|
36
29
|
];
|
|
37
|
-
export {
|
|
30
|
+
export { allowedProps };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _dec, _class, _PaginationButton;
|
|
2
1
|
/*
|
|
3
2
|
* The MIT License (MIT)
|
|
4
3
|
*
|
|
@@ -26,8 +25,7 @@ var _dec, _class, _PaginationButton;
|
|
|
26
25
|
import { Component } from 'react';
|
|
27
26
|
import { BaseButton } from '@instructure/ui-buttons';
|
|
28
27
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
29
|
-
import {
|
|
30
|
-
import { propTypes, allowedProps } from './props';
|
|
28
|
+
import { allowedProps } from './props';
|
|
31
29
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
32
30
|
/**
|
|
33
31
|
---
|
|
@@ -35,7 +33,8 @@ parent: Pagination
|
|
|
35
33
|
id: Pagination.Page
|
|
36
34
|
---
|
|
37
35
|
**/
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
class PaginationButton extends Component {
|
|
39
38
|
constructor(...args) {
|
|
40
39
|
super(...args);
|
|
41
40
|
this.ref = null;
|
|
@@ -54,6 +53,7 @@ let PaginationButton = (_dec = testable(), _dec(_class = (_PaginationButton = cl
|
|
|
54
53
|
},
|
|
55
54
|
children: _jsx(BaseButton, {
|
|
56
55
|
color: "primary",
|
|
56
|
+
"data-cid": "PaginationButton",
|
|
57
57
|
withBackground: this.props.current,
|
|
58
58
|
withBorder: this.props.current,
|
|
59
59
|
...props,
|
|
@@ -66,8 +66,12 @@ let PaginationButton = (_dec = testable(), _dec(_class = (_PaginationButton = cl
|
|
|
66
66
|
})
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
|
+
PaginationButton.displayName = "PaginationButton";
|
|
71
|
+
PaginationButton.componentId = 'Pagination.Page';
|
|
72
|
+
PaginationButton.allowedProps = allowedProps;
|
|
73
|
+
PaginationButton.defaultProps = {
|
|
70
74
|
current: false
|
|
71
|
-
}
|
|
75
|
+
};
|
|
72
76
|
export default PaginationButton;
|
|
73
77
|
export { PaginationButton };
|
|
@@ -22,15 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
children: PropTypes.node.isRequired,
|
|
28
|
-
current: PropTypes.bool,
|
|
29
|
-
onClick: PropTypes.func,
|
|
30
|
-
screenReaderLabel: PropTypes.string
|
|
31
|
-
};
|
|
32
25
|
const allowedProps = ['children', 'current', 'screenReaderLabel'
|
|
33
26
|
// we don't want to pass onClick
|
|
34
27
|
// 'onClick'
|
|
35
28
|
];
|
|
36
|
-
export {
|
|
29
|
+
export { allowedProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _PaginationPageInput;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -24,13 +24,12 @@ var _dec, _dec2, _class, _PaginationPageInput;
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
|
-
import { testable } from '@instructure/ui-testable';
|
|
28
27
|
import { withStyle } from '@instructure/emotion';
|
|
29
28
|
import { NumberInput } from '@instructure/ui-number-input';
|
|
30
29
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
31
30
|
import generateStyle from './styles';
|
|
32
31
|
import generateComponentTheme from './theme';
|
|
33
|
-
import {
|
|
32
|
+
import { allowedProps } from './props';
|
|
34
33
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
35
34
|
/**
|
|
36
35
|
---
|
|
@@ -38,7 +37,7 @@ parent: Pagination
|
|
|
38
37
|
id: Pagination.PageInput
|
|
39
38
|
---
|
|
40
39
|
**/
|
|
41
|
-
let PaginationPageInput = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
40
|
+
let PaginationPageInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_PaginationPageInput = class PaginationPageInput extends Component {
|
|
42
41
|
constructor(props) {
|
|
43
42
|
super(props);
|
|
44
43
|
this.ref = null;
|
|
@@ -160,6 +159,7 @@ let PaginationPageInput = (_dec = withStyle(generateStyle, generateComponentThem
|
|
|
160
159
|
return _jsxs("span", {
|
|
161
160
|
css: styles === null || styles === void 0 ? void 0 : styles.paginationPageInput,
|
|
162
161
|
ref: this.handleRef,
|
|
162
|
+
"data-cid": "PaginationPageInput",
|
|
163
163
|
children: [_jsx("span", {
|
|
164
164
|
css: styles === null || styles === void 0 ? void 0 : styles.numberInput,
|
|
165
165
|
children: _jsx(NumberInput, {
|
|
@@ -179,8 +179,8 @@ let PaginationPageInput = (_dec = withStyle(generateStyle, generateComponentThem
|
|
|
179
179
|
}), this.renderLabel()]
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
}, _PaginationPageInput.displayName = "PaginationPageInput", _PaginationPageInput.componentId = 'Pagination.PageInput', _PaginationPageInput.
|
|
182
|
+
}, _PaginationPageInput.displayName = "PaginationPageInput", _PaginationPageInput.componentId = 'Pagination.PageInput', _PaginationPageInput.allowedProps = allowedProps, _PaginationPageInput.defaultProps = {
|
|
183
183
|
disabled: false
|
|
184
|
-
}, _PaginationPageInput)) || _class)
|
|
184
|
+
}, _PaginationPageInput)) || _class);
|
|
185
185
|
export default PaginationPageInput;
|
|
186
186
|
export { PaginationPageInput };
|
|
@@ -22,15 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
numberOfPages: PropTypes.number.isRequired,
|
|
28
|
-
currentPageIndex: PropTypes.number.isRequired,
|
|
29
|
-
onChange: PropTypes.func.isRequired,
|
|
30
|
-
screenReaderLabel: PropTypes.func.isRequired,
|
|
31
|
-
label: PropTypes.func,
|
|
32
|
-
disabled: PropTypes.bool,
|
|
33
|
-
inputRef: PropTypes.func
|
|
34
|
-
};
|
|
35
25
|
const allowedProps = ['numberOfPages', 'currentPageIndex', 'onChange', 'screenReaderLabel', 'label', 'disabled', 'inputRef'];
|
|
36
|
-
export {
|
|
26
|
+
export { allowedProps };
|
package/es/Pagination/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2,
|
|
1
|
+
var _dec, _dec2, _class, _Pagination;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -22,10 +22,8 @@ var _dec, _dec2, _dec3, _class, _Pagination;
|
|
|
22
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
25
|
import { cloneElement, Children, Component } from 'react';
|
|
27
26
|
import { View } from '@instructure/ui-view';
|
|
28
|
-
import { testable } from '@instructure/ui-testable';
|
|
29
27
|
import { omitProps, withDeterministicId } from '@instructure/ui-react-utils';
|
|
30
28
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
31
29
|
import { findTabbable, getActiveElement } from '@instructure/ui-dom-utils';
|
|
@@ -35,7 +33,7 @@ import { PaginationArrowButton } from './PaginationArrowButton';
|
|
|
35
33
|
import { PaginationPageInput } from './PaginationPageInput';
|
|
36
34
|
import generateStyle from './styles';
|
|
37
35
|
import generateComponentTheme from './theme';
|
|
38
|
-
import {
|
|
36
|
+
import { allowedProps } from './props';
|
|
39
37
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
40
38
|
/** This is an [].findIndex optimized to work on really big, but sparse, arrays */
|
|
41
39
|
const fastFindIndex = (arr, fn) => Number(Object.keys(arr).find(k => fn(arr[Number(k)])));
|
|
@@ -55,7 +53,7 @@ function propsHaveCompactView(props) {
|
|
|
55
53
|
category: components
|
|
56
54
|
---
|
|
57
55
|
**/
|
|
58
|
-
let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme),
|
|
56
|
+
let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_Pagination = class Pagination extends Component {
|
|
59
57
|
constructor(props) {
|
|
60
58
|
super(props);
|
|
61
59
|
this._labelId = void 0;
|
|
@@ -105,7 +103,11 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
|
|
|
105
103
|
for (let i = from; i <= to; i++) {
|
|
106
104
|
var _this$props$renderPag, _this$props3;
|
|
107
105
|
pages.push(_jsx(Pagination.Page, {
|
|
108
|
-
ref: e =>
|
|
106
|
+
ref: e => {
|
|
107
|
+
if (i === currentPage) {
|
|
108
|
+
this.currentPageRef = e;
|
|
109
|
+
}
|
|
110
|
+
},
|
|
109
111
|
onClick: () => this.handleNavigation(i, currentPage),
|
|
110
112
|
onMouseEnter: () => this.handleOnMouseEnter(i),
|
|
111
113
|
current: i === currentPage,
|
|
@@ -440,6 +442,7 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
|
|
|
440
442
|
margin: this.props.margin,
|
|
441
443
|
css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.pagination,
|
|
442
444
|
"aria-labelledby": this.props.label ? this._labelId : void 0,
|
|
445
|
+
"data-cid": "Pagination",
|
|
443
446
|
children: [this.props.label && this.renderLabel(), _jsxs(View, {
|
|
444
447
|
display: "inline-block",
|
|
445
448
|
css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.pages,
|
|
@@ -447,7 +450,7 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
|
|
|
447
450
|
})]
|
|
448
451
|
});
|
|
449
452
|
}
|
|
450
|
-
}, _Pagination.displayName = "Pagination", _Pagination.componentId = 'Pagination', _Pagination.
|
|
453
|
+
}, _Pagination.displayName = "Pagination", _Pagination.componentId = 'Pagination', _Pagination.allowedProps = allowedProps, _Pagination.defaultProps = {
|
|
451
454
|
disabled: false,
|
|
452
455
|
withFirstAndLastButton: false,
|
|
453
456
|
showDisabledButtons: false,
|
|
@@ -463,6 +466,6 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
|
|
|
463
466
|
ellipsis: '…',
|
|
464
467
|
renderPageIndicator: page => page,
|
|
465
468
|
margin: 'space8'
|
|
466
|
-
}, _Pagination.Page = PaginationButton, _Pagination.Navigation = PaginationArrowButton, _Pagination)) || _class) || _class)
|
|
469
|
+
}, _Pagination.Page = PaginationButton, _Pagination.Navigation = PaginationArrowButton, _Pagination)) || _class) || _class);
|
|
467
470
|
export default Pagination;
|
|
468
471
|
export { Pagination, PaginationButton };
|
package/es/Pagination/props.js
CHANGED
|
@@ -22,36 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Children } from '@instructure/ui-prop-types';
|
|
27
|
-
import { PaginationButton } from './PaginationButton';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
children: Children.oneOf([PaginationButton]),
|
|
30
|
-
disabled: PropTypes.bool,
|
|
31
|
-
withFirstAndLastButton: PropTypes.bool,
|
|
32
|
-
showDisabledButtons: PropTypes.bool,
|
|
33
|
-
label: PropTypes.node,
|
|
34
|
-
labelNext: PropTypes.string,
|
|
35
|
-
labelPrev: PropTypes.string,
|
|
36
|
-
labelFirst: PropTypes.string,
|
|
37
|
-
labelLast: PropTypes.string,
|
|
38
|
-
labelNumberInput: PropTypes.func,
|
|
39
|
-
screenReaderLabelNumberInput: PropTypes.func,
|
|
40
|
-
screenReaderLabelPageButton: PropTypes.func,
|
|
41
|
-
variant: PropTypes.oneOf(['full', 'compact', 'input']),
|
|
42
|
-
margin: PropTypes.string,
|
|
43
|
-
as: PropTypes.elementType,
|
|
44
|
-
elementRef: PropTypes.func,
|
|
45
|
-
inputRef: PropTypes.func,
|
|
46
|
-
shouldHandleFocus: PropTypes.bool,
|
|
47
|
-
totalPageNumber: PropTypes.number,
|
|
48
|
-
currentPage: PropTypes.number,
|
|
49
|
-
siblingCount: PropTypes.number,
|
|
50
|
-
boundaryCount: PropTypes.number,
|
|
51
|
-
onPageChange: PropTypes.func,
|
|
52
|
-
onMouseEnter: PropTypes.func,
|
|
53
|
-
renderPageIndicator: PropTypes.func,
|
|
54
|
-
ellipsis: PropTypes.node
|
|
55
|
-
};
|
|
56
25
|
const allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis', 'onMouseEnter'];
|
|
57
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -14,11 +14,9 @@ var _IconArrowOpenStartSolid = require("@instructure/ui-icons/lib/IconArrowOpenS
|
|
|
14
14
|
var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEndSolid.js");
|
|
15
15
|
var _IconArrowDoubleStartSolid = require("@instructure/ui-icons/lib/IconArrowDoubleStartSolid.js");
|
|
16
16
|
var _IconArrowDoubleEndSolid = require("@instructure/ui-icons/lib/IconArrowDoubleEndSolid.js");
|
|
17
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
18
17
|
var _props = require("./props");
|
|
19
18
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
20
19
|
const _excluded = ["label", "direction", "buttonRef"];
|
|
21
|
-
var _dec, _class, _PaginationArrowButton;
|
|
22
20
|
/*
|
|
23
21
|
* The MIT License (MIT)
|
|
24
22
|
*
|
|
@@ -48,7 +46,7 @@ parent: Pagination
|
|
|
48
46
|
id: Pagination.Navigation
|
|
49
47
|
---
|
|
50
48
|
**/
|
|
51
|
-
|
|
49
|
+
class PaginationArrowButton extends _react.Component {
|
|
52
50
|
constructor(...args) {
|
|
53
51
|
super(...args);
|
|
54
52
|
this.ref = null;
|
|
@@ -101,9 +99,15 @@ let PaginationArrowButton = exports.PaginationArrowButton = (_dec = (0, _testabl
|
|
|
101
99
|
rel: props.href || props.to ? direction : void 0,
|
|
102
100
|
elementRef: buttonRef,
|
|
103
101
|
margin: this.margin,
|
|
102
|
+
"data-cid": "PaginationArrowButton",
|
|
104
103
|
children: this.Icon
|
|
105
104
|
})
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
|
-
}
|
|
107
|
+
}
|
|
108
|
+
exports.PaginationArrowButton = PaginationArrowButton;
|
|
109
|
+
PaginationArrowButton.displayName = "PaginationArrowButton";
|
|
110
|
+
PaginationArrowButton.componentId = 'Pagination.Navigation';
|
|
111
|
+
PaginationArrowButton.allowedProps = _props.allowedProps;
|
|
112
|
+
PaginationArrowButton.defaultProps = {};
|
|
109
113
|
var _default = exports.default = PaginationArrowButton;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,12 +28,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
direction: _propTypes.default.oneOf(['first', 'prev', 'next', 'last']),
|
|
35
|
-
label: _propTypes.default.string.isRequired,
|
|
36
|
-
buttonRef: _propTypes.default.func,
|
|
37
|
-
onClick: _propTypes.default.func
|
|
38
|
-
};
|
|
39
31
|
const allowedProps = exports.allowedProps = ['direction', 'label', 'buttonRef'
|
|
40
32
|
|
|
41
33
|
// we don't want to pass onClick
|
|
@@ -7,10 +7,8 @@ exports.default = exports.PaginationButton = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _BaseButton = require("@instructure/ui-buttons/lib/BaseButton");
|
|
9
9
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
10
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
11
10
|
var _props = require("./props");
|
|
12
11
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
13
|
-
var _dec, _class, _PaginationButton;
|
|
14
12
|
/*
|
|
15
13
|
* The MIT License (MIT)
|
|
16
14
|
*
|
|
@@ -34,13 +32,15 @@ var _dec, _class, _PaginationButton;
|
|
|
34
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
33
|
* SOFTWARE.
|
|
36
34
|
*/
|
|
35
|
+
|
|
37
36
|
/**
|
|
38
37
|
---
|
|
39
38
|
parent: Pagination
|
|
40
39
|
id: Pagination.Page
|
|
41
40
|
---
|
|
42
41
|
**/
|
|
43
|
-
|
|
42
|
+
|
|
43
|
+
class PaginationButton extends _react.Component {
|
|
44
44
|
constructor(...args) {
|
|
45
45
|
super(...args);
|
|
46
46
|
this.ref = null;
|
|
@@ -59,6 +59,7 @@ let PaginationButton = exports.PaginationButton = (_dec = (0, _testable.testable
|
|
|
59
59
|
},
|
|
60
60
|
children: (0, _jsxRuntime.jsx)(_BaseButton.BaseButton, {
|
|
61
61
|
color: "primary",
|
|
62
|
+
"data-cid": "PaginationButton",
|
|
62
63
|
withBackground: this.props.current,
|
|
63
64
|
withBorder: this.props.current,
|
|
64
65
|
...props,
|
|
@@ -71,7 +72,12 @@ let PaginationButton = exports.PaginationButton = (_dec = (0, _testable.testable
|
|
|
71
72
|
})
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
}
|
|
75
|
+
}
|
|
76
|
+
exports.PaginationButton = PaginationButton;
|
|
77
|
+
PaginationButton.displayName = "PaginationButton";
|
|
78
|
+
PaginationButton.componentId = 'Pagination.Page';
|
|
79
|
+
PaginationButton.allowedProps = _props.allowedProps;
|
|
80
|
+
PaginationButton.defaultProps = {
|
|
75
81
|
current: false
|
|
76
|
-
}
|
|
82
|
+
};
|
|
77
83
|
var _default = exports.default = PaginationButton;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,12 +28,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
children: _propTypes.default.node.isRequired,
|
|
35
|
-
current: _propTypes.default.bool,
|
|
36
|
-
onClick: _propTypes.default.func,
|
|
37
|
-
screenReaderLabel: _propTypes.default.string
|
|
38
|
-
};
|
|
39
31
|
const allowedProps = exports.allowedProps = ['children', 'current', 'screenReaderLabel'
|
|
40
32
|
// we don't want to pass onClick
|
|
41
33
|
// 'onClick'
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.PaginationPageInput = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
10
9
|
var _emotion = require("@instructure/emotion");
|
|
11
10
|
var _NumberInput = require("@instructure/ui-number-input/lib/NumberInput");
|
|
12
11
|
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
@@ -14,7 +13,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
14
13
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
15
14
|
var _props = require("./props");
|
|
16
15
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
var _dec,
|
|
16
|
+
var _dec, _class, _PaginationPageInput;
|
|
18
17
|
/*
|
|
19
18
|
* The MIT License (MIT)
|
|
20
19
|
*
|
|
@@ -44,7 +43,7 @@ parent: Pagination
|
|
|
44
43
|
id: Pagination.PageInput
|
|
45
44
|
---
|
|
46
45
|
**/
|
|
47
|
-
let PaginationPageInput = exports.PaginationPageInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
46
|
+
let PaginationPageInput = exports.PaginationPageInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_PaginationPageInput = class PaginationPageInput extends _react.Component {
|
|
48
47
|
constructor(props) {
|
|
49
48
|
super(props);
|
|
50
49
|
this.ref = null;
|
|
@@ -166,6 +165,7 @@ let PaginationPageInput = exports.PaginationPageInput = (_dec = (0, _emotion.wit
|
|
|
166
165
|
return (0, _jsxRuntime.jsxs)("span", {
|
|
167
166
|
css: styles === null || styles === void 0 ? void 0 : styles.paginationPageInput,
|
|
168
167
|
ref: this.handleRef,
|
|
168
|
+
"data-cid": "PaginationPageInput",
|
|
169
169
|
children: [(0, _jsxRuntime.jsx)("span", {
|
|
170
170
|
css: styles === null || styles === void 0 ? void 0 : styles.numberInput,
|
|
171
171
|
children: (0, _jsxRuntime.jsx)(_NumberInput.NumberInput, {
|
|
@@ -185,7 +185,7 @@ let PaginationPageInput = exports.PaginationPageInput = (_dec = (0, _emotion.wit
|
|
|
185
185
|
}), this.renderLabel()]
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
}, _PaginationPageInput.displayName = "PaginationPageInput", _PaginationPageInput.componentId = 'Pagination.PageInput', _PaginationPageInput.
|
|
188
|
+
}, _PaginationPageInput.displayName = "PaginationPageInput", _PaginationPageInput.componentId = 'Pagination.PageInput', _PaginationPageInput.allowedProps = _props.allowedProps, _PaginationPageInput.defaultProps = {
|
|
189
189
|
disabled: false
|
|
190
|
-
}, _PaginationPageInput)) || _class)
|
|
190
|
+
}, _PaginationPageInput)) || _class);
|
|
191
191
|
var _default = exports.default = PaginationPageInput;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,13 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
numberOfPages: _propTypes.default.number.isRequired,
|
|
35
|
-
currentPageIndex: _propTypes.default.number.isRequired,
|
|
36
|
-
onChange: _propTypes.default.func.isRequired,
|
|
37
|
-
screenReaderLabel: _propTypes.default.func.isRequired,
|
|
38
|
-
label: _propTypes.default.func,
|
|
39
|
-
disabled: _propTypes.default.bool,
|
|
40
|
-
inputRef: _propTypes.default.func
|
|
41
|
-
};
|
|
42
31
|
const allowedProps = exports.allowedProps = ['numberOfPages', 'currentPageIndex', 'onChange', 'screenReaderLabel', 'label', 'disabled', 'inputRef'];
|
package/lib/Pagination/index.js
CHANGED
|
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "PaginationButton", {
|
|
|
14
14
|
exports.default = void 0;
|
|
15
15
|
var _react = require("react");
|
|
16
16
|
var _View = require("@instructure/ui-view/lib/View");
|
|
17
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
18
17
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
19
18
|
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
20
19
|
var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
|
|
@@ -28,7 +27,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
28
27
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
29
28
|
var _props = require("./props");
|
|
30
29
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
31
|
-
var _dec, _dec2,
|
|
30
|
+
var _dec, _dec2, _class, _Pagination;
|
|
32
31
|
/*
|
|
33
32
|
* The MIT License (MIT)
|
|
34
33
|
*
|
|
@@ -70,7 +69,7 @@ function propsHaveCompactView(props) {
|
|
|
70
69
|
category: components
|
|
71
70
|
---
|
|
72
71
|
**/
|
|
73
|
-
let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
72
|
+
let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_Pagination = class Pagination extends _react.Component {
|
|
74
73
|
constructor(props) {
|
|
75
74
|
super(props);
|
|
76
75
|
this._labelId = void 0;
|
|
@@ -120,7 +119,11 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
|
|
|
120
119
|
for (let i = from; i <= to; i++) {
|
|
121
120
|
var _this$props$renderPag, _this$props3;
|
|
122
121
|
pages.push((0, _jsxRuntime.jsx)(Pagination.Page, {
|
|
123
|
-
ref: e =>
|
|
122
|
+
ref: e => {
|
|
123
|
+
if (i === currentPage) {
|
|
124
|
+
this.currentPageRef = e;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
124
127
|
onClick: () => this.handleNavigation(i, currentPage),
|
|
125
128
|
onMouseEnter: () => this.handleOnMouseEnter(i),
|
|
126
129
|
current: i === currentPage,
|
|
@@ -455,6 +458,7 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
|
|
|
455
458
|
margin: this.props.margin,
|
|
456
459
|
css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.pagination,
|
|
457
460
|
"aria-labelledby": this.props.label ? this._labelId : void 0,
|
|
461
|
+
"data-cid": "Pagination",
|
|
458
462
|
children: [this.props.label && this.renderLabel(), (0, _jsxRuntime.jsxs)(_View.View, {
|
|
459
463
|
display: "inline-block",
|
|
460
464
|
css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.pages,
|
|
@@ -462,7 +466,7 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
|
|
|
462
466
|
})]
|
|
463
467
|
});
|
|
464
468
|
}
|
|
465
|
-
}, _Pagination.displayName = "Pagination", _Pagination.componentId = 'Pagination', _Pagination.
|
|
469
|
+
}, _Pagination.displayName = "Pagination", _Pagination.componentId = 'Pagination', _Pagination.allowedProps = _props.allowedProps, _Pagination.defaultProps = {
|
|
466
470
|
disabled: false,
|
|
467
471
|
withFirstAndLastButton: false,
|
|
468
472
|
showDisabledButtons: false,
|
|
@@ -478,5 +482,5 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
|
|
|
478
482
|
ellipsis: '…',
|
|
479
483
|
renderPageIndicator: page => page,
|
|
480
484
|
margin: 'space8'
|
|
481
|
-
}, _Pagination.Page = _PaginationButton.PaginationButton, _Pagination.Navigation = _PaginationArrowButton.PaginationArrowButton, _Pagination)) || _class) || _class)
|
|
485
|
+
}, _Pagination.Page = _PaginationButton.PaginationButton, _Pagination.Navigation = _PaginationArrowButton.PaginationArrowButton, _Pagination)) || _class) || _class);
|
|
482
486
|
var _default = exports.default = Pagination;
|
package/lib/Pagination/props.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
|
-
var _PaginationButton = require("./PaginationButton");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
11
7
|
/*
|
|
12
8
|
* The MIT License (MIT)
|
|
13
9
|
*
|
|
@@ -32,32 +28,4 @@ var _PaginationButton = require("./PaginationButton");
|
|
|
32
28
|
* SOFTWARE.
|
|
33
29
|
*/
|
|
34
30
|
|
|
35
|
-
const propTypes = exports.propTypes = {
|
|
36
|
-
children: _Children.Children.oneOf([_PaginationButton.PaginationButton]),
|
|
37
|
-
disabled: _propTypes.default.bool,
|
|
38
|
-
withFirstAndLastButton: _propTypes.default.bool,
|
|
39
|
-
showDisabledButtons: _propTypes.default.bool,
|
|
40
|
-
label: _propTypes.default.node,
|
|
41
|
-
labelNext: _propTypes.default.string,
|
|
42
|
-
labelPrev: _propTypes.default.string,
|
|
43
|
-
labelFirst: _propTypes.default.string,
|
|
44
|
-
labelLast: _propTypes.default.string,
|
|
45
|
-
labelNumberInput: _propTypes.default.func,
|
|
46
|
-
screenReaderLabelNumberInput: _propTypes.default.func,
|
|
47
|
-
screenReaderLabelPageButton: _propTypes.default.func,
|
|
48
|
-
variant: _propTypes.default.oneOf(['full', 'compact', 'input']),
|
|
49
|
-
margin: _propTypes.default.string,
|
|
50
|
-
as: _propTypes.default.elementType,
|
|
51
|
-
elementRef: _propTypes.default.func,
|
|
52
|
-
inputRef: _propTypes.default.func,
|
|
53
|
-
shouldHandleFocus: _propTypes.default.bool,
|
|
54
|
-
totalPageNumber: _propTypes.default.number,
|
|
55
|
-
currentPage: _propTypes.default.number,
|
|
56
|
-
siblingCount: _propTypes.default.number,
|
|
57
|
-
boundaryCount: _propTypes.default.number,
|
|
58
|
-
onPageChange: _propTypes.default.func,
|
|
59
|
-
onMouseEnter: _propTypes.default.func,
|
|
60
|
-
renderPageIndicator: _propTypes.default.func,
|
|
61
|
-
ellipsis: _propTypes.default.node
|
|
62
|
-
};
|
|
63
31
|
const allowedProps = exports.allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis', 'onMouseEnter'];
|