@elliemae/ds-pagination 3.15.0 → 3.16.0-next.10

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 (134) hide show
  1. package/dist/cjs/DSPaginationDefinitions.js +13 -1
  2. package/dist/cjs/DSPaginationDefinitions.js.map +2 -2
  3. package/dist/cjs/Pagination.js +7 -7
  4. package/dist/cjs/Pagination.js.map +2 -2
  5. package/dist/cjs/PaginationDataTestID.js +3 -1
  6. package/dist/cjs/PaginationDataTestID.js.map +2 -2
  7. package/dist/cjs/index.js +32 -2
  8. package/dist/cjs/index.js.map +3 -3
  9. package/dist/cjs/package.json +7 -0
  10. package/dist/cjs/parts/DSPageNextButton.js +70 -0
  11. package/dist/cjs/parts/DSPageNextButton.js.map +7 -0
  12. package/dist/cjs/parts/DSPagePrevButton.js +70 -0
  13. package/dist/cjs/parts/DSPagePrevButton.js.map +7 -0
  14. package/dist/cjs/parts/DSPaginationContainer.js +57 -0
  15. package/dist/cjs/parts/DSPaginationContainer.js.map +7 -0
  16. package/dist/cjs/parts/{PageNextButton.js → DSPaginator/createPaginatorHeader.js} +19 -25
  17. package/dist/cjs/parts/DSPaginator/createPaginatorHeader.js.map +7 -0
  18. package/dist/cjs/parts/DSPaginator/getOptions.js +72 -0
  19. package/dist/cjs/parts/DSPaginator/getOptions.js.map +7 -0
  20. package/dist/cjs/parts/DSPaginator/index.js +144 -0
  21. package/dist/cjs/parts/DSPaginator/index.js.map +7 -0
  22. package/dist/cjs/{hooks → parts/DSPaginator}/usePaginationSearch.js +5 -2
  23. package/dist/cjs/parts/DSPaginator/usePaginationSearch.js.map +7 -0
  24. package/dist/cjs/parts/DSPaginator/usePaginator.js +87 -0
  25. package/dist/cjs/parts/DSPaginator/usePaginator.js.map +7 -0
  26. package/dist/cjs/parts/{PagePrevButton.js → DSPerPageSelector/getOptions.js} +21 -22
  27. package/dist/cjs/parts/DSPerPageSelector/getOptions.js.map +7 -0
  28. package/dist/cjs/parts/{PerPageSelector.js → DSPerPageSelector/index.js} +37 -49
  29. package/dist/cjs/parts/DSPerPageSelector/index.js.map +7 -0
  30. package/dist/cjs/parts/DSPerPageSelector/usePerPageSelector.js +68 -0
  31. package/dist/cjs/parts/DSPerPageSelector/usePerPageSelector.js.map +7 -0
  32. package/dist/cjs/parts/PaginationContent.js +37 -52
  33. package/dist/cjs/parts/PaginationContent.js.map +3 -3
  34. package/dist/cjs/parts/index.js +45 -0
  35. package/dist/cjs/parts/index.js.map +7 -0
  36. package/dist/cjs/props.js +81 -0
  37. package/dist/cjs/props.js.map +7 -0
  38. package/dist/cjs/react-desc-prop-types.js +107 -33
  39. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  40. package/dist/cjs/styled.js +17 -27
  41. package/dist/cjs/styled.js.map +2 -2
  42. package/dist/esm/DSPaginationDefinitions.js +13 -1
  43. package/dist/esm/DSPaginationDefinitions.js.map +2 -2
  44. package/dist/esm/Pagination.js +4 -4
  45. package/dist/esm/Pagination.js.map +1 -1
  46. package/dist/esm/PaginationDataTestID.js +3 -1
  47. package/dist/esm/PaginationDataTestID.js.map +2 -2
  48. package/dist/esm/index.js +39 -1
  49. package/dist/esm/index.js.map +3 -3
  50. package/dist/esm/package.json +7 -0
  51. package/dist/esm/parts/DSPageNextButton.js +50 -0
  52. package/dist/esm/parts/DSPageNextButton.js.map +7 -0
  53. package/dist/esm/parts/DSPagePrevButton.js +50 -0
  54. package/dist/esm/parts/DSPagePrevButton.js.map +7 -0
  55. package/dist/esm/parts/DSPaginationContainer.js +31 -0
  56. package/dist/esm/parts/DSPaginationContainer.js.map +7 -0
  57. package/dist/esm/parts/DSPaginator/createPaginatorHeader.js +20 -0
  58. package/dist/esm/parts/DSPaginator/createPaginatorHeader.js.map +7 -0
  59. package/dist/esm/parts/DSPaginator/getOptions.js +46 -0
  60. package/dist/esm/parts/DSPaginator/getOptions.js.map +7 -0
  61. package/dist/esm/parts/DSPaginator/index.js +118 -0
  62. package/dist/esm/parts/DSPaginator/index.js.map +7 -0
  63. package/dist/esm/{hooks → parts/DSPaginator}/usePaginationSearch.js +5 -2
  64. package/dist/esm/parts/DSPaginator/usePaginationSearch.js.map +7 -0
  65. package/dist/esm/parts/DSPaginator/usePaginator.js +61 -0
  66. package/dist/esm/parts/DSPaginator/usePaginator.js.map +7 -0
  67. package/dist/esm/parts/DSPerPageSelector/getOptions.js +22 -0
  68. package/dist/esm/parts/DSPerPageSelector/getOptions.js.map +7 -0
  69. package/dist/esm/parts/DSPerPageSelector/index.js +76 -0
  70. package/dist/esm/parts/DSPerPageSelector/index.js.map +7 -0
  71. package/dist/esm/parts/DSPerPageSelector/usePerPageSelector.js +42 -0
  72. package/dist/esm/parts/DSPerPageSelector/usePerPageSelector.js.map +7 -0
  73. package/dist/esm/parts/PaginationContent.js +37 -52
  74. package/dist/esm/parts/PaginationContent.js.map +2 -2
  75. package/dist/esm/parts/index.js +19 -0
  76. package/dist/esm/parts/index.js.map +7 -0
  77. package/dist/esm/props.js +55 -0
  78. package/dist/esm/props.js.map +7 -0
  79. package/dist/esm/react-desc-prop-types.js +88 -14
  80. package/dist/esm/react-desc-prop-types.js.map +2 -2
  81. package/dist/esm/styled.js +15 -25
  82. package/dist/esm/styled.js.map +2 -2
  83. package/dist/types/DSPaginationDefinitions.d.ts +6 -0
  84. package/dist/types/Pagination.d.ts +2 -2
  85. package/dist/types/PaginationDataTestID.d.ts +2 -0
  86. package/dist/types/index.d.ts +17 -1
  87. package/dist/types/parts/DSPageNextButton.d.ts +4 -0
  88. package/dist/types/parts/DSPagePrevButton.d.ts +4 -0
  89. package/dist/types/parts/DSPaginationContainer.d.ts +4 -0
  90. package/dist/types/parts/DSPaginator/createPaginatorHeader.d.ts +6 -0
  91. package/dist/types/parts/DSPaginator/getOptions.d.ts +7 -0
  92. package/dist/types/parts/DSPaginator/index.d.ts +4 -0
  93. package/dist/types/parts/DSPaginator/usePaginationSearch.d.ts +2 -0
  94. package/dist/types/parts/DSPaginator/usePaginator.d.ts +17 -0
  95. package/dist/types/parts/DSPerPageSelector/getOptions.d.ts +3 -0
  96. package/dist/types/parts/DSPerPageSelector/index.d.ts +4 -0
  97. package/dist/types/parts/DSPerPageSelector/usePerPageSelector.d.ts +13 -0
  98. package/dist/types/parts/PaginationContent.d.ts +1 -1
  99. package/dist/types/parts/index.d.ts +5 -0
  100. package/dist/types/props.d.ts +20 -0
  101. package/dist/types/react-desc-prop-types.d.ts +528 -9
  102. package/dist/types/styled.d.ts +7 -9
  103. package/dist/types/tests/a11y/axe.test.d.ts +1 -0
  104. package/dist/types/tests/callbacks/paginator.test.d.ts +1 -0
  105. package/dist/types/tests/callbacks/per-page-selector.test.d.ts +1 -0
  106. package/dist/types/tests/callbacks/prev-next-buttons.test.d.ts +1 -0
  107. package/dist/types/tests/keyboard/navigation.test.d.ts +1 -0
  108. package/dist/types/tests/keyboard/paginator-search.test.d.ts +1 -0
  109. package/dist/types/tests/render/page-count-loading.test.d.ts +1 -0
  110. package/dist/types/tests/render/paginator.test.d.ts +1 -0
  111. package/dist/types/tests/render/per-page-selector.test.d.ts +1 -0
  112. package/dist/types/tests/render/segmented-paginator.test.d.ts +1 -0
  113. package/dist/types/tests/render/simple.render.test.d.ts +1 -0
  114. package/package.json +17 -11
  115. package/dist/cjs/hooks/usePaginationSearch.js.map +0 -7
  116. package/dist/cjs/parts/PageNextButton.js.map +0 -7
  117. package/dist/cjs/parts/PagePrevButton.js.map +0 -7
  118. package/dist/cjs/parts/Paginator.js +0 -162
  119. package/dist/cjs/parts/Paginator.js.map +0 -7
  120. package/dist/cjs/parts/PerPageSelector.js.map +0 -7
  121. package/dist/esm/hooks/usePaginationSearch.js.map +0 -7
  122. package/dist/esm/parts/PageNextButton.js +0 -26
  123. package/dist/esm/parts/PageNextButton.js.map +0 -7
  124. package/dist/esm/parts/PagePrevButton.js +0 -23
  125. package/dist/esm/parts/PagePrevButton.js.map +0 -7
  126. package/dist/esm/parts/Paginator.js +0 -136
  127. package/dist/esm/parts/Paginator.js.map +0 -7
  128. package/dist/esm/parts/PerPageSelector.js +0 -88
  129. package/dist/esm/parts/PerPageSelector.js.map +0 -7
  130. package/dist/types/hooks/usePaginationSearch.d.ts +0 -1
  131. package/dist/types/parts/PageNextButton.d.ts +0 -3
  132. package/dist/types/parts/PagePrevButton.d.ts +0 -3
  133. package/dist/types/parts/Paginator.d.ts +0 -11
  134. package/dist/types/parts/PerPageSelector.d.ts +0 -4
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { xStyledCommonProps, styled, css } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-utilities';\nimport type {} from '@xstyled/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)<React.ComponentProps<typeof Grid> & XstyledProps>`\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 position: relative;\n ${xStyledCommonProps}\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`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n position: relative;\n ${xStyledCommonProps}\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 &[aria-disabled='true'] {\n cursor: not-allowed;\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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AACrB,uBAA2B;AAC3B,uBAAgD;AAIhD,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAMnD,MAAM,0BAAsB,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM1C;AAAA;AAGG,MAAM,oBAAoB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAMjC,MAAM,0BAAsB,yBAAO,mBAAI;AAAA,sBACxB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,YAEhD,CAAC,UAAU,MAAM,UAAU;AAAA;AAGhC,MAAM,qBAAqB,wBAAO;AAAA,iBACxB,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA,IAEhD;AAAA;AAGG,MAAM,kBAAkB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ/B,MAAM,mBAAmB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhC,MAAM,+BAA2B,yBAAO,2BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAW9C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,iBAGhC,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA,MAE9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQC,MAAM,6BAAyB,yBAAO,2BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQ3C,CAAC,UAAW,MAAM,WAAW,gBAAgB;AAAA;AAAA,MAEnD;AAAA;AAAA;",
4
+ "sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { xStyledCommonProps, styled, css } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport type {} from '@xstyled/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 StyledPaginationContainer = styled(Grid)<React.ComponentProps<typeof Grid> & XstyledProps>`\n height: 42px;\n max-width: 100%;\n align-items: center;\n justify-content: center;\n box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.5);\n position: relative;\n ${xStyledCommonProps}\n`;\n\nexport const StyledPaginationWrapper = styled.div`\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n`;\n\nexport const DSPaginationSeparator = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral[300]};\n width: 1px;\n height: 30px;\n ${xStyledCommonProps}\n`;\n\nexport const InvisibleDiv = styled.div`\n opacity: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n position: absolute;\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: neutral-700;\n cursor: pointer;\n border-radius: 0;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n :focus {\n ${styledFocusCss}\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AACrB,0BAA2B;AAC3B,uBAAgD;AAIhD,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAMnD,MAAM,gCAA4B,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOhD;AAAA;AAGG,MAAM,0BAA0B,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvC,MAAM,4BAAwB,yBAAO,mBAAI;AAAA,sBAC1B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,IAGxD;AAAA;AAGG,MAAM,eAAe,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ5B,MAAM,+BAA2B,yBAAO,8BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAcxC,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA,MAE9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQC,MAAM,6BAAyB,yBAAO,8BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQ3C,CAAC,UAAW,MAAM,WAAW,gBAAgB;AAAA;AAAA,MAEnD;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,18 @@
1
1
  import * as React from "react";
2
2
  const DSPaginationName = "DSPagination";
3
+ const PaginationContainerName = "DSPaginationContainer";
4
+ const PerPageSelectorName = "DSPerPageSelector";
5
+ const PagePrevButtonName = "DSPagePrevButton";
6
+ const PageNextButtonName = "DSPageNextButton";
7
+ const PaginatorName = "DSPaginator";
8
+ const PaginationSeparatorName = "DSPaginationSeparator";
3
9
  export {
4
- DSPaginationName
10
+ DSPaginationName,
11
+ PageNextButtonName,
12
+ PagePrevButtonName,
13
+ PaginationContainerName,
14
+ PaginationSeparatorName,
15
+ PaginatorName,
16
+ PerPageSelectorName
5
17
  };
6
18
  //# sourceMappingURL=DSPaginationDefinitions.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSPaginationDefinitions.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSPaginationName = 'DSPagination';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSPaginationName = 'DSPagination';\n\nexport const PaginationContainerName = 'DSPaginationContainer';\n\nexport const PerPageSelectorName = 'DSPerPageSelector';\n\nexport const PagePrevButtonName = 'DSPagePrevButton';\n\nexport const PageNextButtonName = 'DSPageNextButton';\n\nexport const PaginatorName = 'DSPaginator';\n\nexport const PaginationSeparatorName = 'DSPaginationSeparator';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB;AAEzB,MAAM,0BAA0B;AAEhC,MAAM,sBAAsB;AAE5B,MAAM,qBAAqB;AAE3B,MAAM,qBAAqB;AAE3B,MAAM,gBAAgB;AAEtB,MAAM,0BAA0B;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-utilities";
4
- import { PaginationContent } from "./parts/PaginationContent";
5
- import { DSPaginationName } from "./DSPaginationDefinitions";
6
- import { defaultProps, DSPaginationPropTypesSchema } from "./react-desc-prop-types";
3
+ import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
4
+ import { PaginationContent } from "./parts/PaginationContent.js";
5
+ import { DSPaginationName } from "./DSPaginationDefinitions.js";
6
+ import { defaultProps, DSPaginationPropTypesSchema } from "./react-desc-prop-types.js";
7
7
  const DSPagination = (props) => {
8
8
  const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
9
9
  useValidateTypescriptPropTypes(propsWithDefault, DSPaginationPropTypesSchema, DSPaginationName);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Pagination.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { PaginationContent } from './parts/PaginationContent';\nimport { DSPaginationName } from './DSPaginationDefinitions';\nimport type { DSPaginationT } from './react-desc-prop-types';\nimport { defaultProps, DSPaginationPropTypesSchema } from './react-desc-prop-types';\n\nconst DSPagination: React.ComponentType<DSPaginationT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, DSPaginationPropTypesSchema, DSPaginationName);\n\n return <PaginationContent {...propsWithDefault} />;\n};\n\nDSPagination.propTypes = DSPaginationPropTypesSchema;\nDSPagination.displayName = DSPaginationName;\nconst DSPaginationWithSchema = describe(DSPagination).description('DSPagination');\nDSPaginationWithSchema.propTypes = DSPaginationPropTypesSchema;\n\nexport { DSPagination, DSPaginationWithSchema };\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { PaginationContent } from './parts/PaginationContent.js';\nimport { DSPaginationName } from './DSPaginationDefinitions.js';\nimport type { DSPaginationT } from './react-desc-prop-types.js';\nimport { defaultProps, DSPaginationPropTypesSchema } from './react-desc-prop-types.js';\n\nconst DSPagination: React.ComponentType<DSPaginationT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, DSPaginationPropTypesSchema, DSPaginationName);\n\n return <PaginationContent {...propsWithDefault} />;\n};\n\nDSPagination.propTypes = DSPaginationPropTypesSchema;\nDSPagination.displayName = DSPaginationName;\nconst DSPaginationWithSchema = describe(DSPagination).description('DSPagination');\nDSPaginationWithSchema.propTypes = DSPaginationPropTypesSchema;\n\nexport { DSPagination, DSPaginationWithSchema };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACWd;AAVT,SAAS,UAAU,8BAA8B,sCAAsC;AACvF,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AAEjC,SAAS,cAAc,mCAAmC;AAE1D,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA0D,OAAO,YAAY;AACtG,iCAA+B,kBAAkB,6BAA6B,gBAAgB;AAE9F,SAAO,oBAAC,qBAAmB,GAAG,kBAAkB;AAClD;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY,EAAE,YAAY,cAAc;AAChF,uBAAuB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,9 @@ import * as React from "react";
2
2
  const PAGINATION_DATA_TESTID = {
3
3
  PREVIOUS_BUTTON: "data-table-pagination-prev-button",
4
4
  NEXT_BUTTON: "data-table-pagination-next-button",
5
- CONTAINER: "data-table-pagination-container"
5
+ CONTAINER: "data-table-pagination-container",
6
+ PER_PAGE_SELECTOR: "ds-pagination-per-page-selector",
7
+ PAGINATOR: "ds-pagination-paginator"
6
8
  };
7
9
  export {
8
10
  PAGINATION_DATA_TESTID
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/PaginationDataTestID.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const PAGINATION_DATA_TESTID = {\n PREVIOUS_BUTTON: 'data-table-pagination-prev-button',\n NEXT_BUTTON: 'data-table-pagination-next-button',\n CONTAINER: 'data-table-pagination-container',\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,WAAW;AACb;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const PAGINATION_DATA_TESTID = {\n PREVIOUS_BUTTON: 'data-table-pagination-prev-button',\n NEXT_BUTTON: 'data-table-pagination-next-button',\n CONTAINER: 'data-table-pagination-container',\n PER_PAGE_SELECTOR: 'ds-pagination-per-page-selector',\n PAGINATOR: 'ds-pagination-paginator',\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,WAAW;AACb;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,3 +1,41 @@
1
1
  import * as React from "react";
2
- export * from "./Pagination";
2
+ import { DSPaginationSeparator } from "./styled.js";
3
+ import { DSPaginationStyledPartPropTypesSchema } from "./react-desc-prop-types.js";
4
+ import { describe } from "@elliemae/ds-props-helpers";
5
+ import { PaginationSeparatorName } from "./DSPaginationDefinitions.js";
6
+ DSPaginationSeparator.propTypes = DSPaginationStyledPartPropTypesSchema;
7
+ DSPaginationSeparator.displayName = PaginationSeparatorName;
8
+ const DSPaginationSeparatorWithSchema = describe(DSPaginationSeparator).description("Pagination Separator");
9
+ import { DSPagination, DSPaginationWithSchema } from "./Pagination.js";
10
+ import {
11
+ DSPageNextButton,
12
+ DSPageNextButtonWithSchema,
13
+ DSPagePrevButton,
14
+ DSPagePrevButtonWithSchema,
15
+ DSPaginationContainer,
16
+ DSPaginationContainerWithSchema,
17
+ DSPerPageSelector,
18
+ DSPerPageSelectorWithSchema,
19
+ DSPaginator,
20
+ DSPaginatorWithSchema
21
+ } from "./parts/index.js";
22
+ import { DSPaginationSeparator as DSPaginationSeparator2 } from "./styled.js";
23
+ import { PAGINATION_DATA_TESTID } from "./PaginationDataTestID.js";
24
+ export {
25
+ DSPageNextButton,
26
+ DSPageNextButtonWithSchema,
27
+ DSPagePrevButton,
28
+ DSPagePrevButtonWithSchema,
29
+ DSPagination,
30
+ DSPaginationContainer,
31
+ DSPaginationContainerWithSchema,
32
+ DSPaginationSeparator2 as DSPaginationSeparator,
33
+ DSPaginationSeparatorWithSchema,
34
+ DSPaginationWithSchema,
35
+ DSPaginator,
36
+ DSPaginatorWithSchema,
37
+ DSPerPageSelector,
38
+ DSPerPageSelectorWithSchema,
39
+ PAGINATION_DATA_TESTID
40
+ };
3
41
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Pagination';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSPaginationSeparator } from './styled.js';\nimport { DSPaginationStyledPartPropTypesSchema } from './react-desc-prop-types.js';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PaginationSeparatorName } from './DSPaginationDefinitions.js';\n\nDSPaginationSeparator.propTypes = DSPaginationStyledPartPropTypesSchema;\nDSPaginationSeparator.displayName = PaginationSeparatorName;\nconst DSPaginationSeparatorWithSchema = describe(DSPaginationSeparator).description('Pagination Separator');\n\nexport { DSPagination, DSPaginationWithSchema } from './Pagination.js';\nexport {\n DSPageNextButton,\n DSPageNextButtonWithSchema,\n DSPagePrevButton,\n DSPagePrevButtonWithSchema,\n DSPaginationContainer,\n DSPaginationContainerWithSchema,\n DSPerPageSelector,\n DSPerPageSelectorWithSchema,\n DSPaginator,\n DSPaginatorWithSchema,\n} from './parts/index.js';\n\nexport { DSPaginationSeparator } from './styled.js';\n\nexport { DSPaginationSeparatorWithSchema };\n\nexport { PAGINATION_DATA_TESTID } from './PaginationDataTestID.js';\n\nexport type { DSPaginationT } from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,6BAA6B;AACtC,SAAS,6CAA6C;AACtD,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AAExC,sBAAsB,YAAY;AAClC,sBAAsB,cAAc;AACpC,MAAM,kCAAkC,SAAS,qBAAqB,EAAE,YAAY,sBAAsB;AAE1G,SAAS,cAAc,8BAA8B;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,yBAAAA,8BAA6B;AAItC,SAAS,8BAA8B;",
6
+ "names": ["DSPaginationSeparator"]
7
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { omit } from "lodash";
4
+ import { ChevronRight } from "@elliemae/ds-icons";
5
+ import {
6
+ describe,
7
+ useGetGlobalAttributes,
8
+ useGetXstyledProps,
9
+ useMemoMergePropsWithDefault,
10
+ useValidateTypescriptPropTypes
11
+ } from "@elliemae/ds-props-helpers";
12
+ import { PAGINATION_DATA_TESTID } from "../PaginationDataTestID.js";
13
+ import { PreviousNextPageButton } from "../styled.js";
14
+ import { pageNextButtonDefaultProps, DSPageNextButtonPropTypesSchema } from "../react-desc-prop-types.js";
15
+ import { PageNextButtonName } from "../DSPaginationDefinitions.js";
16
+ const DSPageNextButton = (props) => {
17
+ const propsWithDefault = useMemoMergePropsWithDefault(
18
+ props,
19
+ pageNextButtonDefaultProps
20
+ );
21
+ useValidateTypescriptPropTypes(propsWithDefault, DSPageNextButtonPropTypesSchema, PageNextButtonName);
22
+ const { canNextPage, onNextPage } = propsWithDefault;
23
+ const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), "shape", "size", "type");
24
+ const xstyledAttributes = useGetXstyledProps(propsWithDefault);
25
+ return /* @__PURE__ */ jsx(
26
+ PreviousNextPageButton,
27
+ {
28
+ disabled: !canNextPage,
29
+ buttonType: "raw",
30
+ "data-testid": PAGINATION_DATA_TESTID.NEXT_BUTTON,
31
+ "aria-label": "Go to next page",
32
+ ...globalAttributes,
33
+ ...xstyledAttributes,
34
+ onClick: () => {
35
+ if (canNextPage)
36
+ onNextPage();
37
+ },
38
+ children: /* @__PURE__ */ jsx(ChevronRight, { color: canNextPage ? ["brand-primary", "700"] : ["neutral", "500"] })
39
+ }
40
+ );
41
+ };
42
+ DSPageNextButton.propTypes = DSPageNextButtonPropTypesSchema;
43
+ DSPageNextButton.displayName = PageNextButtonName;
44
+ const DSPageNextButtonWithSchema = describe(DSPageNextButton).description("Per Page Selector");
45
+ DSPageNextButtonWithSchema.propTypes = DSPageNextButtonPropTypesSchema;
46
+ export {
47
+ DSPageNextButton,
48
+ DSPageNextButtonWithSchema
49
+ };
50
+ //# sourceMappingURL=DSPageNextButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSPageNextButton.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { omit } from 'lodash';\nimport { ChevronRight } from '@elliemae/ds-icons';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';\nimport { PreviousNextPageButton } from '../styled.js';\nimport { pageNextButtonDefaultProps, DSPageNextButtonPropTypesSchema } from '../react-desc-prop-types.js';\nimport { PageNextButtonName } from '../DSPaginationDefinitions.js';\nimport type { DSPaginationT } from '../react-desc-prop-types.js';\n\nexport const DSPageNextButton: React.ComponentType<DSPaginationT.PageNextButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.PageNextButtonInternalProps>(\n props,\n pageNextButtonDefaultProps,\n );\n useValidateTypescriptPropTypes(propsWithDefault, DSPageNextButtonPropTypesSchema, PageNextButtonName);\n\n const { canNextPage, onNextPage } = propsWithDefault;\n const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), 'shape', 'size', 'type');\n const xstyledAttributes = useGetXstyledProps(propsWithDefault);\n\n return (\n <PreviousNextPageButton\n disabled={!canNextPage}\n buttonType=\"raw\"\n data-testid={PAGINATION_DATA_TESTID.NEXT_BUTTON}\n aria-label=\"Go to next page\"\n {...globalAttributes}\n {...xstyledAttributes}\n onClick={() => {\n if (canNextPage) onNextPage();\n }}\n >\n <ChevronRight color={canNextPage ? ['brand-primary', '700'] : ['neutral', '500']} />\n </PreviousNextPageButton>\n );\n};\n\nDSPageNextButton.propTypes = DSPageNextButtonPropTypesSchema;\nDSPageNextButton.displayName = PageNextButtonName;\nexport const DSPageNextButtonWithSchema = describe(DSPageNextButton).description('Per Page Selector');\nDSPageNextButtonWithSchema.propTypes = DSPageNextButtonPropTypesSchema;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwCjB;AAtCN,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B,uCAAuC;AAC5E,SAAS,0BAA0B;AAG5B,MAAM,mBAA2E,CAAC,UAAU;AACjG,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,kBAAkB,iCAAiC,kBAAkB;AAEpG,QAAM,EAAE,aAAa,WAAW,IAAI;AACpC,QAAM,mBAAmB,KAAK,uBAAuB,gBAAgB,GAAG,SAAS,QAAQ,MAAM;AAC/F,QAAM,oBAAoB,mBAAmB,gBAAgB;AAE7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC;AAAA,MACX,YAAW;AAAA,MACX,eAAa,uBAAuB;AAAA,MACpC,cAAW;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,SAAS,MAAM;AACb,YAAI;AAAa,qBAAW;AAAA,MAC9B;AAAA,MAEA,8BAAC,gBAAa,OAAO,cAAc,CAAC,iBAAiB,KAAK,IAAI,CAAC,WAAW,KAAK,GAAG;AAAA;AAAA,EACpF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AACxB,MAAM,6BAA6B,SAAS,gBAAgB,EAAE,YAAY,mBAAmB;AACpG,2BAA2B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { omit } from "lodash";
4
+ import { ChevronLeft } from "@elliemae/ds-icons";
5
+ import { PAGINATION_DATA_TESTID } from "../PaginationDataTestID.js";
6
+ import { PreviousNextPageButton } from "../styled.js";
7
+ import { pagePrevButtonDefaultProps, DSPagePrevButtonPropTypesSchema } from "../react-desc-prop-types.js";
8
+ import {
9
+ describe,
10
+ useGetGlobalAttributes,
11
+ useGetXstyledProps,
12
+ useMemoMergePropsWithDefault,
13
+ useValidateTypescriptPropTypes
14
+ } from "@elliemae/ds-props-helpers";
15
+ import { PagePrevButtonName } from "../DSPaginationDefinitions.js";
16
+ const DSPagePrevButton = (props) => {
17
+ const propsWithDefault = useMemoMergePropsWithDefault(
18
+ props,
19
+ pagePrevButtonDefaultProps
20
+ );
21
+ useValidateTypescriptPropTypes(propsWithDefault, DSPagePrevButtonPropTypesSchema, PagePrevButtonName);
22
+ const { canPreviousPage, onPreviousPage } = propsWithDefault;
23
+ const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), "shape", "size", "type");
24
+ const xstyledAttributes = useGetXstyledProps(propsWithDefault);
25
+ return /* @__PURE__ */ jsx(
26
+ PreviousNextPageButton,
27
+ {
28
+ disabled: !canPreviousPage,
29
+ buttonType: "raw",
30
+ "data-testid": PAGINATION_DATA_TESTID.PREVIOUS_BUTTON,
31
+ "aria-label": "Go to previous page",
32
+ ...globalAttributes,
33
+ ...xstyledAttributes,
34
+ onClick: () => {
35
+ if (canPreviousPage)
36
+ onPreviousPage();
37
+ },
38
+ children: /* @__PURE__ */ jsx(ChevronLeft, { color: canPreviousPage ? ["brand-primary", "700"] : ["neutral", "500"] })
39
+ }
40
+ );
41
+ };
42
+ DSPagePrevButton.propTypes = DSPagePrevButtonPropTypesSchema;
43
+ DSPagePrevButton.displayName = PagePrevButtonName;
44
+ const DSPagePrevButtonWithSchema = describe(DSPagePrevButton).description("Per Page Selector");
45
+ DSPagePrevButtonWithSchema.propTypes = DSPagePrevButtonPropTypesSchema;
46
+ export {
47
+ DSPagePrevButton,
48
+ DSPagePrevButtonWithSchema
49
+ };
50
+ //# sourceMappingURL=DSPagePrevButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSPagePrevButton.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { omit } from 'lodash';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';\nimport { PreviousNextPageButton } from '../styled.js';\nimport { pagePrevButtonDefaultProps, DSPagePrevButtonPropTypesSchema } from '../react-desc-prop-types.js';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { PagePrevButtonName } from '../DSPaginationDefinitions.js';\nimport type { DSPaginationT } from '../react-desc-prop-types.js';\n\nexport const DSPagePrevButton: React.ComponentType<DSPaginationT.PagePrevButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.PagePrevButtonInternalProps>(\n props,\n pagePrevButtonDefaultProps,\n );\n useValidateTypescriptPropTypes(propsWithDefault, DSPagePrevButtonPropTypesSchema, PagePrevButtonName);\n\n const { canPreviousPage, onPreviousPage } = propsWithDefault;\n const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), 'shape', 'size', 'type');\n const xstyledAttributes = useGetXstyledProps(propsWithDefault);\n\n return (\n <PreviousNextPageButton\n disabled={!canPreviousPage}\n buttonType=\"raw\"\n data-testid={PAGINATION_DATA_TESTID.PREVIOUS_BUTTON}\n aria-label=\"Go to previous page\"\n {...globalAttributes}\n {...xstyledAttributes}\n onClick={() => {\n if (canPreviousPage) onPreviousPage();\n }}\n >\n <ChevronLeft color={canPreviousPage ? ['brand-primary', '700'] : ['neutral', '500']} />\n </PreviousNextPageButton>\n );\n};\n\nDSPagePrevButton.propTypes = DSPagePrevButtonPropTypesSchema;\nDSPagePrevButton.displayName = PagePrevButtonName;\nexport const DSPagePrevButtonWithSchema = describe(DSPagePrevButton).description('Per Page Selector');\nDSPagePrevButtonWithSchema.propTypes = DSPagePrevButtonPropTypesSchema;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwCjB;AAtCN,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B,uCAAuC;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAG5B,MAAM,mBAA2E,CAAC,UAAU;AACjG,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,kBAAkB,iCAAiC,kBAAkB;AAEpG,QAAM,EAAE,iBAAiB,eAAe,IAAI;AAC5C,QAAM,mBAAmB,KAAK,uBAAuB,gBAAgB,GAAG,SAAS,QAAQ,MAAM;AAC/F,QAAM,oBAAoB,mBAAmB,gBAAgB;AAE7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC;AAAA,MACX,YAAW;AAAA,MACX,eAAa,uBAAuB;AAAA,MACpC,cAAW;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,SAAS,MAAM;AACb,YAAI;AAAiB,yBAAe;AAAA,MACtC;AAAA,MAEA,8BAAC,eAAY,OAAO,kBAAkB,CAAC,iBAAiB,KAAK,IAAI,CAAC,WAAW,KAAK,GAAG;AAAA;AAAA,EACvF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AACxB,MAAM,6BAA6B,SAAS,gBAAgB,EAAE,YAAY,mBAAmB;AACpG,2BAA2B,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { omit } from "lodash";
4
+ import { describe, useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
5
+ import { PAGINATION_DATA_TESTID } from "../PaginationDataTestID.js";
6
+ import { StyledPaginationContainer, StyledPaginationWrapper } from "../styled.js";
7
+ import { DSPaginationContainerPropTypesSchema } from "../react-desc-prop-types.js";
8
+ import { PaginationContainerName } from "../DSPaginationDefinitions.js";
9
+ const DSPaginationContainer = (props) => {
10
+ const globalAttributes = omit(useGetGlobalAttributes(props), ["rows", "wrap"]);
11
+ const xstyledProps = useGetXstyledProps(props);
12
+ return /* @__PURE__ */ jsx(
13
+ StyledPaginationContainer,
14
+ {
15
+ "data-testid": PAGINATION_DATA_TESTID.CONTAINER,
16
+ ...globalAttributes,
17
+ ...xstyledProps,
18
+ cols: ["minmax(auto, 80%)"],
19
+ children: /* @__PURE__ */ jsx(StyledPaginationWrapper, { children: props.children })
20
+ }
21
+ );
22
+ };
23
+ DSPaginationContainer.propTypes = DSPaginationContainerPropTypesSchema;
24
+ DSPaginationContainer.displayName = PaginationContainerName;
25
+ const DSPaginationContainerWithSchema = describe(DSPaginationContainer).description("Per Page Selector");
26
+ DSPaginationContainerWithSchema.propTypes = DSPaginationContainerPropTypesSchema;
27
+ export {
28
+ DSPaginationContainer,
29
+ DSPaginationContainerWithSchema
30
+ };
31
+ //# sourceMappingURL=DSPaginationContainer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSPaginationContainer.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';\nimport { StyledPaginationContainer, StyledPaginationWrapper } from '../styled.js';\nimport { DSPaginationContainerPropTypesSchema } from '../react-desc-prop-types.js';\nimport { PaginationContainerName } from '../DSPaginationDefinitions.js';\nimport type { DSPaginationT } from '../react-desc-prop-types.js';\n\nexport const DSPaginationContainer: React.ComponentType<DSPaginationT.ContainerProps> = (props) => {\n const globalAttributes = omit(useGetGlobalAttributes(props), ['rows', 'wrap']);\n const xstyledProps = useGetXstyledProps(props);\n\n return (\n <StyledPaginationContainer\n data-testid={PAGINATION_DATA_TESTID.CONTAINER}\n {...globalAttributes}\n {...xstyledProps}\n cols={['minmax(auto, 80%)']}\n >\n <StyledPaginationWrapper>{props.children}</StyledPaginationWrapper>\n </StyledPaginationContainer>\n );\n};\n\nDSPaginationContainer.propTypes = DSPaginationContainerPropTypesSchema;\nDSPaginationContainer.displayName = PaginationContainerName;\nexport const DSPaginationContainerWithSchema = describe(DSPaginationContainer).description('Per Page Selector');\nDSPaginationContainerWithSchema.propTypes = DSPaginationContainerPropTypesSchema;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoBjB;AAnBN,SAAS,YAAY;AACrB,SAAS,UAAU,wBAAwB,0BAA0B;AACrE,SAAS,8BAA8B;AACvC,SAAS,2BAA2B,+BAA+B;AACnE,SAAS,4CAA4C;AACrD,SAAS,+BAA+B;AAGjC,MAAM,wBAA2E,CAAC,UAAU;AACjG,QAAM,mBAAmB,KAAK,uBAAuB,KAAK,GAAG,CAAC,QAAQ,MAAM,CAAC;AAC7E,QAAM,eAAe,mBAAmB,KAAK;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,uBAAuB;AAAA,MACnC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,MAAM,CAAC,mBAAmB;AAAA,MAE1B,8BAAC,2BAAyB,gBAAM,UAAS;AAAA;AAAA,EAC3C;AAEJ;AAEA,sBAAsB,YAAY;AAClC,sBAAsB,cAAc;AAC7B,MAAM,kCAAkC,SAAS,qBAAqB,EAAE,YAAY,mBAAmB;AAC9G,gCAAgC,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { Grid } from "@elliemae/ds-grid";
4
+ import { DSPaginationSeparator } from "../../styled.js";
5
+ const createPaginatorHeader = ({ pageDetailsTitle, pageInfoWidth }) => {
6
+ const Comp = () => {
7
+ if (pageDetailsTitle === "")
8
+ return /* @__PURE__ */ jsx(Fragment, { children: "Page" });
9
+ return /* @__PURE__ */ jsxs(Grid, { cols: [`${pageInfoWidth + 50}px`, "8px", "auto"], children: [
10
+ /* @__PURE__ */ jsx("span", { style: { marginLeft: "8px" }, children: "Page" }),
11
+ /* @__PURE__ */ jsx(DSPaginationSeparator, { height: "100%" }),
12
+ /* @__PURE__ */ jsx("span", { children: pageDetailsTitle })
13
+ ] });
14
+ };
15
+ return Comp;
16
+ };
17
+ export {
18
+ createPaginatorHeader
19
+ };
20
+ //# sourceMappingURL=createPaginatorHeader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/createPaginatorHeader.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSPaginationSeparator } from '../../styled.js';\n\ninterface PaginatorHeaderOptions {\n pageDetailsTitle: string;\n pageInfoWidth: number;\n}\n\nexport const createPaginatorHeader = ({ pageDetailsTitle, pageInfoWidth }: PaginatorHeaderOptions) => {\n const Comp = () => {\n if (pageDetailsTitle === '') return <>Page</>;\n\n return (\n <Grid cols={[`${pageInfoWidth + 50}px`, '8px', 'auto']}>\n <span style={{ marginLeft: '8px' }}>Page</span>\n <DSPaginationSeparator height=\"100%\" />\n <span>{pageDetailsTitle}</span>\n </Grid>\n );\n };\n return Comp;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACWiB,wBAGlC,YAHkC;AAVxC,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAO/B,MAAM,wBAAwB,CAAC,EAAE,kBAAkB,cAAc,MAA8B;AACpG,QAAM,OAAO,MAAM;AACjB,QAAI,qBAAqB;AAAI,aAAO,gCAAE,kBAAI;AAE1C,WACE,qBAAC,QAAK,MAAM,CAAC,GAAG,gBAAgB,QAAQ,OAAO,MAAM,GACnD;AAAA,0BAAC,UAAK,OAAO,EAAE,YAAY,MAAM,GAAG,kBAAI;AAAA,MACxC,oBAAC,yBAAsB,QAAO,QAAO;AAAA,MACrC,oBAAC,UAAM,4BAAiB;AAAA,OAC1B;AAAA,EAEJ;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,46 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Grid } from "@elliemae/ds-grid";
4
+ import { Checkmark } from "@elliemae/ds-icons";
5
+ const OptionWithDetails = (props) => {
6
+ const Comp = () => {
7
+ const { pageInfoWidth, pageIndex, index, pageDetails } = props;
8
+ return /* @__PURE__ */ jsxs(Grid, { cols: ["16px", `${pageInfoWidth + 16}px`, "auto"], gutter: "xxs", alignItems: "center", children: [
9
+ pageIndex - 1 === index ? /* @__PURE__ */ jsx(Checkmark, { size: "s", color: ["brand-primary", "600"] }) : /* @__PURE__ */ jsx("div", {}),
10
+ /* @__PURE__ */ jsx("span", { children: index + 1 }),
11
+ /* @__PURE__ */ jsx(
12
+ "span",
13
+ {
14
+ style: {
15
+ whiteSpace: "nowrap",
16
+ textOverflow: "ellipsis",
17
+ overflow: "hidden"
18
+ },
19
+ children: pageDetails[index]
20
+ }
21
+ )
22
+ ] });
23
+ };
24
+ return Comp;
25
+ };
26
+ const getOptions = (args) => {
27
+ const { pageCount, pageIndex, pageDetails, pageInfoWidth } = args;
28
+ const amountOfPages = typeof pageCount === "string" ? pageIndex + 1 : pageCount;
29
+ const options = new Array(amountOfPages).fill(0).map((_, index) => {
30
+ const option = {
31
+ dsId: (index + 1).toString(),
32
+ label: (index + 1).toString(),
33
+ value: index + 1,
34
+ type: "single"
35
+ };
36
+ if (pageDetails?.length) {
37
+ option.render = OptionWithDetails({ pageInfoWidth, pageIndex, index, pageDetails });
38
+ }
39
+ return option;
40
+ });
41
+ return options;
42
+ };
43
+ export {
44
+ getOptions
45
+ };
46
+ //# sourceMappingURL=getOptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/getOptions.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { DSDropdownMenuT } from '@elliemae/ds-dropdownmenu';\n\ninterface OptionWithDetailsT {\n pageInfoWidth: number;\n pageIndex: number;\n index: number;\n pageDetails: string[];\n}\n\nconst OptionWithDetails = (props: OptionWithDetailsT) => {\n const Comp = () => {\n const { pageInfoWidth, pageIndex, index, pageDetails } = props;\n return (\n <Grid cols={['16px', `${pageInfoWidth + 16}px`, 'auto']} gutter=\"xxs\" alignItems=\"center\">\n {pageIndex - 1 === index ? <Checkmark size=\"s\" color={['brand-primary', '600']} /> : <div />}\n <span>{index + 1}</span>\n <span\n style={{\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n }}\n >\n {pageDetails[index]}\n </span>\n </Grid>\n );\n };\n return Comp;\n};\n\nexport const getOptions = (args: {\n pageCount: number | string;\n pageIndex: number;\n pageDetails: string[];\n pageInfoWidth: number;\n}): DSDropdownMenuT.ItemSingleOptions[] => {\n const { pageCount, pageIndex, pageDetails, pageInfoWidth } = args;\n\n const amountOfPages = typeof pageCount === 'string' ? pageIndex + 1 : pageCount;\n\n const options = new Array(amountOfPages).fill(0).map((_, index) => {\n const option: DSDropdownMenuT.ItemSingleOptions = {\n dsId: (index + 1).toString(),\n label: (index + 1).toString(),\n value: index + 1,\n type: 'single',\n };\n if (pageDetails?.length) {\n option.render = OptionWithDetails({ pageInfoWidth, pageIndex, index, pageDetails });\n }\n return option;\n });\n return options;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgBjB,SAC6B,KAD7B;AAfN,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAU1B,MAAM,oBAAoB,CAAC,UAA8B;AACvD,QAAM,OAAO,MAAM;AACjB,UAAM,EAAE,eAAe,WAAW,OAAO,YAAY,IAAI;AACzD,WACE,qBAAC,QAAK,MAAM,CAAC,QAAQ,GAAG,gBAAgB,QAAQ,MAAM,GAAG,QAAO,OAAM,YAAW,UAC9E;AAAA,kBAAY,MAAM,QAAQ,oBAAC,aAAU,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK,oBAAC,SAAI;AAAA,MAC1F,oBAAC,UAAM,kBAAQ,GAAE;AAAA,MACjB;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,YAAY;AAAA,YACZ,cAAc;AAAA,YACd,UAAU;AAAA,UACZ;AAAA,UAEC,sBAAY;AAAA;AAAA,MACf;AAAA,OACF;AAAA,EAEJ;AACA,SAAO;AACT;AAEO,MAAM,aAAa,CAAC,SAKgB;AACzC,QAAM,EAAE,WAAW,WAAW,aAAa,cAAc,IAAI;AAE7D,QAAM,gBAAgB,OAAO,cAAc,WAAW,YAAY,IAAI;AAEtE,QAAM,UAAU,IAAI,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AACjE,UAAM,SAA4C;AAAA,MAChD,OAAO,QAAQ,GAAG,SAAS;AAAA,MAC3B,QAAQ,QAAQ,GAAG,SAAS;AAAA,MAC5B,OAAO,QAAQ;AAAA,MACf,MAAM;AAAA,IACR;AACA,QAAI,aAAa,QAAQ;AACvB,aAAO,SAAS,kBAAkB,EAAE,eAAe,WAAW,OAAO,YAAY,CAAC;AAAA,IACpF;AACA,WAAO;AAAA,EACT,CAAC;AACD,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,118 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
4
+ import { ChevronDown } from "@elliemae/ds-icons";
5
+ import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
6
+ import { Grid } from "@elliemae/ds-grid";
7
+ import { DSDropdownMenuV2 } from "@elliemae/ds-dropdownmenu";
8
+ import { DSTypography } from "@elliemae/ds-typography";
9
+ import { DSCircularIndeterminateIndicator } from "@elliemae/ds-circular-progress-indicator";
10
+ import { InvisibleDiv, PaginationDropdownButton, DSPaginationSeparator } from "../../styled.js";
11
+ import { paginatorDefaultProps, DSPaginatorPropTypesSchema } from "../../react-desc-prop-types.js";
12
+ import { PaginatorName } from "../../DSPaginationDefinitions.js";
13
+ import { usePaginator } from "./usePaginator.js";
14
+ import { createPaginatorHeader } from "./createPaginatorHeader.js";
15
+ import { PAGINATION_DATA_TESTID } from "../../PaginationDataTestID.js";
16
+ const DSPaginator = (props) => {
17
+ const propsWithDefault = useMemoMergePropsWithDefault(
18
+ props,
19
+ paginatorDefaultProps
20
+ );
21
+ useValidateTypescriptPropTypes(propsWithDefault, DSPaginatorPropTypesSchema, PaginatorName);
22
+ const { pageIndex, pageCount, isLoadingPageCount, onPageChange, pageDetails, pageDetailsTitle } = propsWithDefault;
23
+ const {
24
+ btnRef,
25
+ btnWidth,
26
+ pageInfoWidth,
27
+ options,
28
+ isOpened,
29
+ setIsOpened,
30
+ detailWidth,
31
+ globalAttributes,
32
+ xstyledAttributes,
33
+ actionRef,
34
+ onKeyDown
35
+ } = usePaginator(propsWithDefault);
36
+ const Header = useMemo(
37
+ () => createPaginatorHeader({ pageDetailsTitle, pageInfoWidth }),
38
+ [pageDetailsTitle, pageInfoWidth]
39
+ );
40
+ const buttonOnClick = useMemo(() => {
41
+ if (globalAttributes.onClick)
42
+ return globalAttributes.onClick;
43
+ return () => setIsOpened((prev) => !prev);
44
+ }, [globalAttributes.onClick, setIsOpened]);
45
+ return /* @__PURE__ */ jsxs(
46
+ DSDropdownMenuV2,
47
+ {
48
+ isOpened,
49
+ options,
50
+ selectedOptions: { [pageIndex.toString()]: true },
51
+ onOptionClick: (_, clickedOption) => {
52
+ onPageChange(clickedOption.value);
53
+ setIsOpened(false);
54
+ btnRef.current?.focus();
55
+ },
56
+ onClickOutside: () => {
57
+ setIsOpened(false);
58
+ btnRef.current?.focus();
59
+ },
60
+ customOffset: [-23, 2],
61
+ startPlacementPreference: "top-start",
62
+ actionRef,
63
+ onKeyDown,
64
+ minWidth: pageDetails.length !== 0 ? btnWidth + 23 : pageCount.toString().length * 6 + 90,
65
+ maxHeight: 300,
66
+ HeaderComp: Header,
67
+ children: [
68
+ /* @__PURE__ */ jsx(
69
+ PaginationDropdownButton,
70
+ {
71
+ buttonType: "raw",
72
+ disabled: isLoadingPageCount,
73
+ innerRef: btnRef,
74
+ "aria-pressed": isOpened,
75
+ "aria-label": `Page ${pageIndex} out of ${pageCount}, ${pageDetails.length !== 0 ? pageDetails[pageIndex - 1] : "\b\b"}. Press to change the current page`,
76
+ "data-testid": PAGINATION_DATA_TESTID.PAGINATOR,
77
+ ...globalAttributes,
78
+ ...xstyledAttributes,
79
+ onClick: buttonOnClick,
80
+ children: /* @__PURE__ */ jsxs(Grid, { gutter: "xxxs", alignItems: "center", style: { gridAutoFlow: "column" }, children: [
81
+ /* @__PURE__ */ jsx(DSTypography, { fontSize: "18px", variant: "b1", as: "span", fontWeight: "semibold", textAlign: "start", children: pageIndex }),
82
+ "/ ",
83
+ pageCount,
84
+ isLoadingPageCount && /* @__PURE__ */ jsx(DSCircularIndeterminateIndicator, { ml: "xxxs", mr: "xxxs", size: "xs" }),
85
+ pageDetails.length !== 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
86
+ /* @__PURE__ */ jsx(DSPaginationSeparator, { height: "12px", ml: "12px", mr: "xxxs" }),
87
+ /* @__PURE__ */ jsx(
88
+ DSTypography,
89
+ {
90
+ fontSize: "13px",
91
+ w: detailWidth,
92
+ mr: "xxs",
93
+ variant: "b1",
94
+ as: "span",
95
+ fontWeight: "semibold",
96
+ textAlign: "start",
97
+ children: pageDetails[pageIndex - 1]
98
+ }
99
+ )
100
+ ] }),
101
+ /* @__PURE__ */ jsx(ChevronDown, { ml: "xxxs", color: ["brand-primary", "700"] })
102
+ ] })
103
+ }
104
+ ),
105
+ /* @__PURE__ */ jsx(Grid, { style: { position: "relative" }, children: pageDetails.map((pageDetail) => /* @__PURE__ */ jsx(InvisibleDiv, { "data-testid": "ds-pagination-invisible-detail-for-width-calc", children: /* @__PURE__ */ jsx(DSTypography, { fontSize: "13px", mr: "xxs", variant: "b1", as: "span", fontWeight: "semibold", textAlign: "start", children: pageDetail }) }, pageDetail)) })
106
+ ]
107
+ }
108
+ );
109
+ };
110
+ DSPaginator.propTypes = DSPaginatorPropTypesSchema;
111
+ DSPaginator.displayName = PaginatorName;
112
+ const DSPaginatorWithSchema = describe(DSPaginator).description("Per Page Selector");
113
+ DSPaginatorWithSchema.propTypes = DSPaginatorPropTypesSchema;
114
+ export {
115
+ DSPaginator,
116
+ DSPaginatorWithSchema
117
+ };
118
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useMemo } from 'react';\nimport type { DSButtonT } from '@elliemae/ds-button-v2';\nimport { ChevronDown } from '@elliemae/ds-icons';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSCircularIndeterminateIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport { InvisibleDiv, PaginationDropdownButton, DSPaginationSeparator } from '../../styled.js';\nimport { paginatorDefaultProps, DSPaginatorPropTypesSchema } from '../../react-desc-prop-types.js';\nimport { PaginatorName } from '../../DSPaginationDefinitions.js';\nimport { usePaginator } from './usePaginator.js';\nimport { createPaginatorHeader } from './createPaginatorHeader.js';\nimport { PAGINATION_DATA_TESTID } from '../../PaginationDataTestID.js';\nimport type { DSDropdownMenuT } from '@elliemae/ds-dropdownmenu';\nimport type { DSPaginationT } from '../../react-desc-prop-types.js';\n\nexport const DSPaginator: React.ComponentType<DSPaginationT.PaginatorProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.PaginatorInternalProps>(\n props,\n paginatorDefaultProps,\n );\n useValidateTypescriptPropTypes(propsWithDefault, DSPaginatorPropTypesSchema, PaginatorName);\n\n const { pageIndex, pageCount, isLoadingPageCount, onPageChange, pageDetails, pageDetailsTitle } = propsWithDefault;\n\n const {\n btnRef,\n btnWidth,\n pageInfoWidth,\n options,\n isOpened,\n setIsOpened,\n detailWidth,\n globalAttributes,\n xstyledAttributes,\n actionRef,\n onKeyDown,\n } = usePaginator(propsWithDefault);\n\n const Header = useMemo(\n () => createPaginatorHeader({ pageDetailsTitle, pageInfoWidth }),\n [pageDetailsTitle, pageInfoWidth],\n );\n\n const buttonOnClick: DSButtonT.Props['onClick'] = useMemo(() => {\n if (globalAttributes.onClick) return globalAttributes.onClick as DSButtonT.Props['onClick'];\n return () => setIsOpened((prev) => !prev);\n }, [globalAttributes.onClick, setIsOpened]);\n\n return (\n <DSDropdownMenuV2\n isOpened={isOpened}\n options={options}\n selectedOptions={{ [pageIndex.toString()]: true }}\n onOptionClick={(_, clickedOption) => {\n onPageChange((clickedOption as DSDropdownMenuT.ItemSingleOptions).value as number);\n setIsOpened(false);\n btnRef.current?.focus();\n }}\n onClickOutside={() => {\n setIsOpened(false);\n btnRef.current?.focus();\n }}\n customOffset={[-23, 2]}\n startPlacementPreference=\"top-start\"\n actionRef={actionRef}\n onKeyDown={onKeyDown}\n minWidth={pageDetails.length !== 0 ? btnWidth + 23 : pageCount.toString().length * 6 + 90}\n maxHeight={300}\n HeaderComp={Header}\n >\n <PaginationDropdownButton\n buttonType=\"raw\"\n disabled={isLoadingPageCount}\n innerRef={btnRef}\n aria-pressed={isOpened}\n aria-label={`Page ${pageIndex} out of ${pageCount}, ${\n pageDetails.length !== 0 ? pageDetails[pageIndex - 1] : '\\b\\b'\n }. Press to change the current page`}\n data-testid={PAGINATION_DATA_TESTID.PAGINATOR}\n {...globalAttributes}\n {...xstyledAttributes}\n onClick={buttonOnClick}\n >\n <Grid gutter=\"xxxs\" alignItems=\"center\" style={{ gridAutoFlow: 'column' }}>\n <DSTypography fontSize=\"18px\" variant=\"b1\" as=\"span\" fontWeight=\"semibold\" textAlign=\"start\">\n {pageIndex}\n </DSTypography>\n / {pageCount}\n {isLoadingPageCount && <DSCircularIndeterminateIndicator ml=\"xxxs\" mr=\"xxxs\" size=\"xs\" />}\n {pageDetails.length !== 0 && (\n <>\n <DSPaginationSeparator height=\"12px\" ml=\"12px\" mr=\"xxxs\" />\n <DSTypography\n fontSize=\"13px\"\n w={detailWidth}\n mr=\"xxs\"\n variant=\"b1\"\n as=\"span\"\n fontWeight=\"semibold\"\n textAlign=\"start\"\n >\n {pageDetails[pageIndex - 1]}\n </DSTypography>\n </>\n )}\n <ChevronDown ml=\"xxxs\" color={['brand-primary', '700']} />\n </Grid>\n </PaginationDropdownButton>\n {/* We calculate the length of the longest detail here (this is as per specs) */}\n <Grid style={{ position: 'relative' }}>\n {pageDetails.map((pageDetail) => (\n <InvisibleDiv data-testid=\"ds-pagination-invisible-detail-for-width-calc\" key={pageDetail}>\n <DSTypography fontSize=\"13px\" mr=\"xxs\" variant=\"b1\" as=\"span\" fontWeight=\"semibold\" textAlign=\"start\">\n {pageDetail}\n </DSTypography>\n </InvisibleDiv>\n ))}\n </Grid>\n </DSDropdownMenuV2>\n );\n};\n\nDSPaginator.propTypes = DSPaginatorPropTypesSchema;\nDSPaginator.displayName = PaginatorName;\nexport const DSPaginatorWithSchema = describe(DSPaginator).description('Per Page Selector');\nDSPaginatorWithSchema.propTypes = DSPaginatorPropTypesSchema;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACuFb,SAME,UANF,KAME,YANF;AAtFV,SAAgB,eAAe;AAE/B,SAAS,mBAAmB;AAC5B,SAAS,UAAU,8BAA8B,sCAAsC;AACvF,SAAS,YAAY;AACrB,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,wCAAwC;AACjD,SAAS,cAAc,0BAA0B,6BAA6B;AAC9E,SAAS,uBAAuB,kCAAkC;AAClE,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AAIhC,MAAM,cAAiE,CAAC,UAAU;AACvF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,kBAAkB,4BAA4B,aAAa;AAE1F,QAAM,EAAE,WAAW,WAAW,oBAAoB,cAAc,aAAa,iBAAiB,IAAI;AAElG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,aAAa,gBAAgB;AAEjC,QAAM,SAAS;AAAA,IACb,MAAM,sBAAsB,EAAE,kBAAkB,cAAc,CAAC;AAAA,IAC/D,CAAC,kBAAkB,aAAa;AAAA,EAClC;AAEA,QAAM,gBAA4C,QAAQ,MAAM;AAC9D,QAAI,iBAAiB;AAAS,aAAO,iBAAiB;AACtD,WAAO,MAAM,YAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC1C,GAAG,CAAC,iBAAiB,SAAS,WAAW,CAAC;AAE1C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,iBAAiB,EAAE,CAAC,UAAU,SAAS,IAAI,KAAK;AAAA,MAChD,eAAe,CAAC,GAAG,kBAAkB;AACnC,qBAAc,cAAoD,KAAe;AACjF,oBAAY,KAAK;AACjB,eAAO,SAAS,MAAM;AAAA,MACxB;AAAA,MACA,gBAAgB,MAAM;AACpB,oBAAY,KAAK;AACjB,eAAO,SAAS,MAAM;AAAA,MACxB;AAAA,MACA,cAAc,CAAC,KAAK,CAAC;AAAA,MACrB,0BAAyB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,UAAU,YAAY,WAAW,IAAI,WAAW,KAAK,UAAU,SAAS,EAAE,SAAS,IAAI;AAAA,MACvF,WAAW;AAAA,MACX,YAAY;AAAA,MAEZ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,UAAU;AAAA,YACV,UAAU;AAAA,YACV,gBAAc;AAAA,YACd,cAAY,QAAQ,oBAAoB,cACtC,YAAY,WAAW,IAAI,YAAY,YAAY,KAAK;AAAA,YAE1D,eAAa,uBAAuB;AAAA,YACnC,GAAG;AAAA,YACH,GAAG;AAAA,YACJ,SAAS;AAAA,YAET,+BAAC,QAAK,QAAO,QAAO,YAAW,UAAS,OAAO,EAAE,cAAc,SAAS,GACtE;AAAA,kCAAC,gBAAa,UAAS,QAAO,SAAQ,MAAK,IAAG,QAAO,YAAW,YAAW,WAAU,SAClF,qBACH;AAAA,cAAe;AAAA,cACZ;AAAA,cACF,sBAAsB,oBAAC,oCAAiC,IAAG,QAAO,IAAG,QAAO,MAAK,MAAK;AAAA,cACtF,YAAY,WAAW,KACtB,iCACE;AAAA,oCAAC,yBAAsB,QAAO,QAAO,IAAG,QAAO,IAAG,QAAO;AAAA,gBACzD;AAAA,kBAAC;AAAA;AAAA,oBACC,UAAS;AAAA,oBACT,GAAG;AAAA,oBACH,IAAG;AAAA,oBACH,SAAQ;AAAA,oBACR,IAAG;AAAA,oBACH,YAAW;AAAA,oBACX,WAAU;AAAA,oBAET,sBAAY,YAAY;AAAA;AAAA,gBAC3B;AAAA,iBACF;AAAA,cAEF,oBAAC,eAAY,IAAG,QAAO,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA,eAC1D;AAAA;AAAA,QACF;AAAA,QAEA,oBAAC,QAAK,OAAO,EAAE,UAAU,WAAW,GACjC,sBAAY,IAAI,CAAC,eAChB,oBAAC,gBAAa,eAAY,iDACxB,8BAAC,gBAAa,UAAS,QAAO,IAAG,OAAM,SAAQ,MAAK,IAAG,QAAO,YAAW,YAAW,WAAU,SAC3F,sBACH,KAH6E,UAI/E,CACD,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AACnB,MAAM,wBAAwB,SAAS,WAAW,EAAE,YAAY,mBAAmB;AAC1F,sBAAsB,YAAY;",
6
+ "names": []
7
+ }
@@ -3,8 +3,10 @@ import { useCallback, useEffect, useRef, useState } from "react";
3
3
  const usePaginationSearch = (pageCount, actionRef) => {
4
4
  const [searchValue, setSearchValue] = useState("");
5
5
  const [shouldResetSearchValue, setShouldResetSearchValue] = useState(true);
6
- const timeoutRef = useRef(null);
6
+ const timeoutRef = useRef();
7
7
  useEffect(() => {
8
+ if (typeof pageCount === "string")
9
+ return;
8
10
  if (searchValue !== "" && Number.parseInt(searchValue, 10) <= pageCount) {
9
11
  actionRef.current.setActiveDescendant(searchValue);
10
12
  actionRef.current.scrollOptionIntoView(searchValue);
@@ -18,7 +20,8 @@ const usePaginationSearch = (pageCount, actionRef) => {
18
20
  else
19
21
  setSearchValue((prevValue) => prevValue + e.key);
20
22
  setShouldResetSearchValue(false);
21
- clearTimeout(timeoutRef.current);
23
+ if (timeoutRef.current)
24
+ clearTimeout(timeoutRef.current);
22
25
  timeoutRef.current = setTimeout(() => {
23
26
  setShouldResetSearchValue(true);
24
27
  }, 1e3);