@elliemae/ds-pagination 2.3.1 → 3.0.0-alpha.3
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/dist/cjs/Pagination.js +61 -0
- package/dist/cjs/Pagination.js.map +7 -0
- package/dist/cjs/PaginationDataTestID.js +39 -0
- package/dist/cjs/PaginationDataTestID.js.map +7 -0
- package/dist/cjs/hooks/usePaginationSearch.js +60 -0
- package/dist/cjs/hooks/usePaginationSearch.js.map +7 -0
- package/dist/cjs/index.d.js +27 -0
- package/dist/cjs/index.d.js.map +7 -0
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/parts/PageNextButton.js +53 -0
- package/dist/cjs/parts/PageNextButton.js.map +7 -0
- package/dist/cjs/parts/PagePrevButton.js +49 -0
- package/dist/cjs/parts/PagePrevButton.js.map +7 -0
- package/dist/cjs/parts/PaginationContent.js +111 -0
- package/dist/cjs/parts/PaginationContent.js.map +7 -0
- package/dist/cjs/parts/Paginator.js +148 -0
- package/dist/cjs/parts/Paginator.js.map +7 -0
- package/dist/cjs/parts/PerPageSelector.js +106 -0
- package/dist/cjs/parts/PerPageSelector.js.map +7 -0
- package/dist/cjs/props.js +82 -0
- package/dist/cjs/props.js.map +7 -0
- package/dist/cjs/styled.js +130 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/Pagination.js +34 -0
- package/dist/esm/Pagination.js.map +7 -0
- package/dist/esm/PaginationDataTestID.js +10 -0
- package/dist/esm/PaginationDataTestID.js.map +7 -0
- package/{esm → dist/esm}/hooks/usePaginationSearch.js +16 -13
- package/dist/esm/hooks/usePaginationSearch.js.map +7 -0
- package/dist/esm/index.d.js +2 -0
- package/dist/esm/index.d.js.map +7 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/parts/PageNextButton.js +24 -0
- package/dist/esm/parts/PageNextButton.js.map +7 -0
- package/dist/esm/parts/PagePrevButton.js +20 -0
- package/dist/esm/parts/PagePrevButton.js.map +7 -0
- package/dist/esm/parts/PaginationContent.js +84 -0
- package/dist/esm/parts/PaginationContent.js.map +7 -0
- package/dist/esm/parts/Paginator.js +124 -0
- package/dist/esm/parts/Paginator.js.map +7 -0
- package/dist/esm/parts/PerPageSelector.js +77 -0
- package/dist/esm/parts/PerPageSelector.js.map +7 -0
- package/dist/esm/props.js +53 -0
- package/dist/esm/props.js.map +7 -0
- package/dist/esm/styled.js +106 -0
- package/dist/esm/styled.js.map +7 -0
- package/package.json +53 -45
- package/cjs/Pagination.js +0 -35
- package/cjs/PaginationDataTestID.js +0 -11
- package/cjs/hooks/usePaginationSearch.js +0 -32
- package/cjs/index.d.js +0 -2
- package/cjs/index.js +0 -10
- package/cjs/parts/PageNextButton.js +0 -33
- package/cjs/parts/PagePrevButton.js +0 -32
- package/cjs/parts/PaginationContent.js +0 -95
- package/cjs/parts/Paginator.js +0 -163
- package/cjs/parts/PerPageSelector.js +0 -110
- package/cjs/props.js +0 -53
- package/cjs/styled.js +0 -57
- package/esm/Pagination.js +0 -26
- package/esm/PaginationDataTestID.js +0 -7
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -1
- package/esm/parts/PageNextButton.js +0 -25
- package/esm/parts/PagePrevButton.js +0 -24
- package/esm/parts/PaginationContent.js +0 -85
- package/esm/parts/Paginator.js +0 -156
- package/esm/parts/PerPageSelector.js +0 -103
- package/esm/props.js +0 -48
- package/esm/styled.js +0 -40
- package/types/Pagination.d.ts +0 -5
- package/types/PaginationDataTestID.d.ts +0 -5
- package/types/hooks/usePaginationSearch.d.ts +0 -1
- package/types/index.d.ts +0 -1
- package/types/parts/PageNextButton.d.ts +0 -3
- package/types/parts/PagePrevButton.d.ts +0 -3
- package/types/parts/PaginationContent.d.ts +0 -3
- package/types/parts/Paginator.d.ts +0 -10
- package/types/parts/PerPageSelector.d.ts +0 -4
- package/types/props.d.ts +0 -20
- package/types/styled.d.ts +0 -10
package/esm/parts/Paginator.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
8
|
-
import { useState, useRef, useMemo, useEffect, useLayoutEffect } from 'react';
|
|
9
|
-
import { Checkmark, ChevronDown } from '@elliemae/ds-icons';
|
|
10
|
-
import { useOnElementResize } from '@elliemae/ds-utilities';
|
|
11
|
-
import Grid from '@elliemae/ds-grid';
|
|
12
|
-
import { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';
|
|
13
|
-
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
14
|
-
import { PaginationSeparator, PaginationDropdownButton, PaginationBoldText, InvisibleDetail } from '../styled.js';
|
|
15
|
-
import { usePaginationSearch } from '../hooks/usePaginationSearch.js';
|
|
16
|
-
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
17
|
-
|
|
18
|
-
var _div, _PaginationSeparator, _PaginationSeparator2, _PaginationSeparator3, _PaginationSeparator4;
|
|
19
|
-
|
|
20
|
-
const Paginator = props => {
|
|
21
|
-
var _span2;
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
pageIndex,
|
|
25
|
-
pageCount,
|
|
26
|
-
onPageChange,
|
|
27
|
-
pageDetails,
|
|
28
|
-
pageDetailsTitle
|
|
29
|
-
} = props;
|
|
30
|
-
const [isOpened, setIsOpened] = useState(false);
|
|
31
|
-
const btnRef = useRef(null);
|
|
32
|
-
const pageInfoRef = useRef(null);
|
|
33
|
-
const {
|
|
34
|
-
width: btnWidth
|
|
35
|
-
} = useOnElementResize(btnRef);
|
|
36
|
-
const {
|
|
37
|
-
width: txtWidth
|
|
38
|
-
} = useOnElementResize(pageInfoRef);
|
|
39
|
-
const options = useMemo(() => new Array(pageCount).fill(0).map((_, index) => {
|
|
40
|
-
var _span;
|
|
41
|
-
|
|
42
|
-
const option = {
|
|
43
|
-
dsId: (index + 1).toString(),
|
|
44
|
-
label: (index + 1).toString(),
|
|
45
|
-
value: index + 1,
|
|
46
|
-
type: 'single'
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
if (pageDetails !== null && pageDetails !== void 0 && pageDetails.length) {
|
|
50
|
-
option.render = () => /*#__PURE__*/_jsx(Grid, {
|
|
51
|
-
cols: ['16px', "".concat(txtWidth + 16, "px"), 'auto'],
|
|
52
|
-
gutter: "xxs",
|
|
53
|
-
alignItems: "center"
|
|
54
|
-
}, void 0, pageIndex === index ? /*#__PURE__*/_jsx(Checkmark, {
|
|
55
|
-
size: "s",
|
|
56
|
-
color: ['brand-primary', '600']
|
|
57
|
-
}) : _div || (_div = /*#__PURE__*/_jsx("div", {})), _span || (_span = /*#__PURE__*/_jsx("span", {}, void 0, index + 1)), /*#__PURE__*/_jsx("span", {
|
|
58
|
-
style: {
|
|
59
|
-
whiteSpace: 'nowrap',
|
|
60
|
-
textOverflow: 'ellipsis',
|
|
61
|
-
overflow: 'hidden'
|
|
62
|
-
}
|
|
63
|
-
}, void 0, pageDetails[index]));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return option;
|
|
67
|
-
}), [pageCount, pageDetails, pageIndex, txtWidth]);
|
|
68
|
-
const actionRef = useRef({});
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (isOpened) {
|
|
71
|
-
actionRef.current.setActiveDescendant((pageIndex + 1).toString());
|
|
72
|
-
actionRef.current.scrollOptionIntoView((pageIndex + 1).toString());
|
|
73
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
-
|
|
75
|
-
}, [isOpened]);
|
|
76
|
-
const [detailWidth, setDetailWidth] = useState(0);
|
|
77
|
-
useLayoutEffect(() => {
|
|
78
|
-
const invisibleDetails = [...document.body.querySelectorAll('[data-testid="ds-pagination-invisible-detail-for-width-calc"]')];
|
|
79
|
-
const maxWidth = invisibleDetails.reduce((acc, cur) => Math.max(acc, cur.getBoundingClientRect().width), 0);
|
|
80
|
-
setDetailWidth(maxWidth);
|
|
81
|
-
}, [pageDetails]);
|
|
82
|
-
const onKeyDown = usePaginationSearch(pageCount, actionRef);
|
|
83
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
84
|
-
children: [_PaginationSeparator || (_PaginationSeparator = /*#__PURE__*/_jsx(PaginationSeparator, {})), /*#__PURE__*/_jsx(DSDropdownMenuV2, {
|
|
85
|
-
isOpened: isOpened,
|
|
86
|
-
options: options,
|
|
87
|
-
selectedOptions: {
|
|
88
|
-
[(pageIndex + 1).toString()]: true
|
|
89
|
-
},
|
|
90
|
-
onOptionClick: (_, clickedOption) => {
|
|
91
|
-
var _btnRef$current;
|
|
92
|
-
|
|
93
|
-
onPageChange(clickedOption.value);
|
|
94
|
-
setIsOpened(false);
|
|
95
|
-
(_btnRef$current = btnRef.current) === null || _btnRef$current === void 0 ? void 0 : _btnRef$current.focus();
|
|
96
|
-
},
|
|
97
|
-
onClickOutside: () => {
|
|
98
|
-
var _btnRef$current2;
|
|
99
|
-
|
|
100
|
-
setIsOpened(false);
|
|
101
|
-
(_btnRef$current2 = btnRef.current) === null || _btnRef$current2 === void 0 ? void 0 : _btnRef$current2.focus();
|
|
102
|
-
},
|
|
103
|
-
customOffset: [-23, 2],
|
|
104
|
-
startPlacementPreference: "top-start",
|
|
105
|
-
actionRef: actionRef,
|
|
106
|
-
onKeyDown: onKeyDown,
|
|
107
|
-
minWidth: pageDetails.length !== 0 ? btnWidth + 23 : pageCount.toString().length * 6 + 90,
|
|
108
|
-
maxHeight: 300,
|
|
109
|
-
HeaderComp: () => pageDetailsTitle !== '' ? /*#__PURE__*/_jsx(Grid, {
|
|
110
|
-
cols: ["".concat(txtWidth + 50, "px"), '8px', 'auto']
|
|
111
|
-
}, void 0, /*#__PURE__*/_jsx("span", {
|
|
112
|
-
style: {
|
|
113
|
-
marginLeft: '8px'
|
|
114
|
-
}
|
|
115
|
-
}, void 0, "Page"), _PaginationSeparator2 || (_PaginationSeparator2 = /*#__PURE__*/_jsx(PaginationSeparator, {
|
|
116
|
-
height: "100%"
|
|
117
|
-
})), _span2 || (_span2 = /*#__PURE__*/_jsx("span", {}, void 0, pageDetailsTitle))) : 'Page'
|
|
118
|
-
}, void 0, /*#__PURE__*/_jsx(PaginationDropdownButton, {
|
|
119
|
-
buttonType: "raw",
|
|
120
|
-
onClick: () => setIsOpened(prev => !prev),
|
|
121
|
-
innerRef: btnRef
|
|
122
|
-
}, void 0, /*#__PURE__*/_jsx(Grid, {
|
|
123
|
-
gutter: "xxs",
|
|
124
|
-
alignItems: "center",
|
|
125
|
-
cols: pageDetails.length !== 0 ? ['auto', 'min-content', 'minmax(0px, 70%)', 'min-content'] : ['auto', 'min-content']
|
|
126
|
-
}, void 0, /*#__PURE__*/jsxs(Grid, {
|
|
127
|
-
alignItems: "center",
|
|
128
|
-
gutter: "xxxs",
|
|
129
|
-
ref: pageInfoRef,
|
|
130
|
-
style: {
|
|
131
|
-
gridAutoFlow: 'column'
|
|
132
|
-
},
|
|
133
|
-
children: [/*#__PURE__*/_jsx(PaginationBoldText, {
|
|
134
|
-
fontSize: "18px"
|
|
135
|
-
}, void 0, pageIndex + 1), " / ", pageCount]
|
|
136
|
-
}), pageDetails.length !== 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
137
|
-
children: [_PaginationSeparator3 || (_PaginationSeparator3 = /*#__PURE__*/_jsx(PaginationSeparator, {
|
|
138
|
-
height: "12px",
|
|
139
|
-
ml: "8px"
|
|
140
|
-
})), /*#__PURE__*/_jsx(PaginationBoldText, {
|
|
141
|
-
fontSize: "13px",
|
|
142
|
-
w: detailWidth,
|
|
143
|
-
mr: "xxs",
|
|
144
|
-
display: "grid"
|
|
145
|
-
}, void 0, /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
146
|
-
value: pageDetails[pageIndex]
|
|
147
|
-
}, void 0, pageDetails[pageIndex]), pageDetails.map(pageDetail => /*#__PURE__*/_jsx(InvisibleDetail, {
|
|
148
|
-
"data-testid": "ds-pagination-invisible-detail-for-width-calc"
|
|
149
|
-
}, void 0, pageDetail)))]
|
|
150
|
-
}), /*#__PURE__*/_jsx(ChevronDown, {
|
|
151
|
-
color: ['brand-primary', '700']
|
|
152
|
-
})))), _PaginationSeparator4 || (_PaginationSeparator4 = /*#__PURE__*/_jsx(PaginationSeparator, {}))]
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
export { Paginator as default };
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
8
|
-
import { useState, useMemo, useRef, useEffect } from 'react';
|
|
9
|
-
import memoize from 'memoize-one';
|
|
10
|
-
import { range } from '@elliemae/ds-utilities';
|
|
11
|
-
import { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';
|
|
12
|
-
import { ChevronDown } from '@elliemae/ds-icons';
|
|
13
|
-
import { PaginationDropdownButton } from '../styled.js';
|
|
14
|
-
|
|
15
|
-
const generateOption = value => {
|
|
16
|
-
if (typeof value === 'object') {
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
dsId: value.toString(),
|
|
22
|
-
value,
|
|
23
|
-
label: value.toString(),
|
|
24
|
-
type: 'single'
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const getOptions = memoize((step, min, max) => {
|
|
29
|
-
const options = range(min, max + step, step).map(generateOption);
|
|
30
|
-
return min === 0 ? options.slice(1, options.length) : options;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const PerPageSelector = props => {
|
|
34
|
-
const [isOpened, setIsOpened] = useState(false);
|
|
35
|
-
const {
|
|
36
|
-
pageSize,
|
|
37
|
-
onPageSizeChange,
|
|
38
|
-
perPageOptions,
|
|
39
|
-
maxPerPage,
|
|
40
|
-
perPageStep,
|
|
41
|
-
minPerPage
|
|
42
|
-
} = props;
|
|
43
|
-
const options = useMemo(() => {
|
|
44
|
-
if (perPageOptions) return perPageOptions.map(generateOption);
|
|
45
|
-
return getOptions(perPageStep, minPerPage, maxPerPage);
|
|
46
|
-
}, [maxPerPage, minPerPage, perPageOptions, perPageStep]);
|
|
47
|
-
const actionRef = useRef({});
|
|
48
|
-
const btnRef = useRef(null);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (isOpened) {
|
|
51
|
-
actionRef.current.setActiveDescendant(pageSize.toString());
|
|
52
|
-
actionRef.current.scrollOptionIntoView(pageSize.toString());
|
|
53
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
|
-
|
|
55
|
-
}, [isOpened]);
|
|
56
|
-
const width = useMemo(() => {
|
|
57
|
-
const maxLength = options.reduce((acc, cur) => {
|
|
58
|
-
var _length, _cur$label;
|
|
59
|
-
|
|
60
|
-
return Math.max(acc, (_length = cur === null || cur === void 0 ? void 0 : (_cur$label = cur.label) === null || _cur$label === void 0 ? void 0 : _cur$label.length) !== null && _length !== void 0 ? _length : 0);
|
|
61
|
-
}, 0);
|
|
62
|
-
return maxLength * 6 + 90;
|
|
63
|
-
}, [options]);
|
|
64
|
-
return /*#__PURE__*/_jsx(DSDropdownMenuV2, {
|
|
65
|
-
isOpened: isOpened,
|
|
66
|
-
options: options,
|
|
67
|
-
selectedOptions: {
|
|
68
|
-
[pageSize.toString()]: true
|
|
69
|
-
},
|
|
70
|
-
onOptionClick: (_, clickedOption) => {
|
|
71
|
-
var _btnRef$current;
|
|
72
|
-
|
|
73
|
-
onPageSizeChange(clickedOption.value);
|
|
74
|
-
setIsOpened(false);
|
|
75
|
-
(_btnRef$current = btnRef.current) === null || _btnRef$current === void 0 ? void 0 : _btnRef$current.focus();
|
|
76
|
-
},
|
|
77
|
-
onClickOutside: () => {
|
|
78
|
-
var _btnRef$current2;
|
|
79
|
-
|
|
80
|
-
setIsOpened(false);
|
|
81
|
-
(_btnRef$current2 = btnRef.current) === null || _btnRef$current2 === void 0 ? void 0 : _btnRef$current2.focus();
|
|
82
|
-
},
|
|
83
|
-
customOffset: [10, 2],
|
|
84
|
-
startPlacementPreference: "top-start",
|
|
85
|
-
actionRef: actionRef,
|
|
86
|
-
minWidth: width,
|
|
87
|
-
maxHeight: 300,
|
|
88
|
-
HeaderComp: () => 'Per Page'
|
|
89
|
-
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
90
|
-
style: {
|
|
91
|
-
marginLeft: '32px'
|
|
92
|
-
}
|
|
93
|
-
}, void 0, /*#__PURE__*/_jsx(PaginationDropdownButton, {
|
|
94
|
-
buttonType: "raw",
|
|
95
|
-
onClick: () => setIsOpened(prev => !prev),
|
|
96
|
-
"aria-pressed": isOpened,
|
|
97
|
-
innerRef: btnRef
|
|
98
|
-
}, void 0, pageSize, " / page", /*#__PURE__*/_jsx(ChevronDown, {
|
|
99
|
-
color: ['brand-primary', '700']
|
|
100
|
-
}))));
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export { PerPageSelector as default };
|
package/esm/props.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { PropTypes } from '@elliemae/ds-props-helpers';
|
|
2
|
-
|
|
3
|
-
const emptyFunc = () => null;
|
|
4
|
-
|
|
5
|
-
const propTypes = {
|
|
6
|
-
pageCount: PropTypes.number.description('How many pages are there'),
|
|
7
|
-
pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),
|
|
8
|
-
canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),
|
|
9
|
-
canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),
|
|
10
|
-
pageSize: PropTypes.number.description('The current page size').defaultValue(10),
|
|
11
|
-
showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),
|
|
12
|
-
perPageOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
13
|
-
dsId: PropTypes.string,
|
|
14
|
-
value: PropTypes.number,
|
|
15
|
-
label: PropTypes.string,
|
|
16
|
-
type: PropTypes.oneOf(['single'])
|
|
17
|
-
})])).description('The available options for page size').defaultValue([10]),
|
|
18
|
-
perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),
|
|
19
|
-
minPerPage: PropTypes.number.description('Step for the per page options').defaultValue(0),
|
|
20
|
-
maxPerPage: PropTypes.number.description('Step for the per page options').defaultValue(100),
|
|
21
|
-
onPageSizeChange: PropTypes.func.description('Function invoked when the page size changes').defaultValue(() => null),
|
|
22
|
-
onPreviousPage: PropTypes.func.description('Function invoked when the previous button is pressed').defaultValue(() => null),
|
|
23
|
-
onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),
|
|
24
|
-
onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),
|
|
25
|
-
pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),
|
|
26
|
-
pageDetailsTitle: PropTypes.string.description('The title of the details (usually a column of your dataset)').defaultValue(''),
|
|
27
|
-
width: PropTypes.any.description('Width for the container of the pagination').defaultValue('100%')
|
|
28
|
-
};
|
|
29
|
-
const defaultProps = {
|
|
30
|
-
pageIndex: 1,
|
|
31
|
-
canPreviousPage: true,
|
|
32
|
-
canNextPage: true,
|
|
33
|
-
pageSize: 10,
|
|
34
|
-
showPerPageSelector: true,
|
|
35
|
-
perPageOptions: [10],
|
|
36
|
-
perPageStep: 5,
|
|
37
|
-
minPerPage: 0,
|
|
38
|
-
maxPerPage: 100,
|
|
39
|
-
onPageSizeChange: emptyFunc,
|
|
40
|
-
onPreviousPage: emptyFunc,
|
|
41
|
-
onNextPage: emptyFunc,
|
|
42
|
-
onPageChange: emptyFunc,
|
|
43
|
-
pageDetails: [],
|
|
44
|
-
pageDetailsTitle: '',
|
|
45
|
-
width: '100%'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export { defaultProps, propTypes };
|
package/esm/styled.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
|
-
import Grid from '@elliemae/ds-grid';
|
|
3
|
-
import { DSButtonV2 } from '@elliemae/ds-button';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { typography, space, sizing, layout } from '@xstyled/styled-components';
|
|
6
|
-
import { css } from '@elliemae/ds-system';
|
|
7
|
-
|
|
8
|
-
var _templateObject;
|
|
9
|
-
const styledFocusCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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 ", ";\n pointer-events: none;\n z-index: 7;\n }\n"])), _ref => {
|
|
10
|
-
let {
|
|
11
|
-
theme
|
|
12
|
-
} = _ref;
|
|
13
|
-
return theme.colors.brand[700];
|
|
14
|
-
});
|
|
15
|
-
const PaginationContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
16
|
-
componentId: "sc-mxz59e-0"
|
|
17
|
-
})(["height:42px;max-width:100%;align-items:center;box-shadow:0 -1px 3px 0 rgba(0,0,0,0.5);"]);
|
|
18
|
-
const PaginationWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
19
|
-
componentId: "sc-mxz59e-1"
|
|
20
|
-
})(["display:flex;justify-content:center;align-items:center;"]);
|
|
21
|
-
const PaginationSeparator = /*#__PURE__*/styled(Grid).withConfig({
|
|
22
|
-
componentId: "sc-mxz59e-2"
|
|
23
|
-
})(["background-color:", ";width:1px;height:", ";"], props => props.theme.colors.neutral[300], props => props.height || '30px');
|
|
24
|
-
const PaginationBoldText = /*#__PURE__*/styled.span.withConfig({
|
|
25
|
-
componentId: "sc-mxz59e-3"
|
|
26
|
-
})(["font-weight:", ";", " ", " ", " ", " position:relative;"], props => props.theme.fontWeights.semibold, typography, space, sizing, layout);
|
|
27
|
-
const InvisibleDetail = /*#__PURE__*/styled.div.withConfig({
|
|
28
|
-
componentId: "sc-mxz59e-4"
|
|
29
|
-
})(["opacity:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:absolute;"]);
|
|
30
|
-
const PaginationDetail = /*#__PURE__*/styled.span.withConfig({
|
|
31
|
-
componentId: "sc-mxz59e-5"
|
|
32
|
-
})(["text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);
|
|
33
|
-
const PaginationDropdownButton = /*#__PURE__*/styled(DSButtonV2).withConfig({
|
|
34
|
-
componentId: "sc-mxz59e-6"
|
|
35
|
-
})(["height:42px;display:grid;grid-auto-flow:column;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{", "}white-space:nowrap;"], props => props.theme.colors.neutral[700], props => props.theme.fontWeights.regular, styledFocusCss);
|
|
36
|
-
const PreviousNextPageButton = /*#__PURE__*/styled(DSButtonV2).withConfig({
|
|
37
|
-
componentId: "sc-mxz59e-7"
|
|
38
|
-
})(["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);
|
|
39
|
-
|
|
40
|
-
export { InvisibleDetail, PaginationBoldText, PaginationContainer, PaginationDetail, PaginationDropdownButton, PaginationSeparator, PaginationWrapper, PreviousNextPageButton };
|
package/types/Pagination.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DSPaginationProps } from './index.d';
|
|
3
|
-
declare const DSPagination: React.ComponentType<DSPaginationProps>;
|
|
4
|
-
declare const DSPaginationWithSchema: import("@elliemae/ds-props-helpers/types/propTypes/types").DocumentedReactComponent<DSPaginationProps>;
|
|
5
|
-
export { DSPagination, DSPaginationWithSchema };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const usePaginationSearch: (pageCount: number, actionRef: React.MutableRefObject<any>) => React.KeyboardEventHandler;
|
package/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Pagination';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface PaginatorPropsT {
|
|
3
|
-
pageIndex: number;
|
|
4
|
-
pageCount: number;
|
|
5
|
-
onPageChange: (page: number) => void;
|
|
6
|
-
pageDetails: string[];
|
|
7
|
-
pageDetailsTitle: string;
|
|
8
|
-
}
|
|
9
|
-
declare const Paginator: React.ComponentType<PaginatorPropsT>;
|
|
10
|
-
export default Paginator;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DSPaginationProps } from '../index.d';
|
|
3
|
-
declare const PerPageSelector: React.ComponentType<Required<Pick<DSPaginationProps, 'pageSize' | 'onPageSizeChange' | 'perPageOptions' | 'perPageStep' | 'minPerPage' | 'maxPerPage'>>>;
|
|
4
|
-
export default PerPageSelector;
|
package/types/props.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { WeakValidationMap } from 'react';
|
|
2
|
-
export declare const propTypes: WeakValidationMap<unknown>;
|
|
3
|
-
export declare const defaultProps: {
|
|
4
|
-
pageIndex: number;
|
|
5
|
-
canPreviousPage: boolean;
|
|
6
|
-
canNextPage: boolean;
|
|
7
|
-
pageSize: number;
|
|
8
|
-
showPerPageSelector: boolean;
|
|
9
|
-
perPageOptions: number[];
|
|
10
|
-
perPageStep: number;
|
|
11
|
-
minPerPage: number;
|
|
12
|
-
maxPerPage: number;
|
|
13
|
-
onPageSizeChange: () => null;
|
|
14
|
-
onPreviousPage: () => null;
|
|
15
|
-
onNextPage: () => null;
|
|
16
|
-
onPageChange: () => null;
|
|
17
|
-
pageDetails: never[];
|
|
18
|
-
pageDetailsTitle: string;
|
|
19
|
-
width: string;
|
|
20
|
-
};
|
package/types/styled.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TypographyProps, SpaceProps, SizingProps, LayoutProps } from '@xstyled/styled-components';
|
|
3
|
-
export declare const PaginationContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
-
export declare const PaginationWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
export declare const PaginationSeparator: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const PaginationBoldText: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TypographyProps<import("@xstyled/system").Theme> & SpaceProps<import("@xstyled/system").Theme> & SizingProps<import("@xstyled/system").Theme> & LayoutProps<import("@xstyled/system").Theme>, never>;
|
|
7
|
-
export declare const InvisibleDetail: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
-
export declare const PaginationDetail: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
-
export declare const PaginationDropdownButton: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-button/types/v2/propTypes").DSButtonT.Props>, import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
export declare const PreviousNextPageButton: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-button/types/v2/propTypes").DSButtonT.Props>, import("styled-components").DefaultTheme, {}, never>;
|