@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.
Files changed (83) hide show
  1. package/dist/cjs/Pagination.js +61 -0
  2. package/dist/cjs/Pagination.js.map +7 -0
  3. package/dist/cjs/PaginationDataTestID.js +39 -0
  4. package/dist/cjs/PaginationDataTestID.js.map +7 -0
  5. package/dist/cjs/hooks/usePaginationSearch.js +60 -0
  6. package/dist/cjs/hooks/usePaginationSearch.js.map +7 -0
  7. package/dist/cjs/index.d.js +27 -0
  8. package/dist/cjs/index.d.js.map +7 -0
  9. package/dist/cjs/index.js +28 -0
  10. package/dist/cjs/index.js.map +7 -0
  11. package/dist/cjs/parts/PageNextButton.js +53 -0
  12. package/dist/cjs/parts/PageNextButton.js.map +7 -0
  13. package/dist/cjs/parts/PagePrevButton.js +49 -0
  14. package/dist/cjs/parts/PagePrevButton.js.map +7 -0
  15. package/dist/cjs/parts/PaginationContent.js +111 -0
  16. package/dist/cjs/parts/PaginationContent.js.map +7 -0
  17. package/dist/cjs/parts/Paginator.js +148 -0
  18. package/dist/cjs/parts/Paginator.js.map +7 -0
  19. package/dist/cjs/parts/PerPageSelector.js +106 -0
  20. package/dist/cjs/parts/PerPageSelector.js.map +7 -0
  21. package/dist/cjs/props.js +82 -0
  22. package/dist/cjs/props.js.map +7 -0
  23. package/dist/cjs/styled.js +130 -0
  24. package/dist/cjs/styled.js.map +7 -0
  25. package/dist/esm/Pagination.js +34 -0
  26. package/dist/esm/Pagination.js.map +7 -0
  27. package/dist/esm/PaginationDataTestID.js +10 -0
  28. package/dist/esm/PaginationDataTestID.js.map +7 -0
  29. package/{esm → dist/esm}/hooks/usePaginationSearch.js +16 -13
  30. package/dist/esm/hooks/usePaginationSearch.js.map +7 -0
  31. package/dist/esm/index.d.js +2 -0
  32. package/dist/esm/index.d.js.map +7 -0
  33. package/dist/esm/index.js +3 -0
  34. package/dist/esm/index.js.map +7 -0
  35. package/dist/esm/parts/PageNextButton.js +24 -0
  36. package/dist/esm/parts/PageNextButton.js.map +7 -0
  37. package/dist/esm/parts/PagePrevButton.js +20 -0
  38. package/dist/esm/parts/PagePrevButton.js.map +7 -0
  39. package/dist/esm/parts/PaginationContent.js +84 -0
  40. package/dist/esm/parts/PaginationContent.js.map +7 -0
  41. package/dist/esm/parts/Paginator.js +124 -0
  42. package/dist/esm/parts/Paginator.js.map +7 -0
  43. package/dist/esm/parts/PerPageSelector.js +77 -0
  44. package/dist/esm/parts/PerPageSelector.js.map +7 -0
  45. package/dist/esm/props.js +53 -0
  46. package/dist/esm/props.js.map +7 -0
  47. package/dist/esm/styled.js +106 -0
  48. package/dist/esm/styled.js.map +7 -0
  49. package/package.json +53 -45
  50. package/cjs/Pagination.js +0 -35
  51. package/cjs/PaginationDataTestID.js +0 -11
  52. package/cjs/hooks/usePaginationSearch.js +0 -32
  53. package/cjs/index.d.js +0 -2
  54. package/cjs/index.js +0 -10
  55. package/cjs/parts/PageNextButton.js +0 -33
  56. package/cjs/parts/PagePrevButton.js +0 -32
  57. package/cjs/parts/PaginationContent.js +0 -95
  58. package/cjs/parts/Paginator.js +0 -163
  59. package/cjs/parts/PerPageSelector.js +0 -110
  60. package/cjs/props.js +0 -53
  61. package/cjs/styled.js +0 -57
  62. package/esm/Pagination.js +0 -26
  63. package/esm/PaginationDataTestID.js +0 -7
  64. package/esm/index.d.js +0 -1
  65. package/esm/index.js +0 -1
  66. package/esm/parts/PageNextButton.js +0 -25
  67. package/esm/parts/PagePrevButton.js +0 -24
  68. package/esm/parts/PaginationContent.js +0 -85
  69. package/esm/parts/Paginator.js +0 -156
  70. package/esm/parts/PerPageSelector.js +0 -103
  71. package/esm/props.js +0 -48
  72. package/esm/styled.js +0 -40
  73. package/types/Pagination.d.ts +0 -5
  74. package/types/PaginationDataTestID.d.ts +0 -5
  75. package/types/hooks/usePaginationSearch.d.ts +0 -1
  76. package/types/index.d.ts +0 -1
  77. package/types/parts/PageNextButton.d.ts +0 -3
  78. package/types/parts/PagePrevButton.d.ts +0 -3
  79. package/types/parts/PaginationContent.d.ts +0 -3
  80. package/types/parts/Paginator.d.ts +0 -10
  81. package/types/parts/PerPageSelector.d.ts +0 -4
  82. package/types/props.d.ts +0 -20
  83. package/types/styled.d.ts +0 -10
@@ -0,0 +1,106 @@
1
+ import * as React from "react";
2
+ import { Grid } from "@elliemae/ds-grid";
3
+ import { DSButtonV2 } from "@elliemae/ds-button";
4
+ import styled from "styled-components";
5
+ import {
6
+ space,
7
+ typography,
8
+ sizing,
9
+ layout
10
+ } from "@xstyled/styled-components";
11
+ import { css } from "@elliemae/ds-system";
12
+ const styledFocusCss = css`
13
+ &:after {
14
+ display: block;
15
+ content: ' ';
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ right: 0;
20
+ bottom: 0;
21
+ border: 2px solid ${({ theme }) => theme.colors.brand[700]};
22
+ pointer-events: none;
23
+ z-index: 7;
24
+ }
25
+ `;
26
+ const PaginationContainer = styled(Grid)`
27
+ height: 42px;
28
+ max-width: 100%;
29
+ align-items: center;
30
+ box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.5);
31
+ `;
32
+ const PaginationWrapper = styled.div`
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ `;
37
+ const PaginationSeparator = styled(Grid)`
38
+ background-color: ${(props) => props.theme.colors.neutral[300]};
39
+ width: 1px;
40
+ height: ${(props) => props.height || "30px"};
41
+ `;
42
+ const PaginationBoldText = styled.span`
43
+ font-weight: ${(props) => props.theme.fontWeights.semibold};
44
+ ${typography}
45
+ ${space}
46
+ ${sizing}
47
+ ${layout}
48
+ position: relative;
49
+ `;
50
+ const InvisibleDetail = styled.div`
51
+ opacity: 0;
52
+ white-space: nowrap;
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+ position: absolute;
56
+ `;
57
+ const PaginationDetail = styled.span`
58
+ text-align: left;
59
+ white-space: nowrap;
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ `;
63
+ const PaginationDropdownButton = styled(DSButtonV2)`
64
+ height: 42px;
65
+ display: grid;
66
+ grid-auto-flow: column;
67
+ justify-content: center;
68
+ align-items: center;
69
+ position: relative;
70
+ padding-left: 16px;
71
+ padding-right: 16px;
72
+ grid-gap: 8px;
73
+ font-size: 13px;
74
+ color: ${(props) => props.theme.colors.neutral[700]};
75
+ cursor: pointer;
76
+ border-radius: 0;
77
+ font-weight: ${(props) => props.theme.fontWeights.regular};
78
+ :focus {
79
+ ${styledFocusCss}
80
+ }
81
+ white-space: nowrap;
82
+ `;
83
+ const PreviousNextPageButton = styled(DSButtonV2)`
84
+ height: 42px;
85
+ display: grid;
86
+ place-items: center;
87
+ position: relative;
88
+ padding-left: 8px;
89
+ padding-right: 8px;
90
+ border-radius: 0;
91
+ cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
92
+ :focus {
93
+ ${styledFocusCss}
94
+ }
95
+ `;
96
+ export {
97
+ InvisibleDetail,
98
+ PaginationBoldText,
99
+ PaginationContainer,
100
+ PaginationDetail,
101
+ PaginationDropdownButton,
102
+ PaginationSeparator,
103
+ PaginationWrapper,
104
+ PreviousNextPageButton
105
+ };
106
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport styled from 'styled-components';\nimport {\n space,\n typography,\n TypographyProps,\n SpaceProps,\n sizing,\n SizingProps,\n layout,\n LayoutProps,\n} from '@xstyled/styled-components';\nimport { css } from '@elliemae/ds-system';\n\nconst styledFocusCss = css`\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 ${({ theme }) => theme.colors.brand[700]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nexport const PaginationContainer = styled(Grid)`\n height: 42px;\n max-width: 100%;\n align-items: center;\n box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.5);\n`;\n\nexport const PaginationWrapper = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const PaginationSeparator = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral[300]};\n width: 1px;\n height: ${(props) => props.height || '30px'};\n`;\n\nexport const PaginationBoldText = styled.span<TypographyProps & SpaceProps & SizingProps & LayoutProps>`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n ${typography}\n ${space}\n ${sizing}\n ${layout}\n position: relative;\n`;\n\nexport const InvisibleDetail = styled.div`\n opacity: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n position: absolute;\n`;\n\nexport const PaginationDetail = styled.span`\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const PaginationDropdownButton = styled(DSButtonV2)`\n height: 42px;\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n position: relative;\n padding-left: 16px;\n padding-right: 16px;\n grid-gap: 8px;\n font-size: 13px;\n color: ${(props) => props.theme.colors.neutral[700]};\n cursor: pointer;\n border-radius: 0;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n :focus {\n ${styledFocusCss}\n }\n white-space: nowrap;\n`;\n\nexport const PreviousNextPageButton = styled(DSButtonV2)`\n height: 42px;\n display: grid;\n place-items: center;\n position: relative;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 0;\n cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n :focus {\n ${styledFocusCss}\n }\n`;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AAEA,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASC,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAMnD,MAAM,sBAAsB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOnC,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AAMjC,MAAM,sBAAsB,OAAO;AAAA,sBACpB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,YAEhD,CAAC,UAAU,MAAM,UAAU;AAAA;AAGhC,MAAM,qBAAqB,OAAO;AAAA,iBACxB,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,IAChD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAIG,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ/B,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhC,MAAM,2BAA2B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAWpC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,iBAGhC,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA,MAE9C;AAAA;AAAA;AAAA;AAKC,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQjC,CAAC,UAAW,MAAM,WAAW,gBAAgB;AAAA;AAAA,MAEnD;AAAA;AAAA;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,55 +1,58 @@
1
1
  {
2
2
  "name": "@elliemae/ds-pagination",
3
- "version": "2.3.1",
3
+ "version": "3.0.0-alpha.3",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Pagination",
6
- "module": "./esm/index.js",
7
- "main": "./cjs/index.js",
8
- "types": "./types/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
9
12
  "exports": {
10
13
  ".": {
11
- "import": "./esm/index.js",
12
- "require": "./cjs/index.js"
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
13
16
  },
14
17
  "./styled": {
15
- "import": "./esm/styled.js",
16
- "require": "./cjs/styled.js"
18
+ "import": "./dist/esm/styled.js",
19
+ "require": "./dist/cjs/styled.js"
17
20
  },
18
21
  "./props": {
19
- "import": "./esm/props.js",
20
- "require": "./cjs/props.js"
22
+ "import": "./dist/esm/props.js",
23
+ "require": "./dist/cjs/props.js"
21
24
  },
22
25
  "./parts/PerPageSelector": {
23
- "import": "./esm/parts/PerPageSelector.js",
24
- "require": "./cjs/parts/PerPageSelector.js"
26
+ "import": "./dist/esm/parts/PerPageSelector.js",
27
+ "require": "./dist/cjs/parts/PerPageSelector.js"
25
28
  },
26
29
  "./parts/Paginator": {
27
- "import": "./esm/parts/Paginator.js",
28
- "require": "./cjs/parts/Paginator.js"
30
+ "import": "./dist/esm/parts/Paginator.js",
31
+ "require": "./dist/cjs/parts/Paginator.js"
29
32
  },
30
33
  "./parts/PaginationContent": {
31
- "import": "./esm/parts/PaginationContent.js",
32
- "require": "./cjs/parts/PaginationContent.js"
34
+ "import": "./dist/esm/parts/PaginationContent.js",
35
+ "require": "./dist/cjs/parts/PaginationContent.js"
33
36
  },
34
37
  "./parts/PagePrevButton": {
35
- "import": "./esm/parts/PagePrevButton.js",
36
- "require": "./cjs/parts/PagePrevButton.js"
38
+ "import": "./dist/esm/parts/PagePrevButton.js",
39
+ "require": "./dist/cjs/parts/PagePrevButton.js"
37
40
  },
38
41
  "./parts/PageNextButton": {
39
- "import": "./esm/parts/PageNextButton.js",
40
- "require": "./cjs/parts/PageNextButton.js"
42
+ "import": "./dist/esm/parts/PageNextButton.js",
43
+ "require": "./dist/cjs/parts/PageNextButton.js"
41
44
  },
42
45
  "./PaginationDataTestID": {
43
- "import": "./esm/PaginationDataTestID.js",
44
- "require": "./cjs/PaginationDataTestID.js"
46
+ "import": "./dist/esm/PaginationDataTestID.js",
47
+ "require": "./dist/cjs/PaginationDataTestID.js"
45
48
  },
46
49
  "./Pagination": {
47
- "import": "./esm/Pagination.js",
48
- "require": "./cjs/Pagination.js"
50
+ "import": "./dist/esm/Pagination.js",
51
+ "require": "./dist/cjs/Pagination.js"
49
52
  },
50
53
  "./hooks/usePaginationSearch": {
51
- "import": "./esm/hooks/usePaginationSearch.js",
52
- "require": "./cjs/hooks/usePaginationSearch.js"
54
+ "import": "./dist/esm/hooks/usePaginationSearch.js",
55
+ "require": "./dist/cjs/hooks/usePaginationSearch.js"
53
56
  }
54
57
  },
55
58
  "sideEffects": [
@@ -61,27 +64,26 @@
61
64
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
62
65
  },
63
66
  "engines": {
64
- "npm": ">=7",
65
- "node": ">=14"
67
+ "pnpm": ">=6",
68
+ "node": ">=16"
66
69
  },
67
70
  "author": "ICE MT",
68
- "scripts": {
69
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
70
- "prebuild": "exit 0",
71
- "predev": "exit 0",
72
- "build": "node ../../scripts/build/build.js"
71
+ "jestSonar": {
72
+ "sonar56x": true,
73
+ "reportPath": "reports",
74
+ "reportFile": "tests.xml",
75
+ "indent": 4
73
76
  },
74
77
  "dependencies": {
75
- "@elliemae/ds-button": "2.3.1",
76
- "@elliemae/ds-dropdownmenu": "2.3.1",
77
- "@elliemae/ds-grid": "2.3.1",
78
- "@elliemae/ds-icons": "2.3.1",
79
- "@elliemae/ds-props-helpers": "2.3.1",
80
- "@elliemae/ds-system": "2.3.1",
81
- "@elliemae/ds-truncated-tooltip-text": "2.3.1",
82
- "@elliemae/ds-utilities": "2.3.1",
83
- "@xstyled/styled-components": "~3.1.1",
84
- "memoize-one": "~5.1.1"
78
+ "@elliemae/ds-button": "3.0.0-alpha.3",
79
+ "@elliemae/ds-dropdownmenu": "3.0.0-alpha.3",
80
+ "@elliemae/ds-grid": "3.0.0-alpha.3",
81
+ "@elliemae/ds-icons": "3.0.0-alpha.3",
82
+ "@elliemae/ds-props-helpers": "3.0.0-alpha.3",
83
+ "@elliemae/ds-truncated-tooltip-text": "3.0.0-alpha.3",
84
+ "@elliemae/ds-utilities": "3.0.0-alpha.3",
85
+ "memoize-one": "~5.1.1",
86
+ "react-desc": "~4.1.3"
85
87
  },
86
88
  "devDependencies": {
87
89
  "styled-components": "~5.3.3",
@@ -96,7 +98,13 @@
96
98
  },
97
99
  "publishConfig": {
98
100
  "access": "public",
99
- "directory": "dist",
100
- "generateSubmodules": true
101
+ "typeSafety": false
102
+ },
103
+ "scripts": {
104
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
105
+ "test": "node ../../scripts/testing/test.mjs",
106
+ "lint": "node ../../scripts/lint.mjs",
107
+ "dts": "node ../../scripts/dts.mjs",
108
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
101
109
  }
102
110
  }
package/cjs/Pagination.js DELETED
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.filter.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.filter.js');
8
- require('core-js/modules/esnext.async-iterator.for-each.js');
9
- require('core-js/modules/esnext.iterator.for-each.js');
10
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
11
- require('react');
12
- var dsPropsHelpers = require('@elliemae/ds-props-helpers');
13
- var PaginationContent = require('./parts/PaginationContent.js');
14
- var props = require('./props.js');
15
- var jsxRuntime = require('react/jsx-runtime');
16
-
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
20
-
21
- 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; }
22
-
23
- 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__default["default"](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; }
24
-
25
- const DSPagination = props$1 => {
26
- const propsWithDefault = dsPropsHelpers.useMemoMergePropsWithDefault(props$1, props.defaultProps);
27
- dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefault, props.propTypes);
28
- return /*#__PURE__*/jsxRuntime.jsx(PaginationContent.PaginationContent, _objectSpread({}, propsWithDefault));
29
- };
30
-
31
- const DSPaginationWithSchema = dsPropsHelpers.describe(DSPagination).description('DSPagination');
32
- DSPaginationWithSchema.propTypes = props.propTypes;
33
-
34
- exports.DSPagination = DSPagination;
35
- exports.DSPaginationWithSchema = DSPaginationWithSchema;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const PAGINATION_DATA_TESTID = {
6
- PREVIOUS_BUTTON: 'data-table-pagination-prev-button',
7
- NEXT_BUTTON: 'data-table-pagination-next-button',
8
- CONTAINER: 'data-table-pagination-container'
9
- };
10
-
11
- exports.PAGINATION_DATA_TESTID = PAGINATION_DATA_TESTID;
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
- var react = require('react');
7
-
8
- const usePaginationSearch = (pageCount, actionRef) => {
9
- const [searchValue, setSearchValue] = react.useState('');
10
- const [shouldResetSearchValue, setShouldResetSearchValue] = react.useState(true);
11
- const timeoutRef = react.useRef(null);
12
- react.useEffect(() => {
13
- if (searchValue !== '' && Number.parseInt(searchValue, 10) <= pageCount) {
14
- actionRef.current.setActiveDescendant(searchValue);
15
- actionRef.current.scrollOptionIntoView(searchValue);
16
- } // eslint-disable-next-line react-hooks/exhaustive-deps
17
-
18
- }, [searchValue]);
19
- const onKeyDown = react.useCallback(e => {
20
- if (e.code.startsWith('Digit')) {
21
- if (shouldResetSearchValue) setSearchValue(e.key);else setSearchValue(prevValue => prevValue + e.key);
22
- setShouldResetSearchValue(false);
23
- clearTimeout(timeoutRef.current);
24
- timeoutRef.current = setTimeout(() => {
25
- setShouldResetSearchValue(true);
26
- }, 1000);
27
- }
28
- }, [shouldResetSearchValue]);
29
- return onKeyDown;
30
- };
31
-
32
- exports.usePaginationSearch = usePaginationSearch;
package/cjs/index.d.js DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
package/cjs/index.js DELETED
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var Pagination = require('./Pagination.js');
6
-
7
-
8
-
9
- exports.DSPagination = Pagination.DSPagination;
10
- exports.DSPaginationWithSchema = Pagination.DSPaginationWithSchema;
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var dsIcons = require('@elliemae/ds-icons');
8
- var PaginationDataTestID = require('../PaginationDataTestID.js');
9
- var styled = require('../styled.js');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
14
-
15
- const PageNextButton = _ref => {
16
- let {
17
- onNextPage,
18
- canNextPage
19
- } = _ref;
20
- return /*#__PURE__*/_jsx__default["default"](styled.PreviousNextPageButton, {
21
- onClick: () => {
22
- if (canNextPage) onNextPage();
23
- },
24
- disabled: !canNextPage,
25
- buttonType: "raw",
26
- "data-testid": PaginationDataTestID.PAGINATION_DATA_TESTID.NEXT_BUTTON,
27
- HeaderComp: () => 'Page'
28
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronRight, {
29
- color: canNextPage ? ['brand-primary', '700'] : ['neutral', '500']
30
- }));
31
- };
32
-
33
- exports.PageNextButton = PageNextButton;
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- require('react');
7
- var dsIcons = require('@elliemae/ds-icons');
8
- var PaginationDataTestID = require('../PaginationDataTestID.js');
9
- var styled = require('../styled.js');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
14
-
15
- const PagePrevButton = _ref => {
16
- let {
17
- onPreviousPage,
18
- canPreviousPage
19
- } = _ref;
20
- return /*#__PURE__*/_jsx__default["default"](styled.PreviousNextPageButton, {
21
- onClick: () => {
22
- if (canPreviousPage) onPreviousPage();
23
- },
24
- disabled: !canPreviousPage,
25
- buttonType: "raw",
26
- "data-testid": PaginationDataTestID.PAGINATION_DATA_TESTID.PREVIOUS_BUTTON
27
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronLeft, {
28
- color: canPreviousPage ? ['brand-primary', '700'] : ['neutral', '500']
29
- }));
30
- };
31
-
32
- exports.PagePrevButton = PagePrevButton;
@@ -1,95 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.filter.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.filter.js');
8
- require('core-js/modules/esnext.async-iterator.for-each.js');
9
- require('core-js/modules/esnext.iterator.for-each.js');
10
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
11
- var _jsx = require('@babel/runtime/helpers/jsx');
12
- require('react');
13
- var Grid = require('@elliemae/ds-grid');
14
- var dsPropsHelpers = require('@elliemae/ds-props-helpers');
15
- var styled = require('../styled.js');
16
- var PerPageSelector = require('./PerPageSelector.js');
17
- var Paginator = require('./Paginator.js');
18
- var PaginationDataTestID = require('../PaginationDataTestID.js');
19
- var PagePrevButton = require('./PagePrevButton.js');
20
- var PageNextButton = require('./PageNextButton.js');
21
- var jsxRuntime = require('react/jsx-runtime');
22
-
23
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
24
-
25
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
26
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
27
- var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
28
-
29
- var _PaginationSeparator;
30
-
31
- 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; }
32
-
33
- 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__default["default"](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; }
34
- const PaginationContent = props => {
35
- const {
36
- pageIndex,
37
- pageSize,
38
- canPreviousPage,
39
- canNextPage,
40
- onPageSizeChange,
41
- onNextPage,
42
- onPreviousPage,
43
- onPageChange,
44
- pageCount,
45
- showPerPageSelector,
46
- pageDetails,
47
- pageDetailsTitle,
48
- perPageOptions,
49
- maxPerPage,
50
- perPageStep,
51
- minPerPage,
52
- width
53
- } = props;
54
- const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(props);
55
- return /*#__PURE__*/jsxRuntime.jsx(styled.PaginationContainer, _objectSpread(_objectSpread({
56
- justifyContent: "center",
57
- alignItems: "center",
58
- width: width.toString(),
59
- "data-testid": PaginationDataTestID.PAGINATION_DATA_TESTID.CONTAINER,
60
- cols: ['minmax(auto, 80%)']
61
- }, globalAttributes), {}, {
62
- children: /*#__PURE__*/_jsx__default["default"](styled.PaginationWrapper, {}, void 0, showPerPageSelector && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
63
- children: [/*#__PURE__*/_jsx__default["default"](PerPageSelector, {
64
- pageSize: pageSize,
65
- onPageSizeChange: onPageSizeChange,
66
- perPageOptions: perPageOptions,
67
- maxPerPage: maxPerPage,
68
- perPageStep: perPageStep,
69
- minPerPage: minPerPage
70
- }), _PaginationSeparator || (_PaginationSeparator = /*#__PURE__*/_jsx__default["default"](styled.PaginationSeparator, {
71
- mr: 24
72
- }))]
73
- }), /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
74
- mr: "32px",
75
- alignItems: "center",
76
- style: {
77
- gridAutoFlow: 'column'
78
- }
79
- }, void 0, /*#__PURE__*/_jsx__default["default"](PagePrevButton.PagePrevButton, {
80
- canPreviousPage: canPreviousPage,
81
- onPreviousPage: onPreviousPage
82
- }), /*#__PURE__*/_jsx__default["default"](Paginator, {
83
- pageCount: pageCount,
84
- pageIndex: pageIndex,
85
- onPageChange: onPageChange,
86
- pageDetails: pageDetails,
87
- pageDetailsTitle: pageDetailsTitle
88
- }), /*#__PURE__*/_jsx__default["default"](PageNextButton.PageNextButton, {
89
- canNextPage: canNextPage,
90
- onNextPage: onNextPage
91
- })))
92
- }));
93
- };
94
-
95
- exports.PaginationContent = PaginationContent;