@instructure/ui-pagination 8.8.1-snapshot.3 → 8.9.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 +6 -0
- package/es/Pagination/PaginationArrowButton/index.js +3 -8
- package/{src/Pagination/PaginationArrowButton/types.ts → es/Pagination/PaginationArrowButton/props.js} +8 -8
- package/es/Pagination/PaginationButton/index.js +2 -12
- package/{src/Pagination/PaginationButton/types.ts → es/Pagination/PaginationButton/props.js} +13 -3
- package/es/Pagination/index.js +7 -71
- package/es/Pagination/props.js +86 -0
- package/lib/Pagination/PaginationArrowButton/index.js +3 -8
- package/lib/Pagination/PaginationArrowButton/props.js +42 -0
- package/lib/Pagination/PaginationButton/index.js +3 -15
- package/{src/Pagination/types.ts → lib/Pagination/PaginationButton/props.js} +24 -17
- package/lib/Pagination/index.js +7 -72
- package/lib/Pagination/props.js +100 -0
- package/package.json +21 -22
- package/src/Pagination/PaginationArrowButton/index.tsx +4 -8
- package/src/Pagination/PaginationArrowButton/props.ts +51 -0
- package/src/Pagination/PaginationButton/index.tsx +5 -13
- package/src/Pagination/PaginationButton/props.ts +55 -0
- package/src/Pagination/index.tsx +8 -63
- package/src/Pagination/props.ts +118 -0
- package/src/index.ts +3 -3
- package/types/Pagination/PaginationArrowButton/index.d.ts +12 -9
- package/types/Pagination/PaginationArrowButton/index.d.ts.map +1 -1
- package/types/Pagination/PaginationArrowButton/props.d.ts +15 -0
- package/types/Pagination/PaginationArrowButton/props.d.ts.map +1 -0
- package/types/Pagination/PaginationButton/index.d.ts +10 -13
- package/types/Pagination/PaginationButton/index.d.ts.map +1 -1
- package/types/Pagination/PaginationButton/props.d.ts +14 -0
- package/types/Pagination/PaginationButton/props.d.ts.map +1 -0
- package/types/Pagination/index.d.ts +26 -60
- package/types/Pagination/index.d.ts.map +1 -1
- package/types/Pagination/props.d.ts +23 -0
- package/types/Pagination/props.d.ts.map +1 -0
- package/types/index.d.ts +3 -3
- package/LICENSE.md +0 -27
- package/es/Pagination/PaginationArrowButton/types.js +0 -1
- package/es/Pagination/PaginationButton/types.js +0 -1
- package/es/Pagination/types.js +0 -1
- package/lib/Pagination/PaginationArrowButton/types.js +0 -1
- package/lib/Pagination/PaginationButton/types.js +0 -1
- package/lib/Pagination/types.js +0 -1
- package/types/Pagination/PaginationArrowButton/types.d.ts +0 -7
- package/types/Pagination/PaginationArrowButton/types.d.ts.map +0 -1
- package/types/Pagination/PaginationButton/types.d.ts +0 -4
- package/types/Pagination/PaginationButton/types.d.ts.map +0 -1
- package/types/Pagination/types.d.ts +0 -17
- package/types/Pagination/types.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
# [8.9.0](https://github.com/instructure/instructure-ui/compare/v8.8.0...v8.9.0) (2021-09-15)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix shared-types TS errors ([7b83164](https://github.com/instructure/instructure-ui/commit/7b83164f4c5872f3a217e010563f59bf584ae4fc))
|
|
11
|
+
|
|
6
12
|
# [8.8.0](https://github.com/instructure/instructure-ui/compare/v8.7.0...v8.8.0) (2021-08-27)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-pagination
|
|
@@ -27,19 +27,19 @@ var _dec, _class, _class2, _temp;
|
|
|
27
27
|
* SOFTWARE.
|
|
28
28
|
*/
|
|
29
29
|
import React, { Component } from 'react';
|
|
30
|
-
import PropTypes from 'prop-types';
|
|
31
30
|
import { IconButton } from '@instructure/ui-buttons';
|
|
32
31
|
import { PresentationContent } from '@instructure/ui-a11y-content';
|
|
33
32
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
34
33
|
import { IconArrowOpenStartSolid, IconArrowOpenEndSolid } from '@instructure/ui-icons';
|
|
35
34
|
import { testable } from '@instructure/ui-testable';
|
|
36
|
-
|
|
35
|
+
import { allowedProps, propTypes } from './props';
|
|
37
36
|
/**
|
|
38
37
|
---
|
|
39
38
|
parent: Pagination
|
|
40
39
|
id: Pagination.Navigation
|
|
41
40
|
---
|
|
42
41
|
**/
|
|
42
|
+
|
|
43
43
|
let PaginationArrowButton = (_dec = testable(), _dec(_class = (_temp = _class2 = class PaginationArrowButton extends Component {
|
|
44
44
|
render() {
|
|
45
45
|
const _this$props = this.props,
|
|
@@ -62,12 +62,7 @@ let PaginationArrowButton = (_dec = testable(), _dec(_class = (_temp = _class2 =
|
|
|
62
62
|
}), Icon));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
}, _class2.displayName = "PaginationArrowButton", _class2.componentId = 'Pagination.Navigation', _class2.propTypes = {
|
|
66
|
-
direction: PropTypes.oneOf(['next', 'prev']),
|
|
67
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
68
|
-
buttonRef: PropTypes.func
|
|
69
|
-
}, _class2.defaultProps = {
|
|
70
|
-
direction: void 0,
|
|
65
|
+
}, _class2.displayName = "PaginationArrowButton", _class2.componentId = 'Pagination.Navigation', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
|
|
71
66
|
buttonRef: el => {}
|
|
72
67
|
}, _temp)) || _class);
|
|
73
68
|
export default PaginationArrowButton;
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
const propTypes = {
|
|
26
|
+
direction: PropTypes.oneOf(['next', 'prev']),
|
|
27
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
28
|
+
buttonRef: PropTypes.func
|
|
29
|
+
};
|
|
30
|
+
const allowedProps = ['direction', 'label', 'buttonRef'];
|
|
31
|
+
export { propTypes, allowedProps };
|
|
@@ -24,10 +24,10 @@ var _dec, _class, _class2, _temp;
|
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*/
|
|
26
26
|
import React, { Component } from 'react';
|
|
27
|
-
import PropTypes from 'prop-types';
|
|
28
27
|
import { BaseButton } from '@instructure/ui-buttons';
|
|
29
28
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
30
29
|
import { testable } from '@instructure/ui-testable';
|
|
30
|
+
import { propTypes, allowedProps } from './props';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
---
|
|
@@ -48,17 +48,7 @@ let PaginationButton = (_dec = testable(), _dec(_class = (_temp = _class2 = clas
|
|
|
48
48
|
}), this.props.children);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
}, _class2.displayName = "PaginationButton", _class2.componentId = 'Pagination.Page', _class2.propTypes = {
|
|
52
|
-
/**
|
|
53
|
-
* Content to render as page selection
|
|
54
|
-
*/
|
|
55
|
-
children: PropTypes.node.isRequired,
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Whether the page is currently displayed
|
|
59
|
-
*/
|
|
60
|
-
current: PropTypes.bool
|
|
61
|
-
}, _class2.defaultProps = {
|
|
51
|
+
}, _class2.displayName = "PaginationButton", _class2.componentId = 'Pagination.Page', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
62
52
|
current: false
|
|
63
53
|
}, _temp)) || _class);
|
|
64
54
|
export default PaginationButton;
|
package/{src/Pagination/PaginationButton/types.ts → es/Pagination/PaginationButton/props.js}
RENAMED
|
@@ -21,7 +21,17 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
const propTypes = {
|
|
26
|
+
/**
|
|
27
|
+
* Content to render as page selection
|
|
28
|
+
*/
|
|
29
|
+
children: PropTypes.node.isRequired,
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Whether the page is currently displayed
|
|
33
|
+
*/
|
|
34
|
+
current: PropTypes.bool
|
|
35
|
+
};
|
|
36
|
+
const allowedProps = ['children', 'current'];
|
|
37
|
+
export { propTypes, allowedProps };
|
package/es/Pagination/index.js
CHANGED
|
@@ -26,18 +26,17 @@ var _dec, _dec2, _class, _class2, _temp, _span, _span2;
|
|
|
26
26
|
|
|
27
27
|
/** @jsx jsx */
|
|
28
28
|
import React, { Component } from 'react';
|
|
29
|
-
import PropTypes from 'prop-types';
|
|
30
29
|
import { View } from '@instructure/ui-view';
|
|
31
30
|
import { testable } from '@instructure/ui-testable';
|
|
32
31
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
33
32
|
import { uid } from '@instructure/uid';
|
|
34
|
-
import { Children } from '@instructure/ui-prop-types';
|
|
35
33
|
import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
|
|
36
34
|
import { findTabbable, getActiveElement } from '@instructure/ui-dom-utils';
|
|
37
|
-
import { withStyle, jsx
|
|
35
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
38
36
|
import { PaginationButton } from './PaginationButton';
|
|
39
37
|
import { PaginationArrowButton } from './PaginationArrowButton';
|
|
40
38
|
import generateStyle from './styles';
|
|
39
|
+
import { propTypes, allowedProps } from './props';
|
|
41
40
|
|
|
42
41
|
/** This is an [].findIndex optimized to work on really big, but sparse, arrays */
|
|
43
42
|
const fastFindIndex = (arr, fn) => Number(Object.keys(arr).find(k => fn(arr[Number(k)])));
|
|
@@ -185,6 +184,8 @@ let Pagination = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _de
|
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
render() {
|
|
187
|
+
var _this$props$styles, _this$props$styles2;
|
|
188
|
+
|
|
188
189
|
if (!this.props.children) return null;
|
|
189
190
|
const currentPageIndex = fastFindIndex(this.props.children, p => p && p.props && p.props.current);
|
|
190
191
|
const passthroughProps = View.omitViewProps(omitProps(this.props, Pagination.propTypes), Pagination);
|
|
@@ -193,81 +194,16 @@ let Pagination = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _de
|
|
|
193
194
|
as: this.props.as,
|
|
194
195
|
elementRef: this.handleElementRef,
|
|
195
196
|
margin: this.props.margin,
|
|
196
|
-
css: this.props.styles.pagination,
|
|
197
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.pagination,
|
|
197
198
|
"aria-labelledby": this.props.label && this._labelId
|
|
198
199
|
}), this.props.label && this.renderLabel(), jsx(View, {
|
|
199
200
|
display: "inline-block",
|
|
200
|
-
css: this.props.styles.pages
|
|
201
|
+
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.pages
|
|
201
202
|
}, shouldShowPrevButton(this.props, currentPageIndex) && this.renderArrowButton(this.props.labelPrev, -1, currentPageIndex), this.renderPages(currentPageIndex), shouldShowNextButton(this.props, currentPageIndex) && this.renderArrowButton(this.props.labelNext, 1, currentPageIndex)));
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
}, _class2.displayName = "Pagination", _class2.componentId = 'Pagination', _class2.propTypes = {
|
|
205
|
-
// eslint-disable-next-line react/require-default-props
|
|
206
|
-
makeStyles: PropTypes.func,
|
|
207
|
-
// eslint-disable-next-line react/require-default-props
|
|
208
|
-
styles: PropTypes.object,
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* children of type Pagination.Page
|
|
212
|
-
*/
|
|
213
|
-
children: Children.oneOf([PaginationButton]),
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Disables interaction with all pages
|
|
217
|
-
*/
|
|
218
|
-
disabled: PropTypes.bool,
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Visible label for component
|
|
222
|
-
*/
|
|
223
|
-
label: PropTypes.node,
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Accessible label for next button
|
|
227
|
-
*/
|
|
228
|
-
labelNext: PropTypes.string,
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Accessible label for previous button
|
|
232
|
-
*/
|
|
233
|
-
labelPrev: PropTypes.string,
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* The compact variant truncates the page navigation to show only the first,
|
|
237
|
-
* last, and pages immediately surrounding the current page. Fewer than 5 pages,
|
|
238
|
-
* no next/previous arrow buttons will be shown, and all pages will be listed
|
|
239
|
-
*/
|
|
240
|
-
variant: PropTypes.oneOf(['full', 'compact']),
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
244
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
245
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
246
|
-
*/
|
|
247
|
-
margin: ThemeablePropTypes.spacing,
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* the element type to render as
|
|
251
|
-
*/
|
|
252
|
-
as: PropTypes.elementType,
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* provides a reference to the underlying html root element
|
|
256
|
-
*/
|
|
257
|
-
elementRef: PropTypes.func,
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* For accessibility, Pagination sets focus on the first or last Pagination.Pages,
|
|
261
|
-
* respectively, when the Previous or Next arrow buttons are removed from the DOM.
|
|
262
|
-
* Set this property to `false` to prevent this behavior.
|
|
263
|
-
*/
|
|
264
|
-
shouldHandleFocus: PropTypes.bool
|
|
265
|
-
}, _class2.defaultProps = {
|
|
205
|
+
}, _class2.displayName = "Pagination", _class2.componentId = 'Pagination', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
266
206
|
children: null,
|
|
267
|
-
label: void 0,
|
|
268
|
-
labelNext: void 0,
|
|
269
|
-
labelPrev: void 0,
|
|
270
|
-
margin: void 0,
|
|
271
207
|
disabled: false,
|
|
272
208
|
variant: 'full',
|
|
273
209
|
as: 'div',
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { Children } from '@instructure/ui-prop-types';
|
|
26
|
+
import { ThemeablePropTypes } from '@instructure/emotion';
|
|
27
|
+
import { PaginationButton } from './PaginationButton';
|
|
28
|
+
const propTypes = {
|
|
29
|
+
/**
|
|
30
|
+
* children of type Pagination.Page
|
|
31
|
+
*/
|
|
32
|
+
children: Children.oneOf([PaginationButton]),
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Disables interaction with all pages
|
|
36
|
+
*/
|
|
37
|
+
disabled: PropTypes.bool,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Visible label for component
|
|
41
|
+
*/
|
|
42
|
+
label: PropTypes.node,
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Accessible label for next button
|
|
46
|
+
*/
|
|
47
|
+
labelNext: PropTypes.string,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Accessible label for previous button
|
|
51
|
+
*/
|
|
52
|
+
labelPrev: PropTypes.string,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The compact variant truncates the page navigation to show only the first,
|
|
56
|
+
* last, and pages immediately surrounding the current page. Fewer than 5 pages,
|
|
57
|
+
* no next/previous arrow buttons will be shown, and all pages will be listed
|
|
58
|
+
*/
|
|
59
|
+
variant: PropTypes.oneOf(['full', 'compact']),
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
63
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
64
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
65
|
+
*/
|
|
66
|
+
margin: ThemeablePropTypes.spacing,
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* the element type to render as
|
|
70
|
+
*/
|
|
71
|
+
as: PropTypes.elementType,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* provides a reference to the underlying html root element
|
|
75
|
+
*/
|
|
76
|
+
elementRef: PropTypes.func,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* For accessibility, Pagination sets focus on the first or last Pagination.Pages,
|
|
80
|
+
* respectively, when the Previous or Next arrow buttons are removed from the DOM.
|
|
81
|
+
* Set this property to `false` to prevent this behavior.
|
|
82
|
+
*/
|
|
83
|
+
shouldHandleFocus: PropTypes.bool
|
|
84
|
+
};
|
|
85
|
+
const allowedProps = ['children', 'disabled', 'label', 'labelNext', 'labelPrev', 'variant', 'margin', 'as', 'elementRef', 'shouldHandleFocus'];
|
|
86
|
+
export { propTypes, allowedProps };
|
|
@@ -13,8 +13,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
16
|
var _IconButton = require("@instructure/ui-buttons/lib/IconButton");
|
|
19
17
|
|
|
20
18
|
var _PresentationContent = require("@instructure/ui-a11y-content/lib/PresentationContent");
|
|
@@ -27,6 +25,8 @@ var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEnd
|
|
|
27
25
|
|
|
28
26
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
29
27
|
|
|
28
|
+
var _props = require("./props");
|
|
29
|
+
|
|
30
30
|
const _excluded = ["label", "direction", "buttonRef"];
|
|
31
31
|
|
|
32
32
|
var _dec, _class, _class2, _temp;
|
|
@@ -58,12 +58,7 @@ let PaginationArrowButton = (_dec = (0, _testable.testable)(), _dec(_class = (_t
|
|
|
58
58
|
}), Icon));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
}, _class2.displayName = "PaginationArrowButton", _class2.componentId = 'Pagination.Navigation', _class2.propTypes = {
|
|
62
|
-
direction: _propTypes.default.oneOf(['next', 'prev']),
|
|
63
|
-
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired,
|
|
64
|
-
buttonRef: _propTypes.default.func
|
|
65
|
-
}, _class2.defaultProps = {
|
|
66
|
-
direction: void 0,
|
|
61
|
+
}, _class2.displayName = "PaginationArrowButton", _class2.componentId = 'Pagination.Navigation', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
67
62
|
buttonRef: el => {}
|
|
68
63
|
}, _temp)) || _class);
|
|
69
64
|
exports.PaginationArrowButton = PaginationArrowButton;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The MIT License (MIT)
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
* in the Software without restriction, including without limitation the rights
|
|
20
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
* furnished to do so, subject to the following conditions:
|
|
23
|
+
*
|
|
24
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
* copies or substantial portions of the Software.
|
|
26
|
+
*
|
|
27
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
* SOFTWARE.
|
|
34
|
+
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
direction: _propTypes.default.oneOf(['next', 'prev']),
|
|
37
|
+
label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]).isRequired,
|
|
38
|
+
buttonRef: _propTypes.default.func
|
|
39
|
+
};
|
|
40
|
+
exports.propTypes = propTypes;
|
|
41
|
+
const allowedProps = ['direction', 'label', 'buttonRef'];
|
|
42
|
+
exports.allowedProps = allowedProps;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
4
|
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -11,14 +9,14 @@ exports.PaginationButton = exports.default = void 0;
|
|
|
11
9
|
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
11
|
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
12
|
var _BaseButton = require("@instructure/ui-buttons/lib/BaseButton");
|
|
17
13
|
|
|
18
14
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
19
15
|
|
|
20
16
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
21
17
|
|
|
18
|
+
var _props = require("./props");
|
|
19
|
+
|
|
22
20
|
var _dec, _class, _class2, _temp;
|
|
23
21
|
|
|
24
22
|
/**
|
|
@@ -40,17 +38,7 @@ let PaginationButton = (_dec = (0, _testable.testable)(), _dec(_class = (_temp =
|
|
|
40
38
|
}), this.props.children);
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
}, _class2.displayName = "PaginationButton", _class2.componentId = 'Pagination.Page', _class2.propTypes = {
|
|
44
|
-
/**
|
|
45
|
-
* Content to render as page selection
|
|
46
|
-
*/
|
|
47
|
-
children: _propTypes.default.node.isRequired,
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Whether the page is currently displayed
|
|
51
|
-
*/
|
|
52
|
-
current: _propTypes.default.bool
|
|
53
|
-
}, _class2.defaultProps = {
|
|
41
|
+
}, _class2.displayName = "PaginationButton", _class2.componentId = 'Pagination.Page', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
54
42
|
current: false
|
|
55
43
|
}, _temp)) || _class);
|
|
56
44
|
exports.PaginationButton = PaginationButton;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
1
12
|
/*
|
|
2
13
|
* The MIT License (MIT)
|
|
3
14
|
*
|
|
@@ -21,21 +32,17 @@
|
|
|
21
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
33
|
* SOFTWARE.
|
|
23
34
|
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
/**
|
|
37
|
+
* Content to render as page selection
|
|
38
|
+
*/
|
|
39
|
+
children: _propTypes.default.node.isRequired,
|
|
24
40
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
label?: React.ReactNode
|
|
34
|
-
labelNext?: string
|
|
35
|
-
labelPrev?: string
|
|
36
|
-
variant?: 'full' | 'compact'
|
|
37
|
-
margin?: Spacing
|
|
38
|
-
as?: AsElementType
|
|
39
|
-
elementRef?: (...args: any[]) => any
|
|
40
|
-
shouldHandleFocus?: boolean
|
|
41
|
-
}
|
|
41
|
+
/**
|
|
42
|
+
* Whether the page is currently displayed
|
|
43
|
+
*/
|
|
44
|
+
current: _propTypes.default.bool
|
|
45
|
+
};
|
|
46
|
+
exports.propTypes = propTypes;
|
|
47
|
+
const allowedProps = ['children', 'current'];
|
|
48
|
+
exports.allowedProps = allowedProps;
|