@elliemae/ds-pagination 2.2.0-alpha.3 → 2.2.0-next.2
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/cjs/Pagination.js +35 -49
- package/cjs/PaginationDataTestID.js +9 -37
- package/cjs/hooks/usePaginationSearch.js +20 -48
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +10 -28
- package/cjs/parts/PageNextButton.js +32 -52
- package/cjs/parts/PagePrevButton.js +31 -51
- package/cjs/parts/PaginationContent.js +77 -91
- package/cjs/parts/Paginator.js +124 -112
- package/cjs/parts/PerPageSelector.js +63 -68
- package/cjs/props.js +34 -63
- package/cjs/styled.js +47 -112
- package/esm/Pagination.js +23 -17
- package/esm/PaginationDataTestID.js +5 -8
- package/esm/hooks/usePaginationSearch.js +13 -16
- package/esm/index.d.js +1 -2
- package/esm/index.js +1 -3
- package/esm/parts/PageNextButton.js +24 -23
- package/esm/parts/PagePrevButton.js +23 -22
- package/esm/parts/PaginationContent.js +68 -62
- package/esm/parts/Paginator.js +110 -76
- package/esm/parts/PerPageSelector.js +49 -32
- package/esm/props.js +29 -34
- package/esm/styled.js +33 -83
- package/package.json +7 -7
- package/cjs/Pagination.js.map +0 -7
- package/cjs/PaginationDataTestID.js.map +0 -7
- package/cjs/hooks/usePaginationSearch.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/parts/PageNextButton.js.map +0 -7
- package/cjs/parts/PagePrevButton.js.map +0 -7
- package/cjs/parts/PaginationContent.js.map +0 -7
- package/cjs/parts/Paginator.js.map +0 -7
- package/cjs/parts/PerPageSelector.js.map +0 -7
- package/cjs/props.js.map +0 -7
- package/cjs/styled.js.map +0 -7
- package/esm/Pagination.js.map +0 -7
- package/esm/PaginationDataTestID.js.map +0 -7
- package/esm/hooks/usePaginationSearch.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/parts/PageNextButton.js.map +0 -7
- package/esm/parts/PagePrevButton.js.map +0 -7
- package/esm/parts/PaginationContent.js.map +0 -7
- package/esm/parts/Paginator.js.map +0 -7
- package/esm/parts/PerPageSelector.js.map +0 -7
- package/esm/props.js.map +0 -7
- package/esm/styled.js.map +0 -7
package/cjs/styled.js
CHANGED
|
@@ -1,113 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Grid = require('@elliemae/ds-grid');
|
|
6
|
+
var dsButton = require('@elliemae/ds-button');
|
|
7
|
+
var styled = require('styled-components');
|
|
8
|
+
var styledComponents = require('@xstyled/styled-components');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
13
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
14
|
+
|
|
15
|
+
const sizeToCss = size => typeof size === 'number' && !Number.isNaN(size) ? "".concat(size, "px") : size;
|
|
16
|
+
|
|
17
|
+
const styledFocusCss = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
21
|
+
return "\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ".concat(theme.colors.brand[700], ";\n pointer-events: none;\n z-index: 7;\n}");
|
|
11
22
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var import_ds_grid = __toESM(require("@elliemae/ds-grid"));
|
|
39
|
-
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
40
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
41
|
-
var import_styled_components2 = __toESM(require("@xstyled/styled-components"));
|
|
42
|
-
const sizeToCss = (size) => typeof size === "number" && !Number.isNaN(size) ? `${size}px` : size;
|
|
43
|
-
const styledFocusCss = ({ theme }) => `
|
|
44
|
-
&:after {
|
|
45
|
-
display: block;
|
|
46
|
-
content: ' ';
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 0;
|
|
49
|
-
left: 0;
|
|
50
|
-
right: 0;
|
|
51
|
-
bottom: 0;
|
|
52
|
-
border: 2px solid ${theme.colors.brand[700]};
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
z-index: 7;
|
|
55
|
-
}`;
|
|
56
|
-
const PaginationContainer = (0, import_styled_components.default)(import_ds_grid.default)`
|
|
57
|
-
padding: 0 ${(props) => props.theme.space.xs};
|
|
58
|
-
height: 42px;
|
|
59
|
-
width: ${(props) => sizeToCss(props.width) || "100%"};
|
|
60
|
-
max-width: 100%;
|
|
61
|
-
align-items: center;
|
|
62
|
-
box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.5);
|
|
63
|
-
`;
|
|
64
|
-
const PaginationWrapper = import_styled_components.default.div`
|
|
65
|
-
display: flex;
|
|
66
|
-
justify-content: center;
|
|
67
|
-
align-items: center;
|
|
68
|
-
margin: 0 32px;
|
|
69
|
-
`;
|
|
70
|
-
const PaginationSeparator = (0, import_styled_components.default)(import_ds_grid.default)`
|
|
71
|
-
background-color: ${(props) => props.theme.colors.neutral[300]};
|
|
72
|
-
width: 1px;
|
|
73
|
-
height: ${(props) => props.height || "30px"};
|
|
74
|
-
`;
|
|
75
|
-
const PaginationBoldText = import_styled_components.default.span`
|
|
76
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
77
|
-
${import_styled_components2.typography}
|
|
78
|
-
${import_styled_components2.space}
|
|
79
|
-
position: relative;
|
|
80
|
-
`;
|
|
81
|
-
const PaginationDropdownButton = (0, import_styled_components.default)(import_ds_button.DSButtonV2)`
|
|
82
|
-
height: 42px;
|
|
83
|
-
display: flex;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
align-items: center;
|
|
86
|
-
position: relative;
|
|
87
|
-
padding-left: 16px;
|
|
88
|
-
padding-right: 16px;
|
|
89
|
-
grid-gap: 8px;
|
|
90
|
-
font-size: 13px;
|
|
91
|
-
color: ${(props) => props.theme.colors.neutral[700]};
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
border-radius: 0;
|
|
94
|
-
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
95
|
-
:focus {
|
|
96
|
-
${styledFocusCss}
|
|
97
|
-
}
|
|
98
|
-
`;
|
|
99
|
-
const PreviousNextPageButton = (0, import_styled_components.default)(import_ds_button.DSButtonV2)`
|
|
100
|
-
height: 42px;
|
|
101
|
-
display: grid;
|
|
102
|
-
place-items: center;
|
|
103
|
-
position: relative;
|
|
104
|
-
padding-left: 8px;
|
|
105
|
-
padding-right: 8px;
|
|
106
|
-
border-radius: 0;
|
|
107
|
-
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
108
|
-
:focus {
|
|
109
|
-
${styledFocusCss}
|
|
110
|
-
}
|
|
111
|
-
`;
|
|
112
|
-
module.exports = __toCommonJS(styled_exports);
|
|
113
|
-
//# sourceMappingURL=styled.js.map
|
|
23
|
+
|
|
24
|
+
const PaginationContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
25
|
+
componentId: "sc-mxz59e-0"
|
|
26
|
+
})(["padding:0 ", ";height:42px;width:", ";max-width:100%;align-items:center;box-shadow:0 -1px 3px 0 rgba(0,0,0,0.5);"], props => props.theme.space.xs, props => sizeToCss(props.width) || '100%');
|
|
27
|
+
const PaginationWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
28
|
+
componentId: "sc-mxz59e-1"
|
|
29
|
+
})(["display:flex;justify-content:center;align-items:center;margin:0 32px;"]);
|
|
30
|
+
const PaginationSeparator = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
31
|
+
componentId: "sc-mxz59e-2"
|
|
32
|
+
})(["background-color:", ";width:1px;height:", ";"], props => props.theme.colors.neutral[300], props => props.height || '30px');
|
|
33
|
+
const PaginationBoldText = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
34
|
+
componentId: "sc-mxz59e-3"
|
|
35
|
+
})(["font-weight:", ";", " ", " position:relative;"], props => props.theme.fontWeights.semibold, styledComponents.typography, styledComponents.space);
|
|
36
|
+
const PaginationDropdownButton = /*#__PURE__*/styled__default["default"](dsButton.DSButtonV2).withConfig({
|
|
37
|
+
componentId: "sc-mxz59e-4"
|
|
38
|
+
})(["height:42px;display:flex;justify-content:center;align-items:center;position:relative;padding-left:16px;padding-right:16px;grid-gap:8px;font-size:13px;color:", ";cursor:pointer;border-radius:0;font-weight:", ";:focus{", "}"], props => props.theme.colors.neutral[700], props => props.theme.fontWeights.regular, styledFocusCss);
|
|
39
|
+
const PreviousNextPageButton = /*#__PURE__*/styled__default["default"](dsButton.DSButtonV2).withConfig({
|
|
40
|
+
componentId: "sc-mxz59e-5"
|
|
41
|
+
})(["height:42px;display:grid;place-items:center;position:relative;padding-left:8px;padding-right:8px;border-radius:0;cursor:", ";:focus{", "}"], props => props.disabled ? 'not-allowed' : 'pointer', styledFocusCss);
|
|
42
|
+
|
|
43
|
+
exports.PaginationBoldText = PaginationBoldText;
|
|
44
|
+
exports.PaginationContainer = PaginationContainer;
|
|
45
|
+
exports.PaginationDropdownButton = PaginationDropdownButton;
|
|
46
|
+
exports.PaginationSeparator = PaginationSeparator;
|
|
47
|
+
exports.PaginationWrapper = PaginationWrapper;
|
|
48
|
+
exports.PreviousNextPageButton = PreviousNextPageButton;
|
package/esm/Pagination.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
9
|
+
import { describe } from 'react-desc';
|
|
10
|
+
import { PaginationContent } from './parts/PaginationContent.js';
|
|
11
|
+
import { propTypes, defaultProps } from './props.js';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
|
|
18
|
+
const DSPagination = props => {
|
|
8
19
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
9
20
|
useValidateTypescriptPropTypes(propsWithDefault, propTypes);
|
|
10
|
-
return
|
|
11
|
-
...propsWithDefault
|
|
12
|
-
});
|
|
21
|
+
return /*#__PURE__*/jsx(PaginationContent, _objectSpread({}, propsWithDefault));
|
|
13
22
|
};
|
|
14
|
-
|
|
15
|
-
const DSPaginationWithSchema = describe(DSPagination).description(
|
|
23
|
+
|
|
24
|
+
const DSPaginationWithSchema = describe(DSPagination).description('DSPagination');
|
|
16
25
|
DSPaginationWithSchema.propTypes = propTypes;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
DSPaginationWithSchema
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=Pagination.js.map
|
|
26
|
+
|
|
27
|
+
export { DSPagination, DSPaginationWithSchema };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
const PAGINATION_DATA_TESTID = {
|
|
3
|
-
PREVIOUS_BUTTON:
|
|
4
|
-
NEXT_BUTTON:
|
|
5
|
-
CONTAINER:
|
|
2
|
+
PREVIOUS_BUTTON: 'data-table-pagination-prev-button',
|
|
3
|
+
NEXT_BUTTON: 'data-table-pagination-next-button',
|
|
4
|
+
CONTAINER: 'data-table-pagination-container'
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=PaginationDataTestID.js.map
|
|
6
|
+
|
|
7
|
+
export { PAGINATION_DATA_TESTID };
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
|
+
|
|
3
4
|
const usePaginationSearch = (pageCount, actionRef) => {
|
|
4
|
-
const [searchValue, setSearchValue] = useState(
|
|
5
|
+
const [searchValue, setSearchValue] = useState('');
|
|
5
6
|
const [shouldResetSearchValue, setShouldResetSearchValue] = useState(true);
|
|
6
7
|
const timeoutRef = useRef(null);
|
|
7
8
|
useEffect(() => {
|
|
8
|
-
if (searchValue !==
|
|
9
|
+
if (searchValue !== '' && Number.parseInt(searchValue, 10) <= pageCount) {
|
|
9
10
|
actionRef.current.setActiveDescendant(searchValue);
|
|
10
11
|
actionRef.current.scrollOptionIntoView(searchValue);
|
|
11
|
-
}
|
|
12
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
+
|
|
12
14
|
}, [searchValue]);
|
|
13
|
-
const onKeyDown = useCallback(
|
|
14
|
-
if (e.code.startsWith(
|
|
15
|
-
if (shouldResetSearchValue)
|
|
16
|
-
setSearchValue(e.key);
|
|
17
|
-
else
|
|
18
|
-
setSearchValue((prevValue) => prevValue + e.key);
|
|
15
|
+
const onKeyDown = useCallback(e => {
|
|
16
|
+
if (e.code.startsWith('Digit')) {
|
|
17
|
+
if (shouldResetSearchValue) setSearchValue(e.key);else setSearchValue(prevValue => prevValue + e.key);
|
|
19
18
|
setShouldResetSearchValue(false);
|
|
20
19
|
clearTimeout(timeoutRef.current);
|
|
21
20
|
timeoutRef.current = setTimeout(() => {
|
|
22
21
|
setShouldResetSearchValue(true);
|
|
23
|
-
},
|
|
22
|
+
}, 1000);
|
|
24
23
|
}
|
|
25
24
|
}, [shouldResetSearchValue]);
|
|
26
25
|
return onKeyDown;
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=usePaginationSearch.js.map
|
|
27
|
+
|
|
28
|
+
export { usePaginationSearch };
|
package/esm/index.d.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
|
package/esm/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ChevronRight } from
|
|
4
|
-
import { PAGINATION_DATA_TESTID } from
|
|
5
|
-
import { PreviousNextPageButton } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { ChevronRight } from '@elliemae/ds-icons';
|
|
4
|
+
import { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';
|
|
5
|
+
import { PreviousNextPageButton } from '../styled.js';
|
|
6
|
+
|
|
7
|
+
const PageNextButton = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
onNextPage,
|
|
10
|
+
canNextPage
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx(PreviousNextPageButton, {
|
|
13
|
+
onClick: () => {
|
|
14
|
+
if (canNextPage) onNextPage();
|
|
15
|
+
},
|
|
16
|
+
disabled: !canNextPage,
|
|
17
|
+
buttonType: "raw",
|
|
18
|
+
"data-testid": PAGINATION_DATA_TESTID.NEXT_BUTTON,
|
|
19
|
+
HeaderComp: () => 'Page'
|
|
20
|
+
}, void 0, /*#__PURE__*/_jsx(ChevronRight, {
|
|
21
|
+
color: canNextPage ? ['brand-primary', '700'] : ['neutral', '500']
|
|
22
|
+
}));
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
export { PageNextButton };
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ChevronLeft } from
|
|
4
|
-
import { PAGINATION_DATA_TESTID } from
|
|
5
|
-
import { PreviousNextPageButton } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { ChevronLeft } from '@elliemae/ds-icons';
|
|
4
|
+
import { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';
|
|
5
|
+
import { PreviousNextPageButton } from '../styled.js';
|
|
6
|
+
|
|
7
|
+
const PagePrevButton = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
onPreviousPage,
|
|
10
|
+
canPreviousPage
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx(PreviousNextPageButton, {
|
|
13
|
+
onClick: () => {
|
|
14
|
+
if (canPreviousPage) onPreviousPage();
|
|
15
|
+
},
|
|
16
|
+
disabled: !canPreviousPage,
|
|
17
|
+
buttonType: "raw",
|
|
18
|
+
"data-testid": PAGINATION_DATA_TESTID.PREVIOUS_BUTTON
|
|
19
|
+
}, void 0, /*#__PURE__*/_jsx(ChevronLeft, {
|
|
20
|
+
color: canPreviousPage ? ['brand-primary', '700'] : ['neutral', '500']
|
|
21
|
+
}));
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
export { PagePrevButton };
|
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import Grid from
|
|
4
|
-
import { PaginationContainer,
|
|
5
|
-
import PerPageSelector from
|
|
6
|
-
import Paginator from
|
|
7
|
-
import { PAGINATION_DATA_TESTID } from
|
|
8
|
-
import { PagePrevButton } from
|
|
9
|
-
import { PageNextButton } from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import Grid from '@elliemae/ds-grid';
|
|
4
|
+
import { PaginationContainer, PaginationWrapper, PaginationSeparator } from '../styled.js';
|
|
5
|
+
import PerPageSelector from './PerPageSelector.js';
|
|
6
|
+
import Paginator from './Paginator.js';
|
|
7
|
+
import { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';
|
|
8
|
+
import { PagePrevButton } from './PagePrevButton.js';
|
|
9
|
+
import { PageNextButton } from './PageNextButton.js';
|
|
10
|
+
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var _PaginationSeparator;
|
|
13
|
+
const PaginationContent = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
pageIndex,
|
|
16
|
+
pageSize,
|
|
17
|
+
canPreviousPage,
|
|
18
|
+
canNextPage,
|
|
19
|
+
onPageSizeChange,
|
|
20
|
+
onNextPage,
|
|
21
|
+
onPreviousPage,
|
|
22
|
+
onPageChange,
|
|
23
|
+
pageCount,
|
|
24
|
+
showPerPageSelector,
|
|
25
|
+
pageDetails,
|
|
26
|
+
pageDetailsTitle,
|
|
27
|
+
perPageOptions,
|
|
28
|
+
maxPerPage,
|
|
29
|
+
perPageStep,
|
|
30
|
+
minPerPage,
|
|
31
|
+
width
|
|
32
|
+
} = _ref;
|
|
33
|
+
return /*#__PURE__*/_jsx(PaginationContainer, {
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
width: width,
|
|
37
|
+
"data-testid": PAGINATION_DATA_TESTID.CONTAINER
|
|
38
|
+
}, void 0, /*#__PURE__*/_jsx(PaginationWrapper, {}, void 0, showPerPageSelector && /*#__PURE__*/jsxs(Fragment, {
|
|
39
|
+
children: [/*#__PURE__*/_jsx(PerPageSelector, {
|
|
40
|
+
pageSize: pageSize,
|
|
41
|
+
onPageSizeChange: onPageSizeChange,
|
|
42
|
+
perPageOptions: perPageOptions,
|
|
43
|
+
maxPerPage: maxPerPage,
|
|
44
|
+
perPageStep: perPageStep,
|
|
45
|
+
minPerPage: minPerPage
|
|
46
|
+
}), _PaginationSeparator || (_PaginationSeparator = /*#__PURE__*/_jsx(PaginationSeparator, {
|
|
47
|
+
mr: 24
|
|
48
|
+
}))]
|
|
49
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
50
|
+
cols: ['auto', 'auto', 'auto', 'auto', 'auto'],
|
|
51
|
+
mr: "32px",
|
|
52
|
+
alignItems: "center"
|
|
53
|
+
}, void 0, /*#__PURE__*/_jsx(PagePrevButton, {
|
|
54
|
+
canPreviousPage: canPreviousPage,
|
|
55
|
+
onPreviousPage: onPreviousPage
|
|
56
|
+
}), /*#__PURE__*/_jsx(Paginator, {
|
|
57
|
+
pageCount: pageCount,
|
|
58
|
+
pageIndex: pageIndex,
|
|
59
|
+
onNextPage: onNextPage,
|
|
60
|
+
onPageChange: onPageChange,
|
|
61
|
+
pageDetails: pageDetails,
|
|
62
|
+
pageDetailsTitle: pageDetailsTitle
|
|
63
|
+
}), /*#__PURE__*/_jsx(PageNextButton, {
|
|
64
|
+
canNextPage: canNextPage,
|
|
65
|
+
onNextPage: onNextPage
|
|
66
|
+
}))));
|
|
62
67
|
};
|
|
63
|
-
|
|
68
|
+
|
|
69
|
+
export { PaginationContent };
|