@elliemae/ds-pagination 1.60.0 → 2.0.0-alpha.13
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 +21 -29
- package/cjs/PaginationDataTestID.js +1 -2
- package/cjs/hooks/usePaginationSearch.js +11 -26
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +1 -24
- package/cjs/parts/PageNextButton.js +12 -17
- package/cjs/parts/PagePrevButton.js +11 -14
- package/cjs/parts/PaginationContent.js +45 -50
- package/cjs/parts/Paginator.js +112 -113
- package/cjs/parts/PerPageSelector.js +44 -46
- package/cjs/props.js +14 -20
- package/cjs/styled.js +16 -31
- package/esm/Pagination.js +20 -29
- package/esm/PaginationDataTestID.js +1 -2
- package/esm/hooks/usePaginationSearch.js +9 -20
- package/esm/index.d.js +0 -1
- package/esm/index.js +1 -24
- package/esm/parts/PageNextButton.js +11 -16
- package/esm/parts/PagePrevButton.js +10 -13
- package/esm/parts/PaginationContent.js +40 -45
- package/esm/parts/Paginator.js +110 -109
- package/esm/parts/PerPageSelector.js +43 -43
- package/esm/props.js +14 -20
- package/esm/styled.js +16 -31
- package/package.json +77 -16
- package/types/Pagination.d.ts +5 -0
- package/types/PaginationDataTestID.d.ts +5 -0
- package/types/hooks/usePaginationSearch.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/parts/PageNextButton.d.ts +3 -0
- package/types/parts/PagePrevButton.d.ts +3 -0
- package/types/parts/PaginationContent.d.ts +3 -0
- package/types/parts/Paginator.d.ts +4 -0
- package/types/parts/PerPageSelector.d.ts +4 -0
- package/types/props.d.ts +75 -0
- package/types/styled.d.ts +13 -0
- package/Pagination/package.json +0 -10
- package/PaginationDataTestID/package.json +0 -10
- package/cjs/Pagination.js.map +0 -1
- package/cjs/PaginationDataTestID.js.map +0 -1
- package/cjs/hooks/usePaginationSearch.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/parts/PageNextButton.js.map +0 -1
- package/cjs/parts/PagePrevButton.js.map +0 -1
- package/cjs/parts/PaginationContent.js.map +0 -1
- package/cjs/parts/Paginator.js.map +0 -1
- package/cjs/parts/PerPageSelector.js.map +0 -1
- package/cjs/props.js.map +0 -1
- package/cjs/styled.js.map +0 -1
- package/esm/Pagination.js.map +0 -1
- package/esm/PaginationDataTestID.js.map +0 -1
- package/esm/hooks/usePaginationSearch.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/parts/PageNextButton.js.map +0 -1
- package/esm/parts/PagePrevButton.js.map +0 -1
- package/esm/parts/PaginationContent.js.map +0 -1
- package/esm/parts/Paginator.js.map +0 -1
- package/esm/parts/PerPageSelector.js.map +0 -1
- package/esm/props.js.map +0 -1
- package/esm/styled.js.map +0 -1
- package/hooks/usePaginationSearch/package.json +0 -10
- package/parts/PageNextButton/package.json +0 -10
- package/parts/PagePrevButton/package.json +0 -10
- package/parts/PaginationContent/package.json +0 -10
- package/parts/Paginator/package.json +0 -10
- package/parts/PerPageSelector/package.json +0 -10
- package/props/package.json +0 -10
- package/styled/package.json +0 -10
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
2
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _useState3 = useState(true),
|
|
11
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
12
|
-
shouldResetSearchValue = _useState4[0],
|
|
13
|
-
setShouldResetSearchValue = _useState4[1];
|
|
14
|
-
|
|
15
|
-
var timeoutRef = useRef(null);
|
|
16
|
-
useEffect(function () {
|
|
4
|
+
const usePaginationSearch = (pageCount, actionRef) => {
|
|
5
|
+
const [searchValue, setSearchValue] = useState('');
|
|
6
|
+
const [shouldResetSearchValue, setShouldResetSearchValue] = useState(true);
|
|
7
|
+
const timeoutRef = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
17
9
|
if (searchValue !== '' && Number.parseInt(searchValue, 10) <= pageCount) {
|
|
18
10
|
actionRef.current.setActiveDescendant(searchValue);
|
|
19
11
|
actionRef.current.scrollOptionIntoView(searchValue);
|
|
20
12
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
13
|
|
|
22
14
|
}, [searchValue]);
|
|
23
|
-
|
|
15
|
+
const onKeyDown = useCallback(e => {
|
|
24
16
|
if (e.code.startsWith('Digit')) {
|
|
25
|
-
if (shouldResetSearchValue) setSearchValue(e.key);else setSearchValue(
|
|
26
|
-
return prevValue + e.key;
|
|
27
|
-
});
|
|
17
|
+
if (shouldResetSearchValue) setSearchValue(e.key);else setSearchValue(prevValue => prevValue + e.key);
|
|
28
18
|
setShouldResetSearchValue(false);
|
|
29
19
|
clearTimeout(timeoutRef.current);
|
|
30
|
-
timeoutRef.current = setTimeout(
|
|
20
|
+
timeoutRef.current = setTimeout(() => {
|
|
31
21
|
setShouldResetSearchValue(true);
|
|
32
22
|
}, 1000);
|
|
33
23
|
}
|
|
@@ -36,4 +26,3 @@ var usePaginationSearch = function usePaginationSearch(pageCount, actionRef) {
|
|
|
36
26
|
};
|
|
37
27
|
|
|
38
28
|
export { usePaginationSearch };
|
|
39
|
-
//# sourceMappingURL=usePaginationSearch.js.map
|
package/esm/index.d.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
export { DSPagination } from './Pagination.js';
|
|
2
|
-
export { DSPaginationSchema } from './props.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '@elliemae/ds-props-helpers';
|
|
5
|
-
import 'react-desc';
|
|
6
|
-
import './parts/PaginationContent.js';
|
|
7
|
-
import '@elliemae/ds-grid';
|
|
8
|
-
import './styled.js';
|
|
9
|
-
import '@elliemae/ds-button';
|
|
10
|
-
import 'styled-components';
|
|
11
|
-
import 'styled-system';
|
|
12
|
-
import './parts/PerPageSelector.js';
|
|
13
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
14
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
15
|
-
import 'memoize-one';
|
|
16
|
-
import '@elliemae/ds-utilities';
|
|
17
|
-
import '@elliemae/ds-dropdownmenu';
|
|
18
|
-
import '@elliemae/ds-icons';
|
|
19
|
-
import './parts/Paginator.js';
|
|
20
|
-
import './hooks/usePaginationSearch.js';
|
|
21
|
-
import './PaginationDataTestID.js';
|
|
22
|
-
import './parts/PagePrevButton.js';
|
|
23
|
-
import './parts/PageNextButton.js';
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { DSPagination, DSPaginationWithSchema } from './Pagination.js';
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import { ChevronRight } from '@elliemae/ds-icons';
|
|
3
4
|
import { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';
|
|
4
5
|
import { PreviousNextPageButton } from '../styled.js';
|
|
5
|
-
import '@elliemae/ds-grid';
|
|
6
|
-
import '@elliemae/ds-button';
|
|
7
|
-
import 'styled-components';
|
|
8
|
-
import 'styled-system';
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
const PageNextButton = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
onNextPage,
|
|
10
|
+
canNextPage
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx(PreviousNextPageButton, {
|
|
13
|
+
onClick: () => {
|
|
16
14
|
if (canNextPage) onNextPage();
|
|
17
15
|
},
|
|
18
16
|
disabled: !canNextPage,
|
|
19
17
|
buttonType: "raw",
|
|
20
18
|
"data-testid": PAGINATION_DATA_TESTID.NEXT_BUTTON,
|
|
21
|
-
HeaderComp:
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}, /*#__PURE__*/React.createElement(ChevronRight, {
|
|
19
|
+
HeaderComp: () => 'Page'
|
|
20
|
+
}, void 0, /*#__PURE__*/_jsx(ChevronRight, {
|
|
25
21
|
color: canNextPage ? ['brand-primary', '700'] : ['neutral', '500']
|
|
26
22
|
}));
|
|
27
23
|
};
|
|
28
24
|
|
|
29
25
|
export { PageNextButton };
|
|
30
|
-
//# sourceMappingURL=PageNextButton.js.map
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import { ChevronLeft } from '@elliemae/ds-icons';
|
|
3
4
|
import { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';
|
|
4
5
|
import { PreviousNextPageButton } from '../styled.js';
|
|
5
|
-
import '@elliemae/ds-grid';
|
|
6
|
-
import '@elliemae/ds-button';
|
|
7
|
-
import 'styled-components';
|
|
8
|
-
import 'styled-system';
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
const PagePrevButton = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
onPreviousPage,
|
|
10
|
+
canPreviousPage
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx(PreviousNextPageButton, {
|
|
13
|
+
onClick: () => {
|
|
16
14
|
if (canPreviousPage) onPreviousPage();
|
|
17
15
|
},
|
|
18
16
|
disabled: !canPreviousPage,
|
|
19
17
|
buttonType: "raw",
|
|
20
18
|
"data-testid": PAGINATION_DATA_TESTID.PREVIOUS_BUTTON
|
|
21
|
-
}, /*#__PURE__*/
|
|
19
|
+
}, void 0, /*#__PURE__*/_jsx(ChevronLeft, {
|
|
22
20
|
color: canPreviousPage ? ['brand-primary', '700'] : ['neutral', '500']
|
|
23
21
|
}));
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
export { PagePrevButton };
|
|
27
|
-
//# sourceMappingURL=PagePrevButton.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import Grid from '@elliemae/ds-grid';
|
|
3
4
|
import { PaginationContainer, PaginationWrapper, PaginationSeparator } from '../styled.js';
|
|
4
5
|
import PerPageSelector from './PerPageSelector.js';
|
|
@@ -6,69 +7,63 @@ import Paginator from './Paginator.js';
|
|
|
6
7
|
import { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';
|
|
7
8
|
import { PagePrevButton } from './PagePrevButton.js';
|
|
8
9
|
import { PageNextButton } from './PageNextButton.js';
|
|
9
|
-
import '
|
|
10
|
-
import 'styled-components';
|
|
11
|
-
import 'styled-system';
|
|
12
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
13
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
14
|
-
import 'memoize-one';
|
|
15
|
-
import '@elliemae/ds-utilities';
|
|
16
|
-
import '@elliemae/ds-dropdownmenu';
|
|
17
|
-
import '@elliemae/ds-icons';
|
|
18
|
-
import '../hooks/usePaginationSearch.js';
|
|
10
|
+
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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, {
|
|
40
34
|
justifyContent: "center",
|
|
41
35
|
alignItems: "center",
|
|
42
36
|
width: width,
|
|
43
37
|
"data-testid": PAGINATION_DATA_TESTID.CONTAINER
|
|
44
|
-
}, /*#__PURE__*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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, {
|
|
54
50
|
cols: ['auto', 'auto', 'auto', 'auto', 'auto'],
|
|
55
51
|
mr: "32px",
|
|
56
52
|
alignItems: "center"
|
|
57
|
-
}, /*#__PURE__*/
|
|
53
|
+
}, void 0, /*#__PURE__*/_jsx(PagePrevButton, {
|
|
58
54
|
canPreviousPage: canPreviousPage,
|
|
59
55
|
onPreviousPage: onPreviousPage
|
|
60
|
-
}), /*#__PURE__*/
|
|
56
|
+
}), /*#__PURE__*/_jsx(Paginator, {
|
|
61
57
|
pageCount: pageCount,
|
|
62
58
|
pageIndex: pageIndex,
|
|
63
59
|
onNextPage: onNextPage,
|
|
64
60
|
onPageChange: onPageChange,
|
|
65
61
|
pageDetails: pageDetails,
|
|
66
62
|
pageDetailsTitle: pageDetailsTitle
|
|
67
|
-
}), /*#__PURE__*/
|
|
63
|
+
}), /*#__PURE__*/_jsx(PageNextButton, {
|
|
68
64
|
canNextPage: canNextPage,
|
|
69
65
|
onNextPage: onNextPage
|
|
70
66
|
}))));
|
|
71
67
|
};
|
|
72
68
|
|
|
73
69
|
export { PaginationContent };
|
|
74
|
-
//# sourceMappingURL=PaginationContent.js.map
|
package/esm/parts/Paginator.js
CHANGED
|
@@ -1,135 +1,136 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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 { useState, useRef, useMemo, useEffect } from 'react';
|
|
4
6
|
import { Checkmark, ChevronDown } from '@elliemae/ds-icons';
|
|
5
7
|
import { useOnElementResize } from '@elliemae/ds-utilities';
|
|
6
8
|
import Grid from '@elliemae/ds-grid';
|
|
7
9
|
import { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';
|
|
8
10
|
import { PaginationSeparator, PaginationDropdownButton, PaginationBoldText } from '../styled.js';
|
|
9
11
|
import { usePaginationSearch } from '../hooks/usePaginationSearch.js';
|
|
10
|
-
import '
|
|
11
|
-
import 'styled-components';
|
|
12
|
-
import 'styled-system';
|
|
12
|
+
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
var pageIndex = props.pageIndex,
|
|
16
|
-
pageCount = props.pageCount,
|
|
17
|
-
onPageChange = props.onPageChange,
|
|
18
|
-
pageDetails = props.pageDetails,
|
|
19
|
-
pageDetailsTitle = props.pageDetailsTitle;
|
|
14
|
+
var _div, _PaginationSeparator, _PaginationSeparator2, _PaginationSeparator3, _PaginationSeparator4;
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
isOpened = _useState2[0],
|
|
24
|
-
setIsOpened = _useState2[1];
|
|
16
|
+
const Paginator = props => {
|
|
17
|
+
var _span2;
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
const {
|
|
20
|
+
pageIndex,
|
|
21
|
+
pageCount,
|
|
22
|
+
onPageChange,
|
|
23
|
+
pageDetails,
|
|
24
|
+
pageDetailsTitle
|
|
25
|
+
} = props;
|
|
26
|
+
const [isOpened, setIsOpened] = useState(false);
|
|
27
|
+
const btnRef = useRef(null);
|
|
28
|
+
const pageInfoRef = useRef(null);
|
|
29
|
+
const {
|
|
30
|
+
width: btnWidth
|
|
31
|
+
} = useOnElementResize(btnRef);
|
|
32
|
+
const {
|
|
33
|
+
width: txtWidth
|
|
34
|
+
} = useOnElementResize(pageInfoRef);
|
|
35
|
+
const options = useMemo(() => new Array(pageCount).fill(0).map((_, index) => {
|
|
36
|
+
var _span;
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
const option = {
|
|
39
|
+
dsId: (index + 1).toString(),
|
|
40
|
+
label: (index + 1).toString(),
|
|
41
|
+
value: index + 1,
|
|
42
|
+
type: 'single'
|
|
43
|
+
};
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
gutter: "xxs",
|
|
49
|
-
alignItems: "center"
|
|
50
|
-
}, pageIndex === index ? /*#__PURE__*/React.createElement(Checkmark, {
|
|
51
|
-
size: "s",
|
|
52
|
-
color: ['brand-primary', '600']
|
|
53
|
-
}) : /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("span", null, index + 1), /*#__PURE__*/React.createElement("span", {
|
|
54
|
-
style: {
|
|
55
|
-
whiteSpace: 'nowrap',
|
|
56
|
-
textOverflow: 'ellipsis',
|
|
57
|
-
overflow: 'hidden'
|
|
58
|
-
}
|
|
59
|
-
}, pageDetails[index]));
|
|
60
|
-
};
|
|
61
|
-
}
|
|
45
|
+
if (pageDetails.length) {
|
|
46
|
+
option.render = () => /*#__PURE__*/_jsx(Grid, {
|
|
47
|
+
cols: ['16px', "".concat(txtWidth + 16, "px"), 'auto'],
|
|
48
|
+
gutter: "xxs",
|
|
49
|
+
alignItems: "center"
|
|
50
|
+
}, void 0, pageIndex === index ? /*#__PURE__*/_jsx(Checkmark, {
|
|
51
|
+
size: "s",
|
|
52
|
+
color: ['brand-primary', '600']
|
|
53
|
+
}) : _div || (_div = /*#__PURE__*/_jsx("div", {})), _span || (_span = /*#__PURE__*/_jsx("span", {}, void 0, index + 1)), /*#__PURE__*/_jsx("span", {
|
|
54
|
+
style: {
|
|
55
|
+
whiteSpace: 'nowrap',
|
|
56
|
+
textOverflow: 'ellipsis',
|
|
57
|
+
overflow: 'hidden'
|
|
58
|
+
}
|
|
59
|
+
}, void 0, pageDetails[index]));
|
|
60
|
+
}
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
useEffect(function () {
|
|
62
|
+
return option;
|
|
63
|
+
}), [pageCount, pageDetails, pageIndex, txtWidth]);
|
|
64
|
+
const actionRef = useRef({});
|
|
65
|
+
useEffect(() => {
|
|
68
66
|
if (isOpened) {
|
|
69
67
|
actionRef.current.setActiveDescendant((pageIndex + 1).toString());
|
|
70
68
|
actionRef.current.scrollOptionIntoView((pageIndex + 1).toString());
|
|
71
69
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
70
|
|
|
73
71
|
}, [isOpened]);
|
|
74
|
-
|
|
75
|
-
return /*#__PURE__*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
72
|
+
const onKeyDown = usePaginationSearch(pageCount, actionRef);
|
|
73
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
74
|
+
children: [_PaginationSeparator || (_PaginationSeparator = /*#__PURE__*/_jsx(PaginationSeparator, {})), /*#__PURE__*/_jsx(DSDropdownMenuV2, {
|
|
75
|
+
isOpened: isOpened,
|
|
76
|
+
options: options,
|
|
77
|
+
selectedOptions: {
|
|
78
|
+
[(pageIndex + 1).toString()]: true
|
|
79
|
+
},
|
|
80
|
+
onOptionClick: (_, clickedOption) => {
|
|
81
|
+
onPageChange(clickedOption.value);
|
|
82
|
+
setIsOpened(false);
|
|
83
|
+
btnRef.current.focus();
|
|
84
|
+
},
|
|
85
|
+
onClickOutside: () => {
|
|
86
|
+
setIsOpened(false);
|
|
87
|
+
btnRef.current.focus();
|
|
88
|
+
},
|
|
89
|
+
customOffset: [0, 2],
|
|
90
|
+
startPlacementPreference: "top-end",
|
|
91
|
+
actionRef: actionRef,
|
|
92
|
+
onKeyDown: onKeyDown,
|
|
93
|
+
minWidth: btnWidth + 23,
|
|
94
|
+
maxHeight: 300,
|
|
95
|
+
HeaderComp: () => pageDetailsTitle !== '' ? /*#__PURE__*/_jsx(Grid, {
|
|
95
96
|
cols: ["".concat(txtWidth + 50, "px"), '8px', 'auto']
|
|
96
|
-
}, /*#__PURE__*/
|
|
97
|
+
}, void 0, /*#__PURE__*/_jsx("span", {
|
|
97
98
|
style: {
|
|
98
99
|
marginLeft: '8px'
|
|
99
100
|
}
|
|
100
|
-
}, "Page"), /*#__PURE__*/
|
|
101
|
+
}, void 0, "Page"), _PaginationSeparator2 || (_PaginationSeparator2 = /*#__PURE__*/_jsx(PaginationSeparator, {
|
|
101
102
|
height: "100%"
|
|
102
|
-
}), /*#__PURE__*/
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
103
|
+
})), _span2 || (_span2 = /*#__PURE__*/_jsx("span", {}, void 0, pageDetailsTitle))) : 'Page'
|
|
104
|
+
}, void 0, /*#__PURE__*/_jsx(PaginationDropdownButton, {
|
|
105
|
+
buttonType: "raw",
|
|
106
|
+
onClick: () => setIsOpened(true),
|
|
107
|
+
innerRef: btnRef
|
|
108
|
+
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
109
|
+
style: {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
gridGap: '8px',
|
|
112
|
+
alignItems: 'center'
|
|
113
|
+
}
|
|
114
|
+
}, void 0, /*#__PURE__*/jsxs(Grid, {
|
|
115
|
+
cols: ['auto', 'auto', 'auto'],
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
gutter: "xxxs",
|
|
118
|
+
ref: pageInfoRef,
|
|
119
|
+
children: [/*#__PURE__*/_jsx(PaginationBoldText, {
|
|
120
|
+
fontSize: "18px"
|
|
121
|
+
}, void 0, pageIndex + 1), " / ", pageCount]
|
|
122
|
+
}), pageDetails.length !== 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
123
|
+
children: [_PaginationSeparator3 || (_PaginationSeparator3 = /*#__PURE__*/_jsx(PaginationSeparator, {
|
|
124
|
+
height: "12px",
|
|
125
|
+
ml: "8px"
|
|
126
|
+
})), /*#__PURE__*/_jsx(PaginationBoldText, {
|
|
127
|
+
fontSize: "13px",
|
|
128
|
+
mr: "8px"
|
|
129
|
+
}, void 0, pageDetails[pageIndex])]
|
|
130
|
+
}), /*#__PURE__*/_jsx(ChevronDown, {
|
|
131
|
+
color: ['brand-primary', '700']
|
|
132
|
+
})))), _PaginationSeparator4 || (_PaginationSeparator4 = /*#__PURE__*/_jsx(PaginationSeparator, {}))]
|
|
133
|
+
});
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
export { Paginator as default };
|
|
135
|
-
//# sourceMappingURL=Paginator.js.map
|