@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.
Files changed (70) hide show
  1. package/cjs/Pagination.js +21 -29
  2. package/cjs/PaginationDataTestID.js +1 -2
  3. package/cjs/hooks/usePaginationSearch.js +11 -26
  4. package/cjs/index.d.js +0 -1
  5. package/cjs/index.js +1 -24
  6. package/cjs/parts/PageNextButton.js +12 -17
  7. package/cjs/parts/PagePrevButton.js +11 -14
  8. package/cjs/parts/PaginationContent.js +45 -50
  9. package/cjs/parts/Paginator.js +112 -113
  10. package/cjs/parts/PerPageSelector.js +44 -46
  11. package/cjs/props.js +14 -20
  12. package/cjs/styled.js +16 -31
  13. package/esm/Pagination.js +20 -29
  14. package/esm/PaginationDataTestID.js +1 -2
  15. package/esm/hooks/usePaginationSearch.js +9 -20
  16. package/esm/index.d.js +0 -1
  17. package/esm/index.js +1 -24
  18. package/esm/parts/PageNextButton.js +11 -16
  19. package/esm/parts/PagePrevButton.js +10 -13
  20. package/esm/parts/PaginationContent.js +40 -45
  21. package/esm/parts/Paginator.js +110 -109
  22. package/esm/parts/PerPageSelector.js +43 -43
  23. package/esm/props.js +14 -20
  24. package/esm/styled.js +16 -31
  25. package/package.json +77 -16
  26. package/types/Pagination.d.ts +5 -0
  27. package/types/PaginationDataTestID.d.ts +5 -0
  28. package/types/hooks/usePaginationSearch.d.ts +1 -0
  29. package/types/index.d.ts +1 -0
  30. package/types/parts/PageNextButton.d.ts +3 -0
  31. package/types/parts/PagePrevButton.d.ts +3 -0
  32. package/types/parts/PaginationContent.d.ts +3 -0
  33. package/types/parts/Paginator.d.ts +4 -0
  34. package/types/parts/PerPageSelector.d.ts +4 -0
  35. package/types/props.d.ts +75 -0
  36. package/types/styled.d.ts +13 -0
  37. package/Pagination/package.json +0 -10
  38. package/PaginationDataTestID/package.json +0 -10
  39. package/cjs/Pagination.js.map +0 -1
  40. package/cjs/PaginationDataTestID.js.map +0 -1
  41. package/cjs/hooks/usePaginationSearch.js.map +0 -1
  42. package/cjs/index.d.js.map +0 -1
  43. package/cjs/index.js.map +0 -1
  44. package/cjs/parts/PageNextButton.js.map +0 -1
  45. package/cjs/parts/PagePrevButton.js.map +0 -1
  46. package/cjs/parts/PaginationContent.js.map +0 -1
  47. package/cjs/parts/Paginator.js.map +0 -1
  48. package/cjs/parts/PerPageSelector.js.map +0 -1
  49. package/cjs/props.js.map +0 -1
  50. package/cjs/styled.js.map +0 -1
  51. package/esm/Pagination.js.map +0 -1
  52. package/esm/PaginationDataTestID.js.map +0 -1
  53. package/esm/hooks/usePaginationSearch.js.map +0 -1
  54. package/esm/index.d.js.map +0 -1
  55. package/esm/index.js.map +0 -1
  56. package/esm/parts/PageNextButton.js.map +0 -1
  57. package/esm/parts/PagePrevButton.js.map +0 -1
  58. package/esm/parts/PaginationContent.js.map +0 -1
  59. package/esm/parts/Paginator.js.map +0 -1
  60. package/esm/parts/PerPageSelector.js.map +0 -1
  61. package/esm/props.js.map +0 -1
  62. package/esm/styled.js.map +0 -1
  63. package/hooks/usePaginationSearch/package.json +0 -10
  64. package/parts/PageNextButton/package.json +0 -10
  65. package/parts/PagePrevButton/package.json +0 -10
  66. package/parts/PaginationContent/package.json +0 -10
  67. package/parts/Paginator/package.json +0 -10
  68. package/parts/PerPageSelector/package.json +0 -10
  69. package/props/package.json +0 -10
  70. package/styled/package.json +0 -10
@@ -1,33 +1,23 @@
1
- import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
2
  import { useState, useRef, useEffect, useCallback } from 'react';
3
3
 
4
- var usePaginationSearch = function usePaginationSearch(pageCount, actionRef) {
5
- var _useState = useState(''),
6
- _useState2 = _slicedToArray(_useState, 2),
7
- searchValue = _useState2[0],
8
- setSearchValue = _useState2[1];
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
- var onKeyDown = useCallback(function (e) {
15
+ const onKeyDown = useCallback(e => {
24
16
  if (e.code.startsWith('Digit')) {
25
- if (shouldResetSearchValue) setSearchValue(e.key);else setSearchValue(function (prevValue) {
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(function () {
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
@@ -1,2 +1 @@
1
1
 
2
- //# sourceMappingURL=index.d.js.map
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 React from 'react';
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
- /* eslint-disable react/prop-types */
11
- var PageNextButton = function PageNextButton(_ref) {
12
- var onNextPage = _ref.onNextPage,
13
- canNextPage = _ref.canNextPage;
14
- return /*#__PURE__*/React.createElement(PreviousNextPageButton, {
15
- onClick: function onClick() {
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: function HeaderComp() {
22
- return 'Page';
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 React from 'react';
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
- /* eslint-disable react/prop-types */
11
- var PagePrevButton = function PagePrevButton(_ref) {
12
- var onPreviousPage = _ref.onPreviousPage,
13
- canPreviousPage = _ref.canPreviousPage;
14
- return /*#__PURE__*/React.createElement(PreviousNextPageButton, {
15
- onClick: function onClick() {
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__*/React.createElement(ChevronLeft, {
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 React from 'react';
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 '@elliemae/ds-button';
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
- /* eslint-disable react/prop-types */
21
- var PaginationContent = function PaginationContent(_ref) {
22
- var pageIndex = _ref.pageIndex,
23
- pageSize = _ref.pageSize,
24
- canPreviousPage = _ref.canPreviousPage,
25
- canNextPage = _ref.canNextPage,
26
- onPageSizeChange = _ref.onPageSizeChange,
27
- onNextPage = _ref.onNextPage,
28
- onPreviousPage = _ref.onPreviousPage,
29
- onPageChange = _ref.onPageChange,
30
- pageCount = _ref.pageCount,
31
- showPerPageSelector = _ref.showPerPageSelector,
32
- pageDetails = _ref.pageDetails,
33
- pageDetailsTitle = _ref.pageDetailsTitle,
34
- perPageOptions = _ref.perPageOptions,
35
- maxPerPage = _ref.maxPerPage,
36
- perPageStep = _ref.perPageStep,
37
- minPerPage = _ref.minPerPage,
38
- width = _ref.width;
39
- return /*#__PURE__*/React.createElement(PaginationContainer, {
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__*/React.createElement(PaginationWrapper, null, showPerPageSelector && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PerPageSelector, {
45
- pageSize: pageSize,
46
- onPageSizeChange: onPageSizeChange,
47
- perPageOptions: perPageOptions,
48
- maxPerPage: maxPerPage,
49
- perPageStep: perPageStep,
50
- minPerPage: minPerPage
51
- }), /*#__PURE__*/React.createElement(PaginationSeparator, {
52
- mr: 24
53
- })), /*#__PURE__*/React.createElement(Grid, {
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__*/React.createElement(PagePrevButton, {
53
+ }, void 0, /*#__PURE__*/_jsx(PagePrevButton, {
58
54
  canPreviousPage: canPreviousPage,
59
55
  onPreviousPage: onPreviousPage
60
- }), /*#__PURE__*/React.createElement(Paginator, {
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__*/React.createElement(PageNextButton, {
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
@@ -1,135 +1,136 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
3
- import React, { useState, useRef, useMemo, useEffect } from 'react';
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 '@elliemae/ds-button';
11
- import 'styled-components';
12
- import 'styled-system';
12
+ import { jsxs, Fragment } from 'react/jsx-runtime';
13
13
 
14
- var Paginator = function Paginator(props) {
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
- var _useState = useState(false),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- isOpened = _useState2[0],
24
- setIsOpened = _useState2[1];
16
+ const Paginator = props => {
17
+ var _span2;
25
18
 
26
- var btnRef = useRef(null);
27
- var pageInfoRef = useRef(null);
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
- var _useOnElementResize = useOnElementResize(btnRef),
30
- btnWidth = _useOnElementResize.width;
38
+ const option = {
39
+ dsId: (index + 1).toString(),
40
+ label: (index + 1).toString(),
41
+ value: index + 1,
42
+ type: 'single'
43
+ };
31
44
 
32
- var _useOnElementResize2 = useOnElementResize(pageInfoRef),
33
- txtWidth = _useOnElementResize2.width;
34
-
35
- var options = useMemo(function () {
36
- return new Array(pageCount).fill(0).map(function (_, index) {
37
- var option = {
38
- dsId: (index + 1).toString(),
39
- label: (index + 1).toString(),
40
- value: index + 1,
41
- type: 'single'
42
- };
43
-
44
- if (pageDetails.length) {
45
- option.render = function () {
46
- return /*#__PURE__*/React.createElement(Grid, {
47
- cols: ['16px', "".concat(txtWidth + 16, "px"), 'auto'],
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
- return option;
64
- });
65
- }, [pageCount, pageDetails, pageIndex, txtWidth]);
66
- var actionRef = useRef({});
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
- var onKeyDown = usePaginationSearch(pageCount, actionRef);
75
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PaginationSeparator, null), /*#__PURE__*/React.createElement(DSDropdownMenuV2, {
76
- isOpened: isOpened,
77
- options: options,
78
- selectedOptions: _defineProperty({}, (pageIndex + 1).toString(), true),
79
- onOptionClick: function onOptionClick(_, clickedOption) {
80
- onPageChange(clickedOption.value);
81
- setIsOpened(false);
82
- btnRef.current.focus();
83
- },
84
- onClickOutside: function onClickOutside() {
85
- setIsOpened(false);
86
- btnRef.current.focus();
87
- },
88
- startPlacementPreference: "top-end",
89
- actionRef: actionRef,
90
- onKeyDown: onKeyDown,
91
- minWidth: btnWidth + 23,
92
- maxHeight: 300,
93
- HeaderComp: function HeaderComp() {
94
- return pageDetailsTitle !== '' ? /*#__PURE__*/React.createElement(Grid, {
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__*/React.createElement("span", {
97
+ }, void 0, /*#__PURE__*/_jsx("span", {
97
98
  style: {
98
99
  marginLeft: '8px'
99
100
  }
100
- }, "Page"), /*#__PURE__*/React.createElement(PaginationSeparator, {
101
+ }, void 0, "Page"), _PaginationSeparator2 || (_PaginationSeparator2 = /*#__PURE__*/_jsx(PaginationSeparator, {
101
102
  height: "100%"
102
- }), /*#__PURE__*/React.createElement("span", null, pageDetailsTitle)) : 'Page';
103
- }
104
- }, /*#__PURE__*/React.createElement(PaginationDropdownButton, {
105
- buttonType: "raw",
106
- onClick: function onClick() {
107
- return setIsOpened(true);
108
- },
109
- innerRef: btnRef
110
- }, /*#__PURE__*/React.createElement("div", {
111
- style: {
112
- display: 'flex',
113
- gridGap: '8px',
114
- alignItems: 'center'
115
- }
116
- }, /*#__PURE__*/React.createElement(Grid, {
117
- cols: ['auto', 'auto', 'auto'],
118
- alignItems: "center",
119
- gutter: "xxxs",
120
- ref: pageInfoRef
121
- }, /*#__PURE__*/React.createElement(PaginationBoldText, {
122
- fontSize: "18px"
123
- }, pageIndex + 1), " / ", pageCount), pageDetails.length !== 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PaginationSeparator, {
124
- height: "12px",
125
- ml: "8px"
126
- }), /*#__PURE__*/React.createElement(PaginationBoldText, {
127
- fontSize: "13px",
128
- mr: "8px"
129
- }, pageDetails[pageIndex])), /*#__PURE__*/React.createElement(ChevronDown, {
130
- color: ['brand-primary', '700']
131
- })))), /*#__PURE__*/React.createElement(PaginationSeparator, null));
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