@elliemae/ds-pagination 3.80.0-next.50 → 3.80.0-next.53

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 (202) hide show
  1. package/dist/cjs/parts/DSPaginator/DSPaginator.js +10 -166
  2. package/dist/cjs/parts/DSPaginator/DSPaginator.js.map +2 -2
  3. package/dist/cjs/parts/DSPaginator/{config/usePaginationSearch.js → DSPaginatorCTX.js} +7 -32
  4. package/dist/cjs/parts/DSPaginator/DSPaginatorCTX.js.map +7 -0
  5. package/dist/cjs/parts/DSPaginator/config/{createPaginatorHeader.js → getAmountOfPages.js} +8 -23
  6. package/dist/cjs/parts/DSPaginator/config/getAmountOfPages.js.map +7 -0
  7. package/dist/cjs/parts/DSPaginator/config/getInstanceIds.js +40 -0
  8. package/dist/cjs/parts/DSPaginator/config/getInstanceIds.js.map +7 -0
  9. package/dist/cjs/parts/DSPaginator/config/navigationKeys.js +44 -0
  10. package/dist/cjs/parts/DSPaginator/config/navigationKeys.js.map +7 -0
  11. package/dist/cjs/parts/DSPaginator/config/useFocusTracker.js +77 -0
  12. package/dist/cjs/parts/DSPaginator/config/useFocusTracker.js.map +7 -0
  13. package/dist/cjs/parts/DSPaginator/config/usePaginator.js +73 -49
  14. package/dist/cjs/parts/DSPaginator/config/usePaginator.js.map +2 -2
  15. package/dist/cjs/parts/DSPaginator/config/usePaginatorFloatingContext.js +86 -0
  16. package/dist/cjs/parts/DSPaginator/config/usePaginatorFloatingContext.js.map +7 -0
  17. package/dist/cjs/parts/DSPaginator/config/usePaginatorInteractions.js +170 -0
  18. package/dist/cjs/parts/DSPaginator/config/usePaginatorInteractions.js.map +7 -0
  19. package/dist/cjs/parts/DSPaginator/config/usePaginatorSizing.js +80 -0
  20. package/dist/cjs/parts/DSPaginator/config/usePaginatorSizing.js.map +7 -0
  21. package/dist/cjs/parts/DSPaginator/config/useValidateProps.js.map +2 -2
  22. package/dist/cjs/parts/DSPaginator/constants/index.js +49 -3
  23. package/dist/cjs/parts/DSPaginator/constants/index.js.map +2 -2
  24. package/dist/cjs/parts/DSPaginator/parts/OptionRenderer.js +98 -0
  25. package/dist/cjs/parts/DSPaginator/parts/OptionRenderer.js.map +7 -0
  26. package/dist/cjs/parts/DSPaginator/parts/Panel.js +131 -0
  27. package/dist/cjs/parts/DSPaginator/parts/Panel.js.map +7 -0
  28. package/dist/cjs/parts/DSPaginator/parts/Trigger.js +124 -0
  29. package/dist/cjs/parts/DSPaginator/parts/Trigger.js.map +7 -0
  30. package/dist/cjs/parts/DSPaginator/react-desc-prop-types.js +6 -1
  31. package/dist/cjs/parts/DSPaginator/react-desc-prop-types.js.map +2 -2
  32. package/dist/cjs/parts/DSPaginator/styled.js +113 -38
  33. package/dist/cjs/parts/DSPaginator/styled.js.map +3 -3
  34. package/dist/cjs/parts/DSPaginator/typescript-testing/slot-props.js +12 -1
  35. package/dist/cjs/parts/DSPaginator/typescript-testing/slot-props.js.map +2 -2
  36. package/dist/cjs/parts/DSPaginator/typescript-testing/typescript-testing.js +2 -1
  37. package/dist/cjs/parts/DSPaginator/typescript-testing/typescript-testing.js.map +2 -2
  38. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelector.js +10 -79
  39. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelector.js.map +3 -3
  40. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelectorCTX.js +38 -0
  41. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelectorCTX.js.map +7 -0
  42. package/dist/cjs/parts/DSPerPageSelector/config/getInstanceIds.js +40 -0
  43. package/dist/cjs/parts/DSPerPageSelector/config/getInstanceIds.js.map +7 -0
  44. package/dist/cjs/parts/DSPerPageSelector/config/getOptions.js.map +2 -2
  45. package/dist/cjs/parts/DSPerPageSelector/config/getSelectedOptionIndex.js +36 -0
  46. package/dist/cjs/parts/DSPerPageSelector/config/getSelectedOptionIndex.js.map +7 -0
  47. package/dist/cjs/parts/DSPerPageSelector/config/navigationKeys.js +44 -0
  48. package/dist/cjs/parts/DSPerPageSelector/config/navigationKeys.js.map +7 -0
  49. package/dist/cjs/parts/DSPerPageSelector/config/useFocusTracker.js +83 -0
  50. package/dist/cjs/parts/DSPerPageSelector/config/useFocusTracker.js.map +7 -0
  51. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelector.js +68 -20
  52. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelector.js.map +2 -2
  53. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js +82 -0
  54. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js.map +7 -0
  55. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js +175 -0
  56. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js.map +7 -0
  57. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js +66 -0
  58. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js.map +7 -0
  59. package/dist/cjs/parts/DSPerPageSelector/constants/index.js +47 -8
  60. package/dist/cjs/parts/DSPerPageSelector/constants/index.js.map +2 -2
  61. package/dist/cjs/parts/DSPerPageSelector/parts/OptionRenderer.js +94 -0
  62. package/dist/cjs/parts/DSPerPageSelector/parts/OptionRenderer.js.map +7 -0
  63. package/dist/cjs/parts/DSPerPageSelector/parts/Panel.js +120 -0
  64. package/dist/cjs/parts/DSPerPageSelector/parts/Panel.js.map +7 -0
  65. package/dist/cjs/parts/DSPerPageSelector/parts/Trigger.js +95 -0
  66. package/dist/cjs/parts/DSPerPageSelector/parts/Trigger.js.map +7 -0
  67. package/dist/cjs/parts/DSPerPageSelector/react-desc-prop-types.js +19 -2
  68. package/dist/cjs/parts/DSPerPageSelector/react-desc-prop-types.js.map +2 -2
  69. package/dist/cjs/parts/DSPerPageSelector/styled.js +104 -32
  70. package/dist/cjs/parts/DSPerPageSelector/styled.js.map +2 -2
  71. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/slots-props.js +10 -1
  72. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/slots-props.js.map +2 -2
  73. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/typescript-testing.js +60 -1
  74. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/typescript-testing.js.map +2 -2
  75. package/dist/cjs/react-desc-prop-types.js.map +1 -1
  76. package/dist/esm/parts/DSPaginator/DSPaginator.js +12 -168
  77. package/dist/esm/parts/DSPaginator/DSPaginator.js.map +2 -2
  78. package/dist/esm/parts/DSPaginator/DSPaginatorCTX.js +8 -0
  79. package/dist/esm/parts/DSPaginator/DSPaginatorCTX.js.map +7 -0
  80. package/dist/esm/parts/DSPaginator/config/getAmountOfPages.js +9 -0
  81. package/dist/esm/parts/DSPaginator/config/getAmountOfPages.js.map +7 -0
  82. package/dist/esm/parts/DSPaginator/config/getInstanceIds.js +10 -0
  83. package/dist/esm/parts/DSPaginator/config/getInstanceIds.js.map +7 -0
  84. package/dist/esm/parts/DSPaginator/config/navigationKeys.js +14 -0
  85. package/dist/esm/parts/DSPaginator/config/navigationKeys.js.map +7 -0
  86. package/dist/esm/parts/DSPaginator/config/useFocusTracker.js +47 -0
  87. package/dist/esm/parts/DSPaginator/config/useFocusTracker.js.map +7 -0
  88. package/dist/esm/parts/DSPaginator/config/usePaginator.js +74 -50
  89. package/dist/esm/parts/DSPaginator/config/usePaginator.js.map +2 -2
  90. package/dist/esm/parts/DSPaginator/config/usePaginatorFloatingContext.js +56 -0
  91. package/dist/esm/parts/DSPaginator/config/usePaginatorFloatingContext.js.map +7 -0
  92. package/dist/esm/parts/DSPaginator/config/usePaginatorInteractions.js +140 -0
  93. package/dist/esm/parts/DSPaginator/config/usePaginatorInteractions.js.map +7 -0
  94. package/dist/esm/parts/DSPaginator/config/usePaginatorSizing.js +56 -0
  95. package/dist/esm/parts/DSPaginator/config/usePaginatorSizing.js.map +7 -0
  96. package/dist/esm/parts/DSPaginator/config/useValidateProps.js.map +2 -2
  97. package/dist/esm/parts/DSPaginator/constants/index.js +49 -3
  98. package/dist/esm/parts/DSPaginator/constants/index.js.map +2 -2
  99. package/dist/esm/parts/DSPaginator/parts/OptionRenderer.js +68 -0
  100. package/dist/esm/parts/DSPaginator/parts/OptionRenderer.js.map +7 -0
  101. package/dist/esm/parts/DSPaginator/parts/Panel.js +101 -0
  102. package/dist/esm/parts/DSPaginator/parts/Panel.js.map +7 -0
  103. package/dist/esm/parts/DSPaginator/parts/Trigger.js +94 -0
  104. package/dist/esm/parts/DSPaginator/parts/Trigger.js.map +7 -0
  105. package/dist/esm/parts/DSPaginator/react-desc-prop-types.js +6 -1
  106. package/dist/esm/parts/DSPaginator/react-desc-prop-types.js.map +2 -2
  107. package/dist/esm/parts/DSPaginator/styled.js +120 -39
  108. package/dist/esm/parts/DSPaginator/styled.js.map +2 -2
  109. package/dist/esm/parts/DSPaginator/typescript-testing/slot-props.js +12 -1
  110. package/dist/esm/parts/DSPaginator/typescript-testing/slot-props.js.map +2 -2
  111. package/dist/esm/parts/DSPaginator/typescript-testing/typescript-testing.js +2 -1
  112. package/dist/esm/parts/DSPaginator/typescript-testing/typescript-testing.js.map +2 -2
  113. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelector.js +11 -80
  114. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelector.js.map +3 -3
  115. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelectorCTX.js +8 -0
  116. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelectorCTX.js.map +7 -0
  117. package/dist/esm/parts/DSPerPageSelector/config/getInstanceIds.js +10 -0
  118. package/dist/esm/parts/DSPerPageSelector/config/getInstanceIds.js.map +7 -0
  119. package/dist/esm/parts/DSPerPageSelector/config/getOptions.js.map +2 -2
  120. package/dist/esm/parts/DSPerPageSelector/config/getSelectedOptionIndex.js +6 -0
  121. package/dist/esm/parts/DSPerPageSelector/config/getSelectedOptionIndex.js.map +7 -0
  122. package/dist/esm/parts/DSPerPageSelector/config/navigationKeys.js +14 -0
  123. package/dist/esm/parts/DSPerPageSelector/config/navigationKeys.js.map +7 -0
  124. package/dist/esm/parts/DSPerPageSelector/config/useFocusTracker.js +53 -0
  125. package/dist/esm/parts/DSPerPageSelector/config/useFocusTracker.js.map +7 -0
  126. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelector.js +69 -21
  127. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelector.js.map +2 -2
  128. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js +52 -0
  129. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js.map +7 -0
  130. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js +145 -0
  131. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js.map +7 -0
  132. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js +42 -0
  133. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js.map +7 -0
  134. package/dist/esm/parts/DSPerPageSelector/constants/index.js +47 -8
  135. package/dist/esm/parts/DSPerPageSelector/constants/index.js.map +2 -2
  136. package/dist/esm/parts/DSPerPageSelector/parts/OptionRenderer.js +64 -0
  137. package/dist/esm/parts/DSPerPageSelector/parts/OptionRenderer.js.map +7 -0
  138. package/dist/esm/parts/DSPerPageSelector/parts/Panel.js +90 -0
  139. package/dist/esm/parts/DSPerPageSelector/parts/Panel.js.map +7 -0
  140. package/dist/esm/parts/DSPerPageSelector/parts/Trigger.js +65 -0
  141. package/dist/esm/parts/DSPerPageSelector/parts/Trigger.js.map +7 -0
  142. package/dist/esm/parts/DSPerPageSelector/react-desc-prop-types.js +19 -2
  143. package/dist/esm/parts/DSPerPageSelector/react-desc-prop-types.js.map +2 -2
  144. package/dist/esm/parts/DSPerPageSelector/styled.js +111 -33
  145. package/dist/esm/parts/DSPerPageSelector/styled.js.map +2 -2
  146. package/dist/esm/parts/DSPerPageSelector/typescript-testing/slots-props.js +10 -1
  147. package/dist/esm/parts/DSPerPageSelector/typescript-testing/slots-props.js.map +2 -2
  148. package/dist/esm/parts/DSPerPageSelector/typescript-testing/typescript-testing.js +60 -1
  149. package/dist/esm/parts/DSPerPageSelector/typescript-testing/typescript-testing.js.map +2 -2
  150. package/dist/esm/react-desc-prop-types.js.map +1 -1
  151. package/dist/types/parts/DSPageNextButton/config/usePageNextButton.d.ts +4 -4
  152. package/dist/types/parts/DSPagePrevButton/config/usePagePrevButton.d.ts +4 -4
  153. package/dist/types/parts/DSPaginationContainer/config/usePaginationContainer.d.ts +4 -4
  154. package/dist/types/parts/DSPaginationSeparator/config/usePaginationSeparator.d.ts +4 -4
  155. package/dist/types/parts/DSPaginator/DSPaginator.d.ts +5 -0
  156. package/dist/types/parts/DSPaginator/DSPaginatorCTX.d.ts +5 -0
  157. package/dist/types/parts/DSPaginator/config/getAmountOfPages.d.ts +1 -0
  158. package/dist/types/parts/DSPaginator/config/getInstanceIds.d.ts +3 -0
  159. package/dist/types/parts/DSPaginator/config/navigationKeys.d.ts +3 -0
  160. package/dist/types/parts/DSPaginator/config/useFocusTracker.d.ts +20 -0
  161. package/dist/types/parts/DSPaginator/config/usePaginator.d.ts +52 -18
  162. package/dist/types/parts/DSPaginator/config/usePaginatorFloatingContext.d.ts +31 -0
  163. package/dist/types/parts/DSPaginator/config/usePaginatorInteractions.d.ts +37 -0
  164. package/dist/types/parts/DSPaginator/config/usePaginatorSizing.d.ts +37 -0
  165. package/dist/types/parts/DSPaginator/constants/index.d.ts +36 -1
  166. package/dist/types/parts/DSPaginator/parts/OptionRenderer.d.ts +11 -0
  167. package/dist/types/parts/DSPaginator/parts/Panel.d.ts +5 -0
  168. package/dist/types/parts/DSPaginator/parts/Trigger.d.ts +5 -0
  169. package/dist/types/parts/DSPaginator/react-desc-prop-types.d.ts +17 -0
  170. package/dist/types/parts/DSPaginator/styled.d.ts +17 -4
  171. package/dist/types/parts/DSPerPageSelector/DSPerPageSelector.d.ts +5 -0
  172. package/dist/types/parts/DSPerPageSelector/DSPerPageSelectorCTX.d.ts +5 -0
  173. package/dist/types/parts/DSPerPageSelector/config/getInstanceIds.d.ts +3 -0
  174. package/dist/types/parts/DSPerPageSelector/config/getOptions.d.ts +3 -3
  175. package/dist/types/parts/DSPerPageSelector/config/getSelectedOptionIndex.d.ts +2 -0
  176. package/dist/types/parts/DSPerPageSelector/config/navigationKeys.d.ts +3 -0
  177. package/dist/types/parts/DSPerPageSelector/config/useFocusTracker.d.ts +22 -0
  178. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelector.d.ts +43 -10
  179. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.d.ts +31 -0
  180. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.d.ts +38 -0
  181. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelectorSizing.d.ts +25 -0
  182. package/dist/types/parts/DSPerPageSelector/constants/index.d.ts +32 -5
  183. package/dist/types/parts/DSPerPageSelector/parts/OptionRenderer.d.ts +11 -0
  184. package/dist/types/parts/DSPerPageSelector/parts/Panel.d.ts +5 -0
  185. package/dist/types/parts/DSPerPageSelector/parts/Trigger.d.ts +5 -0
  186. package/dist/types/parts/DSPerPageSelector/react-desc-prop-types.d.ts +27 -2
  187. package/dist/types/parts/DSPerPageSelector/styled.d.ts +15 -2
  188. package/dist/types/react-desc-prop-types.d.ts +2 -2
  189. package/package.json +15 -13
  190. package/dist/cjs/parts/DSPaginator/config/createPaginatorHeader.js.map +0 -7
  191. package/dist/cjs/parts/DSPaginator/config/getOptions.js +0 -76
  192. package/dist/cjs/parts/DSPaginator/config/getOptions.js.map +0 -7
  193. package/dist/cjs/parts/DSPaginator/config/usePaginationSearch.js.map +0 -7
  194. package/dist/esm/parts/DSPaginator/config/createPaginatorHeader.js +0 -24
  195. package/dist/esm/parts/DSPaginator/config/createPaginatorHeader.js.map +0 -7
  196. package/dist/esm/parts/DSPaginator/config/getOptions.js +0 -46
  197. package/dist/esm/parts/DSPaginator/config/getOptions.js.map +0 -7
  198. package/dist/esm/parts/DSPaginator/config/usePaginationSearch.js +0 -33
  199. package/dist/esm/parts/DSPaginator/config/usePaginationSearch.js.map +0 -7
  200. package/dist/types/parts/DSPaginator/config/createPaginatorHeader.d.ts +0 -9
  201. package/dist/types/parts/DSPaginator/config/getOptions.d.ts +0 -8
  202. package/dist/types/parts/DSPaginator/config/usePaginationSearch.d.ts +0 -1
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import { useCallback, useMemo } from "react";
3
+ import { useOnElementResize } from "../../shared/useOnElementOnResize.js";
4
+ import {
5
+ PAGINATOR_DEFAULT_LIST_WIDTH,
6
+ PAGINATOR_HEADER_HEIGHT,
7
+ PAGINATOR_PANEL_MAX_HEIGHT,
8
+ PAGINATOR_PANEL_PADDING_BOTTOM,
9
+ PAGINATOR_VIEWPORT_MARGIN
10
+ } from "../constants/index.js";
11
+ const toCssLength = (value) => typeof value === "number" ? `${value}px` : value;
12
+ const usePaginatorSizing = ({
13
+ pageCount,
14
+ pageIndex,
15
+ pageDetails,
16
+ listWidth,
17
+ chevronRef,
18
+ pageInfoRef,
19
+ listActionRef
20
+ }) => {
21
+ const { width: chevronWidth } = useOnElementResize(chevronRef);
22
+ const { width: pageInfoWidth } = useOnElementResize(pageInfoRef);
23
+ const hasDetails = pageDetails.length !== 0;
24
+ const configuredWidth = useMemo(() => {
25
+ if (listWidth !== void 0) return toCssLength(listWidth);
26
+ return hasDetails ? `${PAGINATOR_DEFAULT_LIST_WIDTH}px` : void 0;
27
+ }, [hasDetails, listWidth]);
28
+ const cappedWidth = configuredWidth ? `min(${configuredWidth}, calc(100vw - ${PAGINATOR_VIEWPORT_MARGIN}px))` : void 0;
29
+ const panelStyle = useMemo(
30
+ () => cappedWidth ? { width: cappedWidth } : { minWidth: `calc(${chevronWidth + 60}px + ${pageCount.toString().length}ch)` },
31
+ [cappedWidth, chevronWidth, pageCount]
32
+ );
33
+ const listMaxHeight = PAGINATOR_PANEL_MAX_HEIGHT - PAGINATOR_HEADER_HEIGHT - PAGINATOR_PANEL_PADDING_BOTTOM;
34
+ const handleListWrapperRef = useCallback(
35
+ (node) => {
36
+ if (node) listActionRef.current.scrollTo?.(pageIndex - 1, { align: "center" });
37
+ },
38
+ [listActionRef, pageIndex]
39
+ );
40
+ return useMemo(
41
+ () => ({
42
+ hasDetails,
43
+ chevronWidth,
44
+ pageInfoWidth,
45
+ panelStyle,
46
+ detailMaxWidth: cappedWidth,
47
+ listMaxHeight,
48
+ handleListWrapperRef
49
+ }),
50
+ [hasDetails, chevronWidth, pageInfoWidth, panelStyle, cappedWidth, listMaxHeight, handleListWrapperRef]
51
+ );
52
+ };
53
+ export {
54
+ usePaginatorSizing
55
+ };
56
+ //# sourceMappingURL=usePaginatorSizing.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/usePaginatorSizing.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSFastListT } from '@elliemae/ds-fast-list';\nimport type React from 'react';\nimport { useCallback, useMemo } from 'react';\nimport { useOnElementResize } from '../../shared/useOnElementOnResize.js';\nimport {\n PAGINATOR_DEFAULT_LIST_WIDTH,\n PAGINATOR_HEADER_HEIGHT,\n PAGINATOR_PANEL_MAX_HEIGHT,\n PAGINATOR_PANEL_PADDING_BOTTOM,\n PAGINATOR_VIEWPORT_MARGIN,\n} from '../constants/index.js';\n\ntype SizingConfigT = {\n pageCount: number | string;\n pageIndex: number;\n pageDetails: string[] | readonly string[];\n listWidth?: number | string;\n chevronRef: React.RefObject<HTMLElement>;\n pageInfoRef: React.RefObject<HTMLDivElement>;\n listActionRef: React.MutableRefObject<DSFastListT.ActionRef>;\n};\n\nconst toCssLength = (value: number | string) => (typeof value === 'number' ? `${value}px` : value);\n\n/**\n * Everything about sizes. The rows of the list are virtualized (out of flow), so nothing inside the list can make the panel\n * grow: its width is an explicit policy, not something derived from its content.\n * - with `pageDetails` (or when the consumer passes `listWidth`) the list is `listWidth` wide (280px by default), never wider\n * than the viewport, and the details WRAP inside it. Nothing here renders or measures every detail: that would be O(n) hidden\n * components just to size the list to the widest detail, and it forced a one-line (truncating) design.\n * - without details the list is as wide as its page numbers need (the previous formula: chevron + 60px + the digits of the\n * page count in `ch`), plain CSS.\n * The trigger does not reserve the width of the widest detail either: it follows the detail of the current page.\n */\nexport const usePaginatorSizing = ({\n pageCount,\n pageIndex,\n pageDetails,\n listWidth,\n chevronRef,\n pageInfoRef,\n listActionRef,\n}: SizingConfigT) => {\n const { width: chevronWidth } = useOnElementResize(chevronRef);\n const { width: pageInfoWidth } = useOnElementResize(pageInfoRef);\n const hasDetails = pageDetails.length !== 0;\n\n const configuredWidth = useMemo(() => {\n if (listWidth !== undefined) return toCssLength(listWidth);\n return hasDetails ? `${PAGINATOR_DEFAULT_LIST_WIDTH}px` : undefined;\n }, [hasDetails, listWidth]);\n const cappedWidth = configuredWidth\n ? `min(${configuredWidth}, calc(100vw - ${PAGINATOR_VIEWPORT_MARGIN}px))`\n : undefined;\n const panelStyle = useMemo(\n () =>\n cappedWidth\n ? { width: cappedWidth }\n : { minWidth: `calc(${chevronWidth + 60}px + ${pageCount.toString().length}ch)` },\n [cappedWidth, chevronWidth, pageCount],\n );\n // the tallest the scrolling list gets: the rows can wrap, so the list is as tall as its rows up to this maximum\n const listMaxHeight = PAGINATOR_PANEL_MAX_HEIGHT - PAGINATOR_HEADER_HEIGHT - PAGINATOR_PANEL_PADDING_BOTTOM;\n\n /*\n * The virtual list mounts at scroll offset 0, but the selected page (where the focus must land on open) can be\n * anywhere, and the virtualizer resets its scroll element to its initial offset when it binds to it (measured: a\n * `scrollTop` set when the container mounts is overwritten with 0). So the list is told to scroll once it is bound:\n * React attaches the ref callbacks child first, so this one, on the element that wraps the list, runs after the list's\n * own layout effects (no effect, no timer). The selected option then mounts in range and focuses itself (focus tracker).\n * The callback changes only when `pageIndex` changes, which closes the list.\n */\n const handleListWrapperRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node) listActionRef.current.scrollTo?.(pageIndex - 1, { align: 'center' });\n },\n [listActionRef, pageIndex],\n );\n\n return useMemo(\n () => ({\n hasDetails,\n chevronWidth,\n pageInfoWidth,\n panelStyle,\n detailMaxWidth: cappedWidth,\n listMaxHeight,\n handleListWrapperRef,\n }),\n [hasDetails, chevronWidth, pageInfoWidth, panelStyle, cappedWidth, listMaxHeight, handleListWrapperRef],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,aAAa,eAAe;AACrC,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYP,MAAM,cAAc,CAAC,UAA4B,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAYrF,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAqB;AACnB,QAAM,EAAE,OAAO,aAAa,IAAI,mBAAmB,UAAU;AAC7D,QAAM,EAAE,OAAO,cAAc,IAAI,mBAAmB,WAAW;AAC/D,QAAM,aAAa,YAAY,WAAW;AAE1C,QAAM,kBAAkB,QAAQ,MAAM;AACpC,QAAI,cAAc,OAAW,QAAO,YAAY,SAAS;AACzD,WAAO,aAAa,GAAG,4BAA4B,OAAO;AAAA,EAC5D,GAAG,CAAC,YAAY,SAAS,CAAC;AAC1B,QAAM,cAAc,kBAChB,OAAO,eAAe,kBAAkB,yBAAyB,SACjE;AACJ,QAAM,aAAa;AAAA,IACjB,MACE,cACI,EAAE,OAAO,YAAY,IACrB,EAAE,UAAU,QAAQ,eAAe,EAAE,QAAQ,UAAU,SAAS,EAAE,MAAM,MAAM;AAAA,IACpF,CAAC,aAAa,cAAc,SAAS;AAAA,EACvC;AAEA,QAAM,gBAAgB,6BAA6B,0BAA0B;AAU7E,QAAM,uBAAuB;AAAA,IAC3B,CAAC,SAAgC;AAC/B,UAAI,KAAM,eAAc,QAAQ,WAAW,YAAY,GAAG,EAAE,OAAO,SAAS,CAAC;AAAA,IAC/E;AAAA,IACA,CAAC,eAAe,SAAS;AAAA,EAC3B;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,YAAY,cAAc,eAAe,YAAY,aAAa,eAAe,oBAAoB;AAAA,EACxG;AACF;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/useValidateProps.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSPaginatorT } from '../react-desc-prop-types.js';\nimport { DSPaginatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSPaginatorT.InternalProps,\n propTypes: ValidationMap<DSPaginatorT.Props>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSPaginatorName);\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,uBAAuB;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,eAAe;AAClE;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSPaginatorT } from '../react-desc-prop-types.js';\nimport { DSPaginatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSPaginatorT.InternalProps,\n propTypes: ValidationMap<DSPaginatorT.Props>,\n): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSPaginatorName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,uBAAuB;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AACT,iCAA+B,OAAO,WAAW,eAAe;AAClE;",
6
6
  "names": []
7
7
  }
@@ -3,13 +3,59 @@ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
3
  import { DSPaginationName } from "../../../constants/index.js";
4
4
  const DSPaginatorName = "DSPaginator";
5
5
  const PAGINATOR_SLOTS = {
6
- PAGINATOR: "paginator"
6
+ PAGINATOR: "paginator",
7
+ // legacy ones...
8
+ TRIGGER_WRAPPER: "paginator-trigger-wrapper",
9
+ PAGE_INFO: "paginator-page-info",
10
+ FLOATING_WRAPPER: "paginator-floating-wrapper",
11
+ PANEL: "paginator-panel",
12
+ HEADER: "paginator-header",
13
+ LIST_WRAPPER: "paginator-list-wrapper",
14
+ LIST: "paginator-list",
15
+ OPTION: "paginator-option",
16
+ OPTION_CHECKMARK: "paginator-option-checkmark",
17
+ OPTION_PAGE: "paginator-option-page",
18
+ OPTION_DETAIL: "paginator-option-detail"
7
19
  };
8
- const PAGINATOR_DATA_TESTID = slotObjectToDataTestIds(DSPaginationName, PAGINATOR_SLOTS);
20
+ const PAGINATOR_DATA_TESTID = {
21
+ ...slotObjectToDataTestIds(DSPaginationName, PAGINATOR_SLOTS),
22
+ // legacy values of the DSDropdownMenuV2 the paginator used to render: the paginator is now its own widget but QA and
23
+ // consumers select on these, so they stay on the equivalent element — breaking change if removed
24
+ TRIGGER_WRAPPER: "dropdown-menu-trigger-wrapper",
25
+ // wraps the trigger
26
+ PANEL: "dropdown-menu-wrapper",
27
+ // wraps the header and the list (it used to be the focus holder of the open menu)
28
+ HEADER: "ds-dropdownmenu-header-wrapper",
29
+ LIST: "dropdown-menu-listbox",
30
+ OPTION: "ds-menu-item"
31
+ // one per page
32
+ };
33
+ const PAGINATOR_REGION_FOCUSES = {
34
+ RESET: "",
35
+ TRIGGER: "trigger",
36
+ OPTION_PREFIX: "option-"
37
+ };
38
+ const PAGINATOR_OPTION_HEIGHT = 32;
39
+ const PAGINATOR_PANEL_MAX_HEIGHT = 300;
40
+ const PAGINATOR_HEADER_HEIGHT = 17;
41
+ const PAGINATOR_PANEL_PADDING_BOTTOM = 4;
42
+ const PAGINATOR_DEFAULT_LIST_WIDTH = 280;
43
+ const PAGINATOR_VIEWPORT_MARGIN = 16;
44
+ const PAGINATOR_PAGE_JUMP = 10;
45
+ const PAGINATOR_TYPEAHEAD_RESET_MS = 1e3;
9
46
  export {
10
47
  DSPaginationName,
11
48
  DSPaginatorName,
12
49
  PAGINATOR_DATA_TESTID,
13
- PAGINATOR_SLOTS
50
+ PAGINATOR_DEFAULT_LIST_WIDTH,
51
+ PAGINATOR_HEADER_HEIGHT,
52
+ PAGINATOR_OPTION_HEIGHT,
53
+ PAGINATOR_PAGE_JUMP,
54
+ PAGINATOR_PANEL_MAX_HEIGHT,
55
+ PAGINATOR_PANEL_PADDING_BOTTOM,
56
+ PAGINATOR_REGION_FOCUSES,
57
+ PAGINATOR_SLOTS,
58
+ PAGINATOR_TYPEAHEAD_RESET_MS,
59
+ PAGINATOR_VIEWPORT_MARGIN
14
60
  };
15
61
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/constants/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { DSPaginationName } from '../../../constants/index.js';\nexport { DSPaginationName };\n\nexport const DSPaginatorName = 'DSPaginator';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PAGINATOR_SLOTS = {\n PAGINATOR: 'paginator',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PAGINATOR_DATA_TESTID = slotObjectToDataTestIds(DSPaginationName, PAGINATOR_SLOTS);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAG1B,MAAM,kBAAkB;AAGxB,MAAM,kBAAkB;AAAA,EAC7B,WAAW;AACb;AAGO,MAAM,wBAAwB,wBAAwB,kBAAkB,eAAe;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { DSPaginationName } from '../../../constants/index.js';\nexport { DSPaginationName };\n\nexport const DSPaginatorName = 'DSPaginator';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\n// the slots are owned by DSPagination (DSPaginationName): `paginator` is the legacy one (the trigger), the rest are new\nexport const PAGINATOR_SLOTS = {\n PAGINATOR: 'paginator', // legacy ones...\n TRIGGER_WRAPPER: 'paginator-trigger-wrapper',\n PAGE_INFO: 'paginator-page-info',\n FLOATING_WRAPPER: 'paginator-floating-wrapper',\n PANEL: 'paginator-panel',\n HEADER: 'paginator-header',\n LIST_WRAPPER: 'paginator-list-wrapper',\n LIST: 'paginator-list',\n OPTION: 'paginator-option',\n OPTION_CHECKMARK: 'paginator-option-checkmark',\n OPTION_PAGE: 'paginator-option-page',\n OPTION_DETAIL: 'paginator-option-detail',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PAGINATOR_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSPaginationName, PAGINATOR_SLOTS),\n // legacy values of the DSDropdownMenuV2 the paginator used to render: the paginator is now its own widget but QA and\n // consumers select on these, so they stay on the equivalent element \u2014 breaking change if removed\n TRIGGER_WRAPPER: 'dropdown-menu-trigger-wrapper', // wraps the trigger\n PANEL: 'dropdown-menu-wrapper', // wraps the header and the list (it used to be the focus holder of the open menu)\n HEADER: 'ds-dropdownmenu-header-wrapper',\n LIST: 'dropdown-menu-listbox',\n OPTION: 'ds-menu-item', // one per page\n};\n\n// we are naming this with the ${component_name}_region_focuses convention to namespace & avoid errors on duplicate exports variables in aggregators\n// semantic identities of the focus tracker: never positional, an option is identified by the page it represents\nexport const PAGINATOR_REGION_FOCUSES = {\n RESET: '',\n TRIGGER: 'trigger',\n OPTION_PREFIX: 'option-',\n} as const;\n\n// the rows of the list are fixed height, the virtual list estimate and the panel height are derived from it\nexport const PAGINATOR_OPTION_HEIGHT = 32;\n// the max height of the whole panel (header + list), same as the existing DSPaginator (measured: header ~17px)\nexport const PAGINATOR_PANEL_MAX_HEIGHT = 300;\nexport const PAGINATOR_HEADER_HEIGHT = 17;\n// the previous DSDropdownMenuV2 wrapper always kept 4px of padding below the list, inside the same max height\nexport const PAGINATOR_PANEL_PADDING_BOTTOM = 4;\n// the width of the open list when there are page details: details wrap inside it instead of the list growing to the widest\n// one (that would need every detail rendered and measured up front). Overridable with the `listWidth` prop.\nexport const PAGINATOR_DEFAULT_LIST_WIDTH = 280;\n// the list never gets wider than the viewport minus this margin (reflow at high zoom levels)\nexport const PAGINATOR_VIEWPORT_MARGIN = 16;\n// APG listbox / select-only combobox: PageUp / PageDown move 10 options\nexport const PAGINATOR_PAGE_JUMP = 10;\n// digits typed within this window build a single page number (same value as the existing DSPaginator search)\nexport const PAGINATOR_TYPEAHEAD_RESET_MS = 1000;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAG1B,MAAM,kBAAkB;AAIxB,MAAM,kBAAkB;AAAA,EAC7B,WAAW;AAAA;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,eAAe;AACjB;AAGO,MAAM,wBAAwB;AAAA,EACnC,GAAG,wBAAwB,kBAAkB,eAAe;AAAA;AAAA;AAAA,EAG5D,iBAAiB;AAAA;AAAA,EACjB,OAAO;AAAA;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA;AACV;AAIO,MAAM,2BAA2B;AAAA,EACtC,OAAO;AAAA,EACP,SAAS;AAAA,EACT,eAAe;AACjB;AAGO,MAAM,0BAA0B;AAEhC,MAAM,6BAA6B;AACnC,MAAM,0BAA0B;AAEhC,MAAM,iCAAiC;AAGvC,MAAM,+BAA+B;AAErC,MAAM,4BAA4B;AAElC,MAAM,sBAAsB;AAE5B,MAAM,+BAA+B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,68 @@
1
+ import * as React from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Checkmark } from "@elliemae/ds-icons";
4
+ import { useCallback, useContext } from "react";
5
+ import { getOptionRegionId } from "../config/useFocusTracker.js";
6
+ import { PAGINATOR_DATA_TESTID } from "../constants/index.js";
7
+ import { DSPaginatorContext } from "../DSPaginatorCTX.js";
8
+ import { StyledOption, StyledOptionCheckmark, StyledOptionDetail, StyledOptionPage } from "../styled.js";
9
+ const OptionRenderer = ({ index }) => {
10
+ const {
11
+ propsWithDefault: { pageIndex, pageDetails },
12
+ ownerPropsConfig: { getOwnerProps },
13
+ amountOfPages,
14
+ hasDetails,
15
+ chevronWidth,
16
+ pageInfoWidth,
17
+ focusTrackers: { focusRegion, trackFocusOption },
18
+ commitPage
19
+ } = useContext(DSPaginatorContext);
20
+ const page = index + 1;
21
+ const isSelected = page === pageIndex;
22
+ const isFocusTarget = focusRegion === getOptionRegionId(page);
23
+ const handleRef = useCallback(
24
+ (node) => {
25
+ if (node && isFocusTarget) node.focus();
26
+ },
27
+ [isFocusTarget]
28
+ );
29
+ const handleFocus = useCallback(() => trackFocusOption(page), [page, trackFocusOption]);
30
+ const handleClick = useCallback(() => commitPage(page), [commitPage, page]);
31
+ const getOwnerPropsArguments = useCallback(() => ({ page, isSelected }), [page, isSelected]);
32
+ return /* @__PURE__ */ jsxs(
33
+ StyledOption,
34
+ {
35
+ "data-testid": PAGINATOR_DATA_TESTID.OPTION,
36
+ role: "option",
37
+ "aria-selected": isSelected,
38
+ "aria-setsize": amountOfPages,
39
+ "aria-posinset": page,
40
+ tabIndex: isFocusTarget ? 0 : -1,
41
+ innerRef: handleRef,
42
+ onFocus: handleFocus,
43
+ onClick: handleClick,
44
+ style: {
45
+ gridTemplateColumns: hasDetails ? `${chevronWidth}px ${pageInfoWidth + 16}px auto` : `${chevronWidth}px auto`
46
+ },
47
+ getOwnerProps,
48
+ getOwnerPropsArguments,
49
+ children: [
50
+ /* @__PURE__ */ jsx(
51
+ StyledOptionCheckmark,
52
+ {
53
+ "aria-hidden": "true",
54
+ getOwnerProps,
55
+ getOwnerPropsArguments,
56
+ children: isSelected ? /* @__PURE__ */ jsx(Checkmark, { size: "s", color: ["brand-primary", "600"] }) : null
57
+ }
58
+ ),
59
+ /* @__PURE__ */ jsx(StyledOptionPage, { getOwnerProps, getOwnerPropsArguments, children: page }),
60
+ hasDetails ? /* @__PURE__ */ jsx(StyledOptionDetail, { getOwnerProps, getOwnerPropsArguments, children: pageDetails[index] }) : null
61
+ ]
62
+ }
63
+ );
64
+ };
65
+ export {
66
+ OptionRenderer
67
+ };
68
+ //# sourceMappingURL=OptionRenderer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/parts/OptionRenderer.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Checkmark } from '@elliemae/ds-icons';\nimport React, { useCallback, useContext } from 'react';\nimport { getOptionRegionId } from '../config/useFocusTracker.js';\nimport { PAGINATOR_DATA_TESTID } from '../constants/index.js';\nimport { DSPaginatorContext } from '../DSPaginatorCTX.js';\nimport { StyledOption, StyledOptionCheckmark, StyledOptionDetail, StyledOptionPage } from '../styled.js';\n\ntype OptionRendererPropsT = { index: number };\n\n/**\n * One page of the list. Rendered by the virtual list, so only the options near the viewport are mounted:\n * every position-dependent a11y fact (`aria-posinset`, `aria-setsize`) is explicit, and the focus lands on an option by\n * its page identity from the ref callback (see useFocusTracker), not by its place in the DOM.\n */\nexport const OptionRenderer = ({ index }: OptionRendererPropsT) => {\n const {\n propsWithDefault: { pageIndex, pageDetails },\n ownerPropsConfig: { getOwnerProps },\n amountOfPages,\n hasDetails,\n chevronWidth,\n pageInfoWidth,\n focusTrackers: { focusRegion, trackFocusOption },\n commitPage,\n } = useContext(DSPaginatorContext);\n\n const page = index + 1;\n const isSelected = page === pageIndex;\n const isFocusTarget = focusRegion === getOptionRegionId(page);\n\n const handleRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node && isFocusTarget) node.focus();\n },\n [isFocusTarget],\n );\n // the tracker follows the real focus, so a mouse or pointer interaction can't leave it pointing somewhere else\n const handleFocus = useCallback(() => trackFocusOption(page), [page, trackFocusOption]);\n const handleClick = useCallback(() => commitPage(page), [commitPage, page]);\n const getOwnerPropsArguments = useCallback(() => ({ page, isSelected }), [page, isSelected]);\n\n return (\n <StyledOption\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={PAGINATOR_DATA_TESTID.OPTION}\n role=\"option\"\n aria-selected={isSelected}\n aria-setsize={amountOfPages}\n aria-posinset={page}\n // roving tabindex: the option that holds the focus is the single tab stop of the list\n tabIndex={isFocusTarget ? 0 : -1}\n innerRef={handleRef}\n onFocus={handleFocus}\n onClick={handleClick}\n // same columns as the header: [checkmark] [page] [detail]\n style={{\n gridTemplateColumns: hasDetails ? `${chevronWidth}px ${pageInfoWidth + 16}px auto` : `${chevronWidth}px auto`,\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {/* the selected state is conveyed by aria-selected, the icon is only visual */}\n <StyledOptionCheckmark\n aria-hidden=\"true\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {isSelected ? <Checkmark size=\"s\" color={['brand-primary', '600']} /> : null}\n </StyledOptionCheckmark>\n <StyledOptionPage getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {page}\n </StyledOptionPage>\n {hasDetails ? (\n <StyledOptionDetail getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {pageDetails[index]}\n </StyledOptionDetail>\n ) : null}\n </StyledOption>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0CnB,SAyBkB,KAzBlB;AA1CJ,SAAS,iBAAiB;AAC1B,SAAgB,aAAa,kBAAkB;AAC/C,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AACnC,SAAS,cAAc,uBAAuB,oBAAoB,wBAAwB;AASnF,MAAM,iBAAiB,CAAC,EAAE,MAAM,MAA4B;AACjE,QAAM;AAAA,IACJ,kBAAkB,EAAE,WAAW,YAAY;AAAA,IAC3C,kBAAkB,EAAE,cAAc;AAAA,IAClC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,EAAE,aAAa,iBAAiB;AAAA,IAC/C;AAAA,EACF,IAAI,WAAW,kBAAkB;AAEjC,QAAM,OAAO,QAAQ;AACrB,QAAM,aAAa,SAAS;AAC5B,QAAM,gBAAgB,gBAAgB,kBAAkB,IAAI;AAE5D,QAAM,YAAY;AAAA,IAChB,CAAC,SAAgC;AAC/B,UAAI,QAAQ,cAAe,MAAK,MAAM;AAAA,IACxC;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAEA,QAAM,cAAc,YAAY,MAAM,iBAAiB,IAAI,GAAG,CAAC,MAAM,gBAAgB,CAAC;AACtF,QAAM,cAAc,YAAY,MAAM,WAAW,IAAI,GAAG,CAAC,YAAY,IAAI,CAAC;AAC1E,QAAM,yBAAyB,YAAY,OAAO,EAAE,MAAM,WAAW,IAAI,CAAC,MAAM,UAAU,CAAC;AAE3F,SACE;AAAA,IAAC;AAAA;AAAA,MAEC,eAAa,sBAAsB;AAAA,MACnC,MAAK;AAAA,MACL,iBAAe;AAAA,MACf,gBAAc;AAAA,MACd,iBAAe;AAAA,MAEf,UAAU,gBAAgB,IAAI;AAAA,MAC9B,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MAET,OAAO;AAAA,QACL,qBAAqB,aAAa,GAAG,YAAY,MAAM,gBAAgB,EAAE,YAAY,GAAG,YAAY;AAAA,MACtG;AAAA,MACA;AAAA,MACA;AAAA,MAGA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ;AAAA,YACA;AAAA,YAEC,uBAAa,oBAAC,aAAU,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK;AAAA;AAAA,QAC1E;AAAA,QACA,oBAAC,oBAAiB,eAA8B,wBAC7C,gBACH;AAAA,QACC,aACC,oBAAC,sBAAmB,eAA8B,wBAC/C,sBAAY,KAAK,GACpB,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,101 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useContext } from "react";
4
+ import { DSPaginationSeparator } from "../../DSPaginationSeparator/index.js";
5
+ import { PAGINATOR_DATA_TESTID, PAGINATOR_OPTION_HEIGHT } from "../constants/index.js";
6
+ import { DSPaginatorContext } from "../DSPaginatorCTX.js";
7
+ import { StyledFloatingWrapper, StyledHeader, StyledList, StyledListWrapper, StyledPanel } from "../styled.js";
8
+ import { OptionRenderer } from "./OptionRenderer.js";
9
+ const getOptionId = (index) => index + 1;
10
+ const getEstimatedSize = () => PAGINATOR_OPTION_HEIGHT;
11
+ const Panel = () => {
12
+ const {
13
+ propsWithDefault: { pageDetailsTitle },
14
+ ownerPropsConfig,
15
+ isOpen,
16
+ amountOfPages,
17
+ hasDetails,
18
+ chevronWidth,
19
+ pageInfoWidth,
20
+ panelStyle,
21
+ listMaxHeight,
22
+ floatingStyles,
23
+ floatingContext,
24
+ floatingInnerRef,
25
+ listActionRef,
26
+ handleListWrapperRef,
27
+ handlePanelKeyDown,
28
+ handlePanelKeyDownCapture,
29
+ handleBlurOutOfWidget,
30
+ headerId,
31
+ listId,
32
+ dialogId
33
+ } = useContext(DSPaginatorContext);
34
+ const hasDetailsTitle = hasDetails && pageDetailsTitle !== "";
35
+ return /* @__PURE__ */ jsx(
36
+ StyledFloatingWrapper,
37
+ {
38
+ innerRef: floatingInnerRef,
39
+ isOpen,
40
+ floatingStyles,
41
+ context: floatingContext,
42
+ id: dialogId,
43
+ role: "dialog",
44
+ "aria-labelledby": headerId,
45
+ ...ownerPropsConfig,
46
+ children: /* @__PURE__ */ jsxs(
47
+ StyledPanel,
48
+ {
49
+ "data-testid": PAGINATOR_DATA_TESTID.PANEL,
50
+ style: panelStyle,
51
+ onKeyDownCapture: handlePanelKeyDownCapture,
52
+ onKeyDown: handlePanelKeyDown,
53
+ onBlur: handleBlurOutOfWidget,
54
+ ...ownerPropsConfig,
55
+ children: [
56
+ /* @__PURE__ */ jsx(
57
+ StyledHeader,
58
+ {
59
+ id: headerId,
60
+ "data-testid": PAGINATOR_DATA_TESTID.HEADER,
61
+ cols: hasDetailsTitle ? [`${pageInfoWidth + chevronWidth + 34}px`, "8px", "auto"] : void 0,
62
+ ...ownerPropsConfig,
63
+ children: hasDetailsTitle ? /* @__PURE__ */ jsxs(Fragment, { children: [
64
+ /* @__PURE__ */ jsx("span", { style: { marginLeft: "8px" }, children: "Page" }),
65
+ /* @__PURE__ */ jsx(DSPaginationSeparator, { height: "100%", ...ownerPropsConfig }),
66
+ /* @__PURE__ */ jsx("span", { children: pageDetailsTitle })
67
+ ] }) : /* @__PURE__ */ jsx("span", { children: "Page" })
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsx(StyledListWrapper, { innerRef: handleListWrapperRef, ...ownerPropsConfig, children: /* @__PURE__ */ jsx(
71
+ StyledList,
72
+ {
73
+ dsFastlistWrapperList: {
74
+ role: "listbox",
75
+ id: listId,
76
+ "aria-labelledby": headerId,
77
+ // legacy data-testid — preserved for QA/consumer compatibility, breaking change if removed
78
+ "data-testid": PAGINATOR_DATA_TESTID.LIST
79
+ },
80
+ dsFastlistItem: { role: "none" },
81
+ dsFastlistContainer: { style: { height: "auto", maxHeight: listMaxHeight } },
82
+ actionRef: listActionRef,
83
+ count: amountOfPages,
84
+ ItemRenderer: OptionRenderer,
85
+ getId: getOptionId,
86
+ estimateSize: getEstimatedSize,
87
+ remountOnCountChange: false,
88
+ ...ownerPropsConfig
89
+ }
90
+ ) })
91
+ ]
92
+ }
93
+ )
94
+ }
95
+ );
96
+ };
97
+ Panel.displayName = "DSPaginator.Panel";
98
+ export {
99
+ Panel
100
+ };
101
+ //# sourceMappingURL=Panel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/parts/Panel.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { DSPaginationSeparator } from '../../DSPaginationSeparator/index.js';\nimport { PAGINATOR_DATA_TESTID, PAGINATOR_OPTION_HEIGHT } from '../constants/index.js';\nimport { DSPaginatorContext } from '../DSPaginatorCTX.js';\nimport { StyledFloatingWrapper, StyledHeader, StyledList, StyledListWrapper, StyledPanel } from '../styled.js';\nimport { OptionRenderer } from './OptionRenderer.js';\n\n// stable references: the virtual list reads them on every render\nconst getOptionId = (index: number) => index + 1;\nconst getEstimatedSize = () => PAGINATOR_OPTION_HEIGHT;\n\nexport const Panel = () => {\n const {\n propsWithDefault: { pageDetailsTitle },\n ownerPropsConfig,\n isOpen,\n amountOfPages,\n hasDetails,\n chevronWidth,\n pageInfoWidth,\n panelStyle,\n listMaxHeight,\n floatingStyles,\n floatingContext,\n floatingInnerRef,\n listActionRef,\n handleListWrapperRef,\n handlePanelKeyDown,\n handlePanelKeyDownCapture,\n handleBlurOutOfWidget,\n headerId,\n listId,\n dialogId,\n } = useContext(DSPaginatorContext);\n\n // same rule as the existing DSPaginator: the two column header only exists when there is a details title\n const hasDetailsTitle = hasDetails && pageDetailsTitle !== '';\n\n // the dialog (non-modal) and the list are named by the visible header, so what is announced is what is displayed\n return (\n <StyledFloatingWrapper\n innerRef={floatingInnerRef}\n isOpen={isOpen}\n floatingStyles={floatingStyles}\n context={floatingContext}\n id={dialogId}\n role=\"dialog\"\n aria-labelledby={headerId}\n {...ownerPropsConfig}\n >\n <StyledPanel\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={PAGINATOR_DATA_TESTID.PANEL}\n style={panelStyle}\n onKeyDownCapture={handlePanelKeyDownCapture}\n onKeyDown={handlePanelKeyDown}\n onBlur={handleBlurOutOfWidget}\n {...ownerPropsConfig}\n >\n <StyledHeader\n id={headerId}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={PAGINATOR_DATA_TESTID.HEADER}\n cols={hasDetailsTitle ? [`${pageInfoWidth + chevronWidth + 34}px`, '8px', 'auto'] : undefined}\n {...ownerPropsConfig}\n >\n {hasDetailsTitle ? (\n <>\n <span style={{ marginLeft: '8px' }}>Page</span>\n <DSPaginationSeparator height=\"100%\" {...ownerPropsConfig} />\n <span>{pageDetailsTitle}</span>\n </>\n ) : (\n <span>Page</span>\n )}\n </StyledHeader>\n <StyledListWrapper innerRef={handleListWrapperRef} {...ownerPropsConfig}>\n <StyledList\n dsFastlistWrapperList={{\n role: 'listbox',\n id: listId,\n 'aria-labelledby': headerId,\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n 'data-testid': PAGINATOR_DATA_TESTID.LIST,\n }}\n // the rows are the options themselves (they carry role=\"option\"), the wrapper of the virtual list is inert\n dsFastlistItem={{ role: 'none' }}\n // rows can wrap, so the list is as tall as its rows up to a maximum (its own default is height: 100%)\n dsFastlistContainer={{ style: { height: 'auto', maxHeight: listMaxHeight } }}\n actionRef={listActionRef}\n count={amountOfPages}\n ItemRenderer={OptionRenderer}\n getId={getOptionId}\n estimateSize={getEstimatedSize}\n remountOnCountChange={false}\n {...ownerPropsConfig}\n />\n </StyledListWrapper>\n </StyledPanel>\n </StyledFloatingWrapper>\n );\n};\n\nPanel.displayName = 'DSPaginator.Panel';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmEX,mBACE,KADF;AAnEZ,SAAgB,kBAAkB;AAClC,SAAS,6BAA6B;AACtC,SAAS,uBAAuB,+BAA+B;AAC/D,SAAS,0BAA0B;AACnC,SAAS,uBAAuB,cAAc,YAAY,mBAAmB,mBAAmB;AAChG,SAAS,sBAAsB;AAG/B,MAAM,cAAc,CAAC,UAAkB,QAAQ;AAC/C,MAAM,mBAAmB,MAAM;AAExB,MAAM,QAAQ,MAAM;AACzB,QAAM;AAAA,IACJ,kBAAkB,EAAE,iBAAiB;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,kBAAkB;AAGjC,QAAM,kBAAkB,cAAc,qBAAqB;AAG3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,mBAAiB;AAAA,MAChB,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UAEC,eAAa,sBAAsB;AAAA,UACnC,OAAO;AAAA,UACP,kBAAkB;AAAA,UAClB,WAAW;AAAA,UACX,QAAQ;AAAA,UACP,GAAG;AAAA,UAEJ;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,IAAI;AAAA,gBAEJ,eAAa,sBAAsB;AAAA,gBACnC,MAAM,kBAAkB,CAAC,GAAG,gBAAgB,eAAe,EAAE,MAAM,OAAO,MAAM,IAAI;AAAA,gBACnF,GAAG;AAAA,gBAEH,4BACC,iCACE;AAAA,sCAAC,UAAK,OAAO,EAAE,YAAY,MAAM,GAAG,kBAAI;AAAA,kBACxC,oBAAC,yBAAsB,QAAO,QAAQ,GAAG,kBAAkB;AAAA,kBAC3D,oBAAC,UAAM,4BAAiB;AAAA,mBAC1B,IAEA,oBAAC,UAAK,kBAAI;AAAA;AAAA,YAEd;AAAA,YACA,oBAAC,qBAAkB,UAAU,sBAAuB,GAAG,kBACrD;AAAA,cAAC;AAAA;AAAA,gBACC,uBAAuB;AAAA,kBACrB,MAAM;AAAA,kBACN,IAAI;AAAA,kBACJ,mBAAmB;AAAA;AAAA,kBAEnB,eAAe,sBAAsB;AAAA,gBACvC;AAAA,gBAEA,gBAAgB,EAAE,MAAM,OAAO;AAAA,gBAE/B,qBAAqB,EAAE,OAAO,EAAE,QAAQ,QAAQ,WAAW,cAAc,EAAE;AAAA,gBAC3E,WAAW;AAAA,gBACX,OAAO;AAAA,gBACP,cAAc;AAAA,gBACd,OAAO;AAAA,gBACP,cAAc;AAAA,gBACd,sBAAsB;AAAA,gBACrB,GAAG;AAAA;AAAA,YACN,GACF;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,94 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSCircularIndeterminateIndicator } from "@elliemae/ds-circular-progress-indicator";
4
+ import { Grid } from "@elliemae/ds-grid";
5
+ import { ChevronDown } from "@elliemae/ds-icons";
6
+ import { DSTypography } from "@elliemae/ds-typography";
7
+ import { useCallback, useContext } from "react";
8
+ import { DSPaginationSeparator } from "../../DSPaginationSeparator/index.js";
9
+ import { PAGINATOR_DATA_TESTID, PAGINATOR_REGION_FOCUSES } from "../constants/index.js";
10
+ import { DSPaginatorContext } from "../DSPaginatorCTX.js";
11
+ import { StyledPageInfo, StyledTrigger, StyledTriggerWrapper } from "../styled.js";
12
+ const Trigger = () => {
13
+ const {
14
+ propsWithDefault: { pageIndex, pageCount, isLoadingPageCount, pageDetails },
15
+ xstyledProps,
16
+ globalAttributes,
17
+ ownerPropsConfig,
18
+ isOpen,
19
+ hasDetails,
20
+ focusTrackers: { focusRegion },
21
+ chevronRef,
22
+ pageInfoRef,
23
+ detailMaxWidth,
24
+ handleTriggerRef,
25
+ handleTriggerClick,
26
+ handleTriggerKeyDown,
27
+ handleBlurOutOfWidget,
28
+ dialogId
29
+ } = useContext(DSPaginatorContext);
30
+ const isFocusTarget = focusRegion === PAGINATOR_REGION_FOCUSES.TRIGGER;
31
+ const handleRef = useCallback(
32
+ (node) => {
33
+ handleTriggerRef(node);
34
+ if (node && isFocusTarget) node.focus();
35
+ },
36
+ [handleTriggerRef, isFocusTarget]
37
+ );
38
+ const currentDetail = hasDetails ? pageDetails[pageIndex - 1] : "";
39
+ const accessibleName = `Page ${pageIndex} out of ${pageCount}${currentDetail ? `, ${currentDetail}` : ""}`;
40
+ return (
41
+ // legacy data-testid (the wrapper of the DSDropdownMenuV2 trigger) — preserved for QA/consumer compatibility, breaking change if removed
42
+ /* @__PURE__ */ jsx(StyledTriggerWrapper, { "data-testid": PAGINATOR_DATA_TESTID.TRIGGER_WRAPPER, ...ownerPropsConfig, children: /* @__PURE__ */ jsx(
43
+ StyledTrigger,
44
+ {
45
+ buttonType: "raw",
46
+ disabled: isLoadingPageCount,
47
+ innerRef: handleRef,
48
+ "aria-haspopup": "dialog",
49
+ "aria-expanded": isOpen,
50
+ "aria-controls": isOpen ? dialogId : void 0,
51
+ "aria-label": accessibleName,
52
+ "data-testid": PAGINATOR_DATA_TESTID.PAGINATOR,
53
+ ...globalAttributes,
54
+ ...xstyledProps,
55
+ ...ownerPropsConfig,
56
+ onClick: handleTriggerClick,
57
+ onKeyDown: handleTriggerKeyDown,
58
+ onBlur: handleBlurOutOfWidget,
59
+ children: /* @__PURE__ */ jsxs(Grid, { gutter: "xxxs", alignItems: "center", style: { gridAutoFlow: "column" }, children: [
60
+ /* @__PURE__ */ jsxs(StyledPageInfo, { innerRef: pageInfoRef, ...ownerPropsConfig, children: [
61
+ /* @__PURE__ */ jsx(DSTypography, { id: "typography-page-index", variant: "b1", as: "span", fontWeight: "semibold", textAlign: "start", children: pageIndex }),
62
+ /* @__PURE__ */ jsxs(DSTypography, { className: "typography-page-info-and-detail", variant: "b1", as: "span", children: [
63
+ "/ ",
64
+ pageCount
65
+ ] })
66
+ ] }),
67
+ isLoadingPageCount && /* @__PURE__ */ jsx(DSCircularIndeterminateIndicator, { ml: "xxxs", mr: "xxxs", size: "xs" }),
68
+ hasDetails && /* @__PURE__ */ jsxs(Fragment, { children: [
69
+ /* @__PURE__ */ jsx(DSPaginationSeparator, { height: "12px", ml: "12px", mr: "xxxs", ...ownerPropsConfig }),
70
+ /* @__PURE__ */ jsx(
71
+ DSTypography,
72
+ {
73
+ className: "typography-page-info-and-detail typography-paginator-detail",
74
+ style: { maxWidth: detailMaxWidth },
75
+ mr: "xxs",
76
+ variant: "b1",
77
+ as: "span",
78
+ fontWeight: "semibold",
79
+ textAlign: "start",
80
+ children: currentDetail
81
+ }
82
+ )
83
+ ] }),
84
+ /* @__PURE__ */ jsx(ChevronDown, { ml: "xxxs", color: ["brand-primary", "700"], innerRef: chevronRef })
85
+ ] })
86
+ }
87
+ ) })
88
+ );
89
+ };
90
+ Trigger.displayName = "DSPaginator.Trigger";
91
+ export {
92
+ Trigger
93
+ };
94
+ //# sourceMappingURL=Trigger.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/parts/Trigger.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSCircularIndeterminateIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ChevronDown } from '@elliemae/ds-icons';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport React, { useCallback, useContext } from 'react';\nimport { DSPaginationSeparator } from '../../DSPaginationSeparator/index.js';\nimport { PAGINATOR_DATA_TESTID, PAGINATOR_REGION_FOCUSES } from '../constants/index.js';\nimport { DSPaginatorContext } from '../DSPaginatorCTX.js';\nimport { StyledPageInfo, StyledTrigger, StyledTriggerWrapper } from '../styled.js';\n\nexport const Trigger = () => {\n const {\n propsWithDefault: { pageIndex, pageCount, isLoadingPageCount, pageDetails },\n xstyledProps,\n globalAttributes,\n ownerPropsConfig,\n isOpen,\n hasDetails,\n focusTrackers: { focusRegion },\n chevronRef,\n pageInfoRef,\n detailMaxWidth,\n handleTriggerRef,\n handleTriggerClick,\n handleTriggerKeyDown,\n handleBlurOutOfWidget,\n dialogId,\n } = useContext(DSPaginatorContext);\n\n // focus tracker: the trigger focuses itself when it is the declared target (e.g. after an option was activated)\n const isFocusTarget = focusRegion === PAGINATOR_REGION_FOCUSES.TRIGGER;\n const handleRef = useCallback(\n (node: HTMLButtonElement | null) => {\n handleTriggerRef(node);\n if (node && isFocusTarget) node.focus();\n },\n [handleTriggerRef, isFocusTarget],\n );\n\n const currentDetail = hasDetails ? pageDetails[pageIndex - 1] : '';\n const accessibleName = `Page ${pageIndex} out of ${pageCount}${currentDetail ? `, ${currentDetail}` : ''}`;\n\n return (\n // legacy data-testid (the wrapper of the DSDropdownMenuV2 trigger) \u2014 preserved for QA/consumer compatibility, breaking change if removed\n <StyledTriggerWrapper data-testid={PAGINATOR_DATA_TESTID.TRIGGER_WRAPPER} {...ownerPropsConfig}>\n <StyledTrigger\n buttonType=\"raw\"\n disabled={isLoadingPageCount}\n innerRef={handleRef}\n // the trigger owns a non-modal dialog (that hosts the list of pages): it is not a toggle button, so no aria-pressed\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? dialogId : undefined}\n aria-label={accessibleName}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={PAGINATOR_DATA_TESTID.PAGINATOR}\n {...globalAttributes}\n {...xstyledProps}\n {...ownerPropsConfig}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n onBlur={handleBlurOutOfWidget}\n >\n <Grid gutter=\"xxxs\" alignItems=\"center\" style={{ gridAutoFlow: 'column' }}>\n <StyledPageInfo innerRef={pageInfoRef} {...ownerPropsConfig}>\n <DSTypography id=\"typography-page-index\" variant=\"b1\" as=\"span\" fontWeight=\"semibold\" textAlign=\"start\">\n {pageIndex}\n </DSTypography>\n <DSTypography className=\"typography-page-info-and-detail\" variant=\"b1\" as=\"span\">\n / {pageCount}\n </DSTypography>\n </StyledPageInfo>\n {isLoadingPageCount && <DSCircularIndeterminateIndicator ml=\"xxxs\" mr=\"xxxs\" size=\"xs\" />}\n {hasDetails && (\n <>\n <DSPaginationSeparator height=\"12px\" ml=\"12px\" mr=\"xxxs\" {...ownerPropsConfig} />\n <DSTypography\n className=\"typography-page-info-and-detail typography-paginator-detail\"\n // the detail wraps when it reaches the list width; the trigger follows the detail of the current page\n style={{ maxWidth: detailMaxWidth }}\n mr=\"xxs\"\n variant=\"b1\"\n as=\"span\"\n fontWeight=\"semibold\"\n textAlign=\"start\"\n >\n {currentDetail}\n </DSTypography>\n </>\n )}\n <ChevronDown ml=\"xxxs\" color={['brand-primary', '700']} innerRef={chevronRef} />\n </Grid>\n </StyledTrigger>\n </StyledTriggerWrapper>\n );\n};\n\nTrigger.displayName = 'DSPaginator.Trigger';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiEX,SASA,UATA,KAGA,YAHA;AAjEZ,SAAS,wCAAwC;AACjD,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAgB,aAAa,kBAAkB;AAC/C,SAAS,6BAA6B;AACtC,SAAS,uBAAuB,gCAAgC;AAChE,SAAS,0BAA0B;AACnC,SAAS,gBAAgB,eAAe,4BAA4B;AAE7D,MAAM,UAAU,MAAM;AAC3B,QAAM;AAAA,IACJ,kBAAkB,EAAE,WAAW,WAAW,oBAAoB,YAAY;AAAA,IAC1E;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,EAAE,YAAY;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,kBAAkB;AAGjC,QAAM,gBAAgB,gBAAgB,yBAAyB;AAC/D,QAAM,YAAY;AAAA,IAChB,CAAC,SAAmC;AAClC,uBAAiB,IAAI;AACrB,UAAI,QAAQ,cAAe,MAAK,MAAM;AAAA,IACxC;AAAA,IACA,CAAC,kBAAkB,aAAa;AAAA,EAClC;AAEA,QAAM,gBAAgB,aAAa,YAAY,YAAY,CAAC,IAAI;AAChE,QAAM,iBAAiB,QAAQ,SAAS,WAAW,SAAS,GAAG,gBAAgB,KAAK,aAAa,KAAK,EAAE;AAExG;AAAA;AAAA,IAEE,oBAAC,wBAAqB,eAAa,sBAAsB,iBAAkB,GAAG,kBAC5E;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,UAAU;AAAA,QACV,UAAU;AAAA,QAEV,iBAAc;AAAA,QACd,iBAAe;AAAA,QACf,iBAAe,SAAS,WAAW;AAAA,QACnC,cAAY;AAAA,QAEZ,eAAa,sBAAsB;AAAA,QAClC,GAAG;AAAA,QACH,GAAG;AAAA,QACH,GAAG;AAAA,QACJ,SAAS;AAAA,QACT,WAAW;AAAA,QACX,QAAQ;AAAA,QAER,+BAAC,QAAK,QAAO,QAAO,YAAW,UAAS,OAAO,EAAE,cAAc,SAAS,GACtE;AAAA,+BAAC,kBAAe,UAAU,aAAc,GAAG,kBACzC;AAAA,gCAAC,gBAAa,IAAG,yBAAwB,SAAQ,MAAK,IAAG,QAAO,YAAW,YAAW,WAAU,SAC7F,qBACH;AAAA,YACA,qBAAC,gBAAa,WAAU,mCAAkC,SAAQ,MAAK,IAAG,QAAO;AAAA;AAAA,cAC5E;AAAA,eACL;AAAA,aACF;AAAA,UACC,sBAAsB,oBAAC,oCAAiC,IAAG,QAAO,IAAG,QAAO,MAAK,MAAK;AAAA,UACtF,cACC,iCACE;AAAA,gCAAC,yBAAsB,QAAO,QAAO,IAAG,QAAO,IAAG,QAAQ,GAAG,kBAAkB;AAAA,YAC/E;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBAEV,OAAO,EAAE,UAAU,eAAe;AAAA,gBAClC,IAAG;AAAA,gBACH,SAAQ;AAAA,gBACR,IAAG;AAAA,gBACH,YAAW;AAAA,gBACX,WAAU;AAAA,gBAET;AAAA;AAAA,YACH;AAAA,aACF;AAAA,UAEF,oBAAC,eAAY,IAAG,QAAO,OAAO,CAAC,iBAAiB,KAAK,GAAG,UAAU,YAAY;AAAA,WAChF;AAAA;AAAA,IACF,GACF;AAAA;AAEJ;AAEA,QAAQ,cAAc;",
6
+ "names": []
7
+ }
@@ -20,9 +20,14 @@ const DSPaginatorPropTypes = {
20
20
  ...xstyledPropTypes,
21
21
  pageIndex: PropTypes.number.description("Index of the current page, starting from 1").defaultValue(1),
22
22
  pageCount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("How many pages are there"),
23
- onPageChange: PropTypes.func.description("Function invoked when the page changes").defaultValue(() => null),
23
+ onPageChange: PropTypes.func.description(
24
+ "Function invoked when the user commits a different page (Enter, Space, click, or Tab out of the list). Moving through the options with the arrow keys does NOT invoke it"
25
+ ).defaultValue(() => null),
24
26
  isLoadingPageCount: PropTypes.bool.description("Whether the page count is loading or not").defaultValue(false),
25
27
  pageDetails: PropTypes.arrayOf(PropTypes.string).description("Details to provide for each page").defaultValue([]),
28
+ listWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(
29
+ "Width of the open list (a number is px, a string is any CSS length). Details wrap inside it; it is never wider than the viewport. Default: 280px with pageDetails; without them the list is as wide as its page numbers need"
30
+ ),
26
31
  pageDetailsTitle: PropTypes.string.description("The title of the details (usually a column of your dataset)").defaultValue("")
27
32
  };
28
33
  const DSPaginatorPropTypesSchema = DSPaginatorPropTypes;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSPaginationName, PAGINATOR_SLOTS } from './constants/index.js';\n\nexport declare namespace DSPaginatorT {\n export type SlotFunctionArguments = {\n dsPaginationPaginator: () => object;\n };\n export interface RequiredProps {}\n\n export interface DefaultProps {\n pageCount: number | string;\n isLoadingPageCount: boolean;\n pageIndex: number;\n onPageChange: (page: number) => void;\n pageDetails: string[] | readonly string[];\n pageDetailsTitle: string;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSPaginationName,\n typeof PAGINATOR_SLOTS\n > {}\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPaginatorT.DefaultProps = {\n pageCount: 0,\n isLoadingPageCount: false,\n pageIndex: 1,\n onPageChange: () => null,\n pageDetails: [],\n pageDetailsTitle: '',\n};\n\nexport const DSPaginatorPropTypes: DSPropTypesSchema<DSPaginatorT.Props> = {\n ...getPropsPerSlotPropTypes(DSPaginationName, PAGINATOR_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n pageCount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('How many pages are there'),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n isLoadingPageCount: PropTypes.bool.description('Whether the page count is loading or not').defaultValue(false),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n};\n\nexport const DSPaginatorPropTypesSchema = DSPaginatorPropTypes as unknown as ValidationMap<DSPaginatorT.Props>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kBAAkB,uBAAuB;AAsC3C,MAAM,eAA0C;AAAA,EACrD,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EACpB,aAAa,CAAC;AAAA,EACd,kBAAkB;AACpB;AAEO,MAAM,uBAA8D;AAAA,EACzE,GAAG,yBAAyB,kBAAkB,eAAe;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,WAAW,UAAU,OAAO,YAAY,4CAA4C,EAAE,aAAa,CAAC;AAAA,EACpG,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,0BAA0B;AAAA,EAC3G,cAAc,UAAU,KAAK,YAAY,wCAAwC,EAAE,aAAa,MAAM,IAAI;AAAA,EAC1G,oBAAoB,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EAC7G,aAAa,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,kCAAkC,EAAE,aAAa,CAAC,CAAC;AAAA,EAChH,kBAAkB,UAAU,OACzB,YAAY,6DAA6D,EACzE,aAAa,EAAE;AACpB;AAEO,MAAM,6BAA6B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSPaginationName, PAGINATOR_SLOTS } from './constants/index.js';\n\nexport declare namespace DSPaginatorT {\n export type SlotFunctionArguments = {\n dsPaginationPaginator: () => object;\n dsPaginationPaginatorTriggerWrapper: () => object;\n dsPaginationPaginatorPageInfo: () => object;\n dsPaginationPaginatorFloatingWrapper: () => object;\n dsPaginationPaginatorPanel: () => object;\n dsPaginationPaginatorHeader: () => object;\n dsPaginationPaginatorListWrapper: () => object;\n dsPaginationPaginatorList: () => object;\n dsPaginationPaginatorOption: () => object;\n dsPaginationPaginatorOptionCheckmark: () => object;\n dsPaginationPaginatorOptionPage: () => object;\n dsPaginationPaginatorOptionDetail: () => object;\n };\n export interface RequiredProps {}\n\n export interface DefaultProps {\n pageCount: number | string;\n isLoadingPageCount: boolean;\n pageIndex: number;\n onPageChange: (page: number) => void;\n pageDetails: string[] | readonly string[];\n pageDetailsTitle: string;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSPaginationName,\n typeof PAGINATOR_SLOTS\n > {\n /**\n * Width of the open list (a number is px, a string is any CSS length) when the paginator has `pageDetails`: the details\n * wrap inside it. The list is never wider than the viewport. Default: 280px. Without `pageDetails` the list is as wide\n * as its page numbers need, unless this is passed.\n */\n listWidth?: number | string;\n }\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPaginatorT.DefaultProps = {\n pageCount: 0,\n isLoadingPageCount: false,\n pageIndex: 1,\n onPageChange: () => null,\n pageDetails: [],\n pageDetailsTitle: '',\n};\n\nexport const DSPaginatorPropTypes: DSPropTypesSchema<DSPaginatorT.Props> = {\n ...getPropsPerSlotPropTypes(DSPaginationName, PAGINATOR_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n pageCount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('How many pages are there'),\n onPageChange: PropTypes.func\n .description(\n 'Function invoked when the user commits a different page (Enter, Space, click, or Tab out of the list). Moving through the options with the arrow keys does NOT invoke it',\n )\n .defaultValue(() => null),\n isLoadingPageCount: PropTypes.bool.description('Whether the page count is loading or not').defaultValue(false),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n listWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'Width of the open list (a number is px, a string is any CSS length). Details wrap inside it; it is never wider than the viewport. Default: 280px with pageDetails; without them the list is as wide as its page numbers need',\n ),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n};\n\nexport const DSPaginatorPropTypesSchema = DSPaginatorPropTypes as unknown as ValidationMap<DSPaginatorT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kBAAkB,uBAAuB;AAwD3C,MAAM,eAA0C;AAAA,EACrD,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EACpB,aAAa,CAAC;AAAA,EACd,kBAAkB;AACpB;AAEO,MAAM,uBAA8D;AAAA,EACzE,GAAG,yBAAyB,kBAAkB,eAAe;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,WAAW,UAAU,OAAO,YAAY,4CAA4C,EAAE,aAAa,CAAC;AAAA,EACpG,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,0BAA0B;AAAA,EAC3G,cAAc,UAAU,KACrB;AAAA,IACC;AAAA,EACF,EACC,aAAa,MAAM,IAAI;AAAA,EAC1B,oBAAoB,UAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAAA,EAC7G,aAAa,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,kCAAkC,EAAE,aAAa,CAAC,CAAC;AAAA,EAChH,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IACnE;AAAA,EACF;AAAA,EACA,kBAAkB,UAAU,OACzB,YAAY,6DAA6D,EACzE,aAAa,EAAE;AACpB;AAEO,MAAM,6BAA6B;",
6
6
  "names": []
7
7
  }