@elliemae/ds-pagination 3.57.0-next.33 → 3.57.0-next.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Pagination.js → DSPagination.js} +8 -8
- package/dist/cjs/DSPagination.js.map +7 -0
- package/dist/cjs/config/usePagination.js +51 -0
- package/dist/cjs/config/usePagination.js.map +7 -0
- package/dist/cjs/{PaginationDataTestID.js → config/useValidateProps.js} +9 -13
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/{DSPaginationDefinitions.js → constants/index.js} +22 -19
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +29 -18
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/parts/{DSPageNextButton.js → DSPageNextButton/DSPageNextButton.js} +46 -18
- package/dist/cjs/parts/DSPageNextButton/DSPageNextButton.js.map +7 -0
- package/dist/cjs/parts/DSPageNextButton/config/usePageNextButton.js +55 -0
- package/dist/cjs/parts/DSPageNextButton/config/usePageNextButton.js.map +7 -0
- package/dist/cjs/parts/DSPageNextButton/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSPageNextButton/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSPageNextButton/constants/index.js +48 -0
- package/dist/cjs/parts/DSPageNextButton/constants/index.js.map +7 -0
- package/dist/cjs/parts/DSPageNextButton/index.js +41 -0
- package/dist/cjs/parts/DSPageNextButton/index.js.map +7 -0
- package/dist/cjs/parts/DSPageNextButton/react-desc-prop-types.js +51 -0
- package/dist/cjs/parts/DSPageNextButton/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSPageNextButton/typescript-testing/slot-props.js +32 -0
- package/dist/cjs/parts/DSPageNextButton/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/{typescript-testing/typescript-page-next-button-valid.js → parts/DSPageNextButton/typescript-testing/typescript-testing.js} +1 -1
- package/dist/cjs/parts/DSPageNextButton/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/cjs/parts/{DSPagePrevButton.js → DSPagePrevButton/DSPagePrevButton.js} +46 -18
- package/dist/cjs/parts/DSPagePrevButton/DSPagePrevButton.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton/config/usePagePrevButton.js +55 -0
- package/dist/cjs/parts/DSPagePrevButton/config/usePagePrevButton.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSPagePrevButton/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton/constants/index.js +48 -0
- package/dist/cjs/parts/DSPagePrevButton/constants/index.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton/index.js +41 -0
- package/dist/cjs/parts/DSPagePrevButton/index.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton/react-desc-prop-types.js +51 -0
- package/dist/cjs/parts/DSPagePrevButton/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton/typescript-testing/slot-props.js +32 -0
- package/dist/cjs/parts/DSPagePrevButton/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/{typescript-testing/typescript-page-prev-button-valid.js → parts/DSPagePrevButton/typescript-testing/typescript-testing.js} +1 -1
- package/dist/cjs/parts/DSPagePrevButton/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/cjs/parts/{DSPaginationContainer.js → DSPaginationContainer/DSPaginationContainer.js} +26 -12
- package/dist/cjs/parts/DSPaginationContainer/DSPaginationContainer.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer/config/usePaginationContainer.js +60 -0
- package/dist/cjs/parts/DSPaginationContainer/config/usePaginationContainer.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSPaginationContainer/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer/constants/index.js +50 -0
- package/dist/cjs/parts/DSPaginationContainer/constants/index.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer/index.js +41 -0
- package/dist/cjs/parts/DSPaginationContainer/index.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer/react-desc-prop-types.js +48 -0
- package/dist/cjs/parts/DSPaginationContainer/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer/typescript-testing/slot-props.js +34 -0
- package/dist/cjs/parts/DSPaginationContainer/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/parts/DSPaginationSeparator/DSPaginationSeparator.js +68 -0
- package/dist/cjs/parts/DSPaginationSeparator/DSPaginationSeparator.js.map +7 -0
- package/dist/cjs/parts/DSPaginationSeparator/config/usePaginationSeparator.js +60 -0
- package/dist/cjs/parts/DSPaginationSeparator/config/usePaginationSeparator.js.map +7 -0
- package/dist/cjs/parts/DSPaginationSeparator/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSPaginationSeparator/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSPaginationSeparator/constants/index.js +45 -0
- package/dist/cjs/parts/DSPaginationSeparator/constants/index.js.map +7 -0
- package/dist/cjs/parts/DSPaginationSeparator/index.js +41 -0
- package/dist/cjs/parts/DSPaginationSeparator/index.js.map +7 -0
- package/dist/cjs/parts/DSPaginationSeparator/react-desc-prop-types.js +46 -0
- package/dist/cjs/parts/DSPaginationSeparator/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/DSPaginator.js +143 -0
- package/dist/cjs/parts/DSPaginator/DSPaginator.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/{createPaginatorHeader.js → config/createPaginatorHeader.js} +7 -3
- package/dist/cjs/parts/DSPaginator/config/createPaginatorHeader.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/{getOptions.js.map → config/getOptions.js.map} +1 -1
- package/dist/cjs/parts/DSPaginator/{useOnElementOnResize.js.map → config/useOnElementOnResize.js.map} +1 -1
- package/dist/cjs/parts/DSPaginator/{usePaginationSearch.js.map → config/usePaginationSearch.js.map} +1 -1
- package/dist/cjs/parts/DSPaginator/{usePaginator.js → config/usePaginator.js} +46 -21
- package/dist/cjs/parts/DSPaginator/config/usePaginator.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSPaginator/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/constants/index.js +45 -0
- package/dist/cjs/parts/DSPaginator/constants/index.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/index.js +7 -112
- package/dist/cjs/parts/DSPaginator/index.js.map +3 -3
- package/dist/cjs/parts/DSPaginator/react-desc-prop-types.js +59 -0
- package/dist/cjs/parts/DSPaginator/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/{styled.js → parts/DSPaginator/styled.js} +9 -41
- package/dist/cjs/parts/DSPaginator/styled.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/typescript-testing/slot-props.js +32 -0
- package/dist/cjs/parts/DSPaginator/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/{typescript-testing/typescript-paginator-valid.js → parts/DSPaginator/typescript-testing/typescript-testing.js} +1 -1
- package/dist/cjs/parts/DSPaginator/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelector.js +109 -0
- package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelector.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/{getOptions.js.map → config/getOptions.js.map} +1 -1
- package/dist/cjs/parts/DSPerPageSelector/{usePerPageSelector.js → config/usePerPageSelector.js} +29 -19
- package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelector.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/config/useValidateProps.js +40 -0
- package/dist/cjs/parts/DSPerPageSelector/config/useValidateProps.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/constants/index.js +50 -0
- package/dist/cjs/parts/DSPerPageSelector/constants/index.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/index.js +7 -70
- package/dist/cjs/parts/DSPerPageSelector/index.js.map +3 -3
- package/dist/cjs/parts/DSPerPageSelector/react-desc-prop-types.js +58 -0
- package/dist/cjs/parts/DSPerPageSelector/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/styled.js +90 -0
- package/dist/cjs/parts/DSPerPageSelector/styled.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/typescript-testing/slots-props.js +32 -0
- package/dist/cjs/parts/DSPerPageSelector/typescript-testing/slots-props.js.map +7 -0
- package/dist/cjs/{typescript-testing/typescript-per-page-selector-valid.js → parts/DSPerPageSelector/typescript-testing/typescript-testing.js} +1 -1
- package/dist/cjs/parts/DSPerPageSelector/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/cjs/parts/PaginationContent.js +7 -9
- package/dist/cjs/parts/PaginationContent.js.map +2 -2
- package/dist/cjs/parts/index.js +25 -4
- package/dist/cjs/parts/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +1 -86
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/{Pagination.js → DSPagination.js} +6 -6
- package/dist/esm/DSPagination.js.map +7 -0
- package/dist/esm/config/usePagination.js +21 -0
- package/dist/esm/config/usePagination.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +27 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +45 -13
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/parts/DSPageNextButton/DSPageNextButton.js +74 -0
- package/dist/esm/parts/DSPageNextButton/DSPageNextButton.js.map +7 -0
- package/dist/esm/parts/DSPageNextButton/config/usePageNextButton.js +30 -0
- package/dist/esm/parts/DSPageNextButton/config/usePageNextButton.js.map +7 -0
- package/dist/esm/parts/DSPageNextButton/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSPageNextButton/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSPageNextButton/constants/index.js +18 -0
- package/dist/esm/parts/DSPageNextButton/constants/index.js.map +7 -0
- package/dist/esm/parts/DSPageNextButton/index.js +11 -0
- package/dist/esm/parts/DSPageNextButton/index.js.map +7 -0
- package/dist/esm/parts/DSPageNextButton/react-desc-prop-types.js +26 -0
- package/dist/esm/parts/DSPageNextButton/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSPageNextButton/typescript-testing/slot-props.js +9 -0
- package/dist/esm/parts/DSPageNextButton/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/{typescript-testing/typescript-page-next-button-valid.js → parts/DSPageNextButton/typescript-testing/typescript-testing.js} +1 -1
- package/dist/esm/parts/DSPageNextButton/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/DSPagePrevButton.js +74 -0
- package/dist/esm/parts/DSPagePrevButton/DSPagePrevButton.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/config/usePagePrevButton.js +30 -0
- package/dist/esm/parts/DSPagePrevButton/config/usePagePrevButton.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSPagePrevButton/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/constants/index.js +18 -0
- package/dist/esm/parts/DSPagePrevButton/constants/index.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/index.js +11 -0
- package/dist/esm/parts/DSPagePrevButton/index.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/react-desc-prop-types.js +26 -0
- package/dist/esm/parts/DSPagePrevButton/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton/typescript-testing/slot-props.js +9 -0
- package/dist/esm/parts/DSPagePrevButton/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/{typescript-testing/typescript-page-prev-button-valid.js → parts/DSPagePrevButton/typescript-testing/typescript-testing.js} +1 -1
- package/dist/esm/parts/DSPagePrevButton/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/DSPaginationContainer.js +50 -0
- package/dist/esm/parts/DSPaginationContainer/DSPaginationContainer.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/config/usePaginationContainer.js +38 -0
- package/dist/esm/parts/DSPaginationContainer/config/usePaginationContainer.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSPaginationContainer/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/constants/index.js +20 -0
- package/dist/esm/parts/DSPaginationContainer/constants/index.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/index.js +15 -0
- package/dist/esm/parts/DSPaginationContainer/index.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/react-desc-prop-types.js +18 -0
- package/dist/esm/parts/DSPaginationContainer/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer/typescript-testing/slot-props.js +11 -0
- package/dist/esm/parts/DSPaginationContainer/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/parts/DSPaginationSeparator/DSPaginationSeparator.js +43 -0
- package/dist/esm/parts/DSPaginationSeparator/DSPaginationSeparator.js.map +7 -0
- package/dist/esm/parts/DSPaginationSeparator/config/usePaginationSeparator.js +38 -0
- package/dist/esm/parts/DSPaginationSeparator/config/usePaginationSeparator.js.map +7 -0
- package/dist/esm/parts/DSPaginationSeparator/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSPaginationSeparator/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSPaginationSeparator/constants/index.js +15 -0
- package/dist/esm/parts/DSPaginationSeparator/constants/index.js.map +7 -0
- package/dist/esm/parts/DSPaginationSeparator/index.js +15 -0
- package/dist/esm/parts/DSPaginationSeparator/index.js.map +7 -0
- package/dist/esm/parts/DSPaginationSeparator/react-desc-prop-types.js +16 -0
- package/dist/esm/parts/DSPaginationSeparator/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSPaginator/DSPaginator.js +113 -0
- package/dist/esm/parts/DSPaginator/DSPaginator.js.map +7 -0
- package/dist/esm/parts/DSPaginator/{createPaginatorHeader.js → config/createPaginatorHeader.js} +7 -3
- package/dist/esm/parts/DSPaginator/config/createPaginatorHeader.js.map +7 -0
- package/dist/esm/parts/DSPaginator/{getOptions.js.map → config/getOptions.js.map} +1 -1
- package/dist/esm/parts/DSPaginator/{useOnElementOnResize.js.map → config/useOnElementOnResize.js.map} +1 -1
- package/dist/esm/parts/DSPaginator/{usePaginationSearch.js.map → config/usePaginationSearch.js.map} +1 -1
- package/dist/esm/parts/DSPaginator/{usePaginator.js → config/usePaginator.js} +52 -22
- package/dist/esm/parts/DSPaginator/config/usePaginator.js.map +7 -0
- package/dist/esm/parts/DSPaginator/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSPaginator/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSPaginator/constants/index.js +15 -0
- package/dist/esm/parts/DSPaginator/constants/index.js.map +7 -0
- package/dist/esm/parts/DSPaginator/index.js +6 -111
- package/dist/esm/parts/DSPaginator/index.js.map +3 -3
- package/dist/esm/parts/DSPaginator/react-desc-prop-types.js +34 -0
- package/dist/esm/parts/DSPaginator/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSPaginator/styled.js +60 -0
- package/dist/esm/parts/DSPaginator/styled.js.map +7 -0
- package/dist/esm/parts/DSPaginator/typescript-testing/slot-props.js +9 -0
- package/dist/esm/parts/DSPaginator/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/{typescript-testing/typescript-paginator-valid.js → parts/DSPaginator/typescript-testing/typescript-testing.js} +1 -1
- package/dist/esm/parts/DSPaginator/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/DSPerPageSelector.js +79 -0
- package/dist/esm/parts/DSPerPageSelector/DSPerPageSelector.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/{getOptions.js.map → config/getOptions.js.map} +1 -1
- package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelector.js +55 -0
- package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelector.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/config/useValidateProps.js +10 -0
- package/dist/esm/parts/DSPerPageSelector/config/useValidateProps.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/constants/index.js +20 -0
- package/dist/esm/parts/DSPerPageSelector/constants/index.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/index.js +6 -69
- package/dist/esm/parts/DSPerPageSelector/index.js.map +3 -3
- package/dist/esm/parts/DSPerPageSelector/react-desc-prop-types.js +33 -0
- package/dist/esm/parts/DSPerPageSelector/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/styled.js +60 -0
- package/dist/esm/parts/DSPerPageSelector/styled.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/typescript-testing/slots-props.js +9 -0
- package/dist/esm/parts/DSPerPageSelector/typescript-testing/slots-props.js.map +7 -0
- package/dist/esm/{typescript-testing/typescript-per-page-selector-valid.js → parts/DSPerPageSelector/typescript-testing/typescript-testing.js} +1 -1
- package/dist/esm/parts/DSPerPageSelector/typescript-testing/typescript-testing.js.map +7 -0
- package/dist/esm/parts/PaginationContent.js +7 -9
- package/dist/esm/parts/PaginationContent.js.map +2 -2
- package/dist/esm/parts/index.js +63 -6
- package/dist/esm/parts/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +1 -86
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/config/usePagination.d.ts +5 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +29 -0
- package/dist/types/index.d.ts +3 -7
- package/dist/types/parts/DSPageNextButton/DSPageNextButton.d.ts +5 -0
- package/dist/types/parts/DSPageNextButton/config/usePageNextButton.d.ts +377 -0
- package/dist/types/parts/DSPageNextButton/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSPageNextButton/constants/index.d.ts +9 -0
- package/dist/types/parts/DSPageNextButton/index.d.ts +3 -0
- package/dist/types/parts/DSPageNextButton/react-desc-prop-types.d.ts +23 -0
- package/dist/types/parts/DSPageNextButton/tests/DSPageNextButton.get-owner-props.test.d.ts +1 -0
- package/dist/types/parts/DSPageNextButton/tests/DSPageNextButton.keyboard.test.d.ts +1 -0
- package/dist/types/parts/DSPageNextButton/tests/utils/NextButtonTestRender.d.ts +2 -0
- package/dist/types/parts/DSPageNextButton/typescript-testing/slot-props.d.ts +1 -0
- package/dist/types/parts/DSPageNextButton/typescript-testing/typescript-testing.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/DSPagePrevButton.d.ts +5 -0
- package/dist/types/parts/DSPagePrevButton/config/usePagePrevButton.d.ts +377 -0
- package/dist/types/parts/DSPagePrevButton/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSPagePrevButton/constants/index.d.ts +9 -0
- package/dist/types/parts/DSPagePrevButton/index.d.ts +3 -0
- package/dist/types/parts/DSPagePrevButton/react-desc-prop-types.d.ts +23 -0
- package/dist/types/parts/DSPagePrevButton/tests/DSPagePrevButton.a11y.test.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/tests/DSPagePrevButton.callbacks.test.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/tests/DSPagePrevButton.data-testid.test.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/tests/DSPagePrevButton.export.test.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/tests/DSPagePrevButton.get-owner-props.test.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/tests/DSPagePrevButton.keyboard.test.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/tests/utils/PrevButtonTestRender.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/typescript-testing/slot-props.d.ts +1 -0
- package/dist/types/parts/DSPagePrevButton/typescript-testing/typescript-testing.d.ts +1 -0
- package/dist/types/parts/DSPaginationContainer/DSPaginationContainer.d.ts +5 -0
- package/dist/types/parts/DSPaginationContainer/config/usePaginationContainer.d.ts +377 -0
- package/dist/types/parts/DSPaginationContainer/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSPaginationContainer/constants/index.d.ts +11 -0
- package/dist/types/parts/DSPaginationContainer/index.d.ts +3 -0
- package/dist/types/parts/DSPaginationContainer/react-desc-prop-types.d.ts +22 -0
- package/dist/types/parts/DSPaginationContainer/tests/DSPaginationContainer.data-testid.test.d.ts +1 -0
- package/dist/types/parts/DSPaginationContainer/tests/DSPaginationContainer.exports.test.d.ts +1 -0
- package/dist/types/parts/DSPaginationContainer/tests/DSPaginationContainer.get-owner-props.test.d.ts +1 -0
- package/dist/types/parts/DSPaginationContainer/tests/utils/PaginationContainerRender.d.ts +1 -0
- package/dist/types/parts/DSPaginationContainer/typescript-testing/slot-props.d.ts +1 -0
- package/dist/types/parts/DSPaginationSeparator/DSPaginationSeparator.d.ts +7 -0
- package/dist/types/parts/DSPaginationSeparator/config/usePaginationSeparator.d.ts +377 -0
- package/dist/types/parts/DSPaginationSeparator/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSPaginationSeparator/constants/index.d.ts +9 -0
- package/dist/types/parts/DSPaginationSeparator/index.d.ts +3 -0
- package/dist/types/parts/DSPaginationSeparator/react-desc-prop-types.d.ts +18 -0
- package/dist/types/parts/DSPaginationSeparator/tests/DSPaginationSeparator.data-testid.test.d.ts +1 -0
- package/dist/types/parts/DSPaginationSeparator/tests/DSPaginationSeparator.exports.test.d.ts +1 -0
- package/dist/types/parts/DSPaginationSeparator/tests/DSPaginationSeparator.get-owner-props.test.d.ts +1 -0
- package/dist/types/parts/DSPaginationSeparator/tests/utils/DSPaginationSeparatorTestRender.d.ts +1 -0
- package/dist/types/parts/DSPaginator/DSPaginator.d.ts +5 -0
- package/dist/types/parts/DSPaginator/{createPaginatorHeader.d.ts → config/createPaginatorHeader.d.ts} +2 -1
- package/dist/types/parts/DSPaginator/config/usePaginator.d.ts +386 -0
- package/dist/types/parts/DSPaginator/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSPaginator/constants/index.d.ts +9 -0
- package/dist/types/parts/DSPaginator/index.d.ts +3 -4
- package/dist/types/parts/DSPaginator/react-desc-prop-types.d.ts +27 -0
- package/dist/types/parts/DSPaginator/styled.d.ts +2 -0
- package/dist/types/parts/DSPaginator/tests/DSPaginator.a11y.test.d.ts +1 -0
- package/dist/types/parts/DSPaginator/tests/DSPaginator.data-testid.test.d.ts +1 -0
- package/dist/types/parts/DSPaginator/tests/DSPaginator.exports.test.d.ts +1 -0
- package/dist/types/parts/DSPaginator/tests/DSPaginator.get-owner-props.test.d.ts +1 -0
- package/dist/types/parts/DSPaginator/tests/DSPaginator.keyboard.test.d.ts +1 -0
- package/dist/types/parts/DSPaginator/tests/utils/DSPaginatorTestRender.d.ts +1 -0
- package/dist/types/parts/DSPaginator/typescript-testing/slot-props.d.ts +1 -0
- package/dist/types/parts/DSPaginator/typescript-testing/typescript-testing.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/DSPerPageSelector.d.ts +5 -0
- package/dist/types/parts/DSPerPageSelector/config/usePerPageSelector.d.ts +383 -0
- package/dist/types/parts/DSPerPageSelector/config/useValidateProps.d.ts +3 -0
- package/dist/types/parts/DSPerPageSelector/constants/index.d.ts +13 -0
- package/dist/types/parts/DSPerPageSelector/index.d.ts +3 -4
- package/dist/types/parts/DSPerPageSelector/react-desc-prop-types.d.ts +28 -0
- package/dist/types/parts/DSPerPageSelector/styled.d.ts +2 -0
- package/dist/types/parts/DSPerPageSelector/tests/DSPerPageSelector.a11y.test.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/tests/DSPerPageSelector.data-testid.test.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/tests/DSPerPageSelector.exports.test.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/tests/DSPerPageSelector.get-owner-props.test.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/tests/DSPerPageSelector.keyboard.test.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/tests/utils/PerPageSelectorTestRender.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/typescript-testing/slots-props.d.ts +1 -0
- package/dist/types/parts/DSPerPageSelector/typescript-testing/typescript-testing.d.ts +1 -0
- package/dist/types/parts/index.d.ts +6 -5
- package/dist/types/react-desc-prop-types.d.ts +9 -540
- package/dist/types/tests/DSPagination.data-testid.test.d.ts +1 -0
- package/dist/types/tests/DSPagination.exports.test.d.ts +1 -0
- package/dist/types/tests/DSPagination.get-owner-props.test.d.ts +1 -0
- package/package.json +15 -12
- package/dist/cjs/DSPaginationDefinitions.js.map +0 -7
- package/dist/cjs/Pagination.js.map +0 -7
- package/dist/cjs/PaginationDataTestID.js.map +0 -7
- package/dist/cjs/parts/DSPageNextButton.js.map +0 -7
- package/dist/cjs/parts/DSPagePrevButton.js.map +0 -7
- package/dist/cjs/parts/DSPaginationContainer.js.map +0 -7
- package/dist/cjs/parts/DSPaginator/createPaginatorHeader.js.map +0 -7
- package/dist/cjs/parts/DSPaginator/usePaginator.js.map +0 -7
- package/dist/cjs/parts/DSPerPageSelector/usePerPageSelector.js.map +0 -7
- package/dist/cjs/props.js +0 -85
- package/dist/cjs/props.js.map +0 -7
- package/dist/cjs/styled.js.map +0 -7
- package/dist/cjs/typescript-testing/typescript-page-next-button-valid.js.map +0 -7
- package/dist/cjs/typescript-testing/typescript-page-prev-button-valid.js.map +0 -7
- package/dist/cjs/typescript-testing/typescript-paginator-valid.js.map +0 -7
- package/dist/cjs/typescript-testing/typescript-per-page-selector-valid.js.map +0 -7
- package/dist/esm/DSPaginationDefinitions.js +0 -24
- package/dist/esm/DSPaginationDefinitions.js.map +0 -7
- package/dist/esm/Pagination.js.map +0 -7
- package/dist/esm/PaginationDataTestID.js +0 -14
- package/dist/esm/PaginationDataTestID.js.map +0 -7
- package/dist/esm/parts/DSPageNextButton.js +0 -47
- package/dist/esm/parts/DSPageNextButton.js.map +0 -7
- package/dist/esm/parts/DSPagePrevButton.js +0 -47
- package/dist/esm/parts/DSPagePrevButton.js.map +0 -7
- package/dist/esm/parts/DSPaginationContainer.js +0 -31
- package/dist/esm/parts/DSPaginationContainer.js.map +0 -7
- package/dist/esm/parts/DSPaginator/createPaginatorHeader.js.map +0 -7
- package/dist/esm/parts/DSPaginator/usePaginator.js.map +0 -7
- package/dist/esm/parts/DSPerPageSelector/usePerPageSelector.js +0 -40
- package/dist/esm/parts/DSPerPageSelector/usePerPageSelector.js.map +0 -7
- package/dist/esm/props.js +0 -55
- package/dist/esm/props.js.map +0 -7
- package/dist/esm/styled.js +0 -92
- package/dist/esm/styled.js.map +0 -7
- package/dist/esm/typescript-testing/typescript-page-next-button-valid.js.map +0 -7
- package/dist/esm/typescript-testing/typescript-page-prev-button-valid.js.map +0 -7
- package/dist/esm/typescript-testing/typescript-paginator-valid.js.map +0 -7
- package/dist/esm/typescript-testing/typescript-per-page-selector-valid.js.map +0 -7
- package/dist/types/DSPaginationDefinitions.d.ts +0 -12
- package/dist/types/PaginationDataTestID.d.ts +0 -9
- package/dist/types/parts/DSPageNextButton.d.ts +0 -4
- package/dist/types/parts/DSPagePrevButton.d.ts +0 -4
- package/dist/types/parts/DSPaginationContainer.d.ts +0 -4
- package/dist/types/parts/DSPaginator/usePaginator.d.ts +0 -381
- package/dist/types/parts/DSPerPageSelector/usePerPageSelector.d.ts +0 -377
- package/dist/types/props.d.ts +0 -20
- package/dist/types/styled.d.ts +0 -7
- /package/dist/cjs/parts/DSPaginator/{getOptions.js → config/getOptions.js} +0 -0
- /package/dist/cjs/parts/DSPaginator/{useOnElementOnResize.js → config/useOnElementOnResize.js} +0 -0
- /package/dist/cjs/parts/DSPaginator/{usePaginationSearch.js → config/usePaginationSearch.js} +0 -0
- /package/dist/cjs/parts/DSPerPageSelector/{getOptions.js → config/getOptions.js} +0 -0
- /package/dist/esm/parts/DSPaginator/{getOptions.js → config/getOptions.js} +0 -0
- /package/dist/esm/parts/DSPaginator/{useOnElementOnResize.js → config/useOnElementOnResize.js} +0 -0
- /package/dist/esm/parts/DSPaginator/{usePaginationSearch.js → config/usePaginationSearch.js} +0 -0
- /package/dist/esm/parts/DSPerPageSelector/{getOptions.js → config/getOptions.js} +0 -0
- /package/dist/types/{Pagination.d.ts → DSPagination.d.ts} +0 -0
- /package/dist/types/{typescript-testing/typescript-page-next-button-valid.d.ts → parts/DSPageNextButton/tests/DSPageNextButton.a11y.test.d.ts} +0 -0
- /package/dist/types/{typescript-testing/typescript-page-prev-button-valid.d.ts → parts/DSPageNextButton/tests/DSPageNextButton.callbacks.test.d.ts} +0 -0
- /package/dist/types/{typescript-testing/typescript-paginator-valid.d.ts → parts/DSPageNextButton/tests/DSPageNextButton.data-testid.test.d.ts} +0 -0
- /package/dist/types/{typescript-testing/typescript-per-page-selector-valid.d.ts → parts/DSPageNextButton/tests/DSPageNextButton.export.test.d.ts} +0 -0
- /package/dist/types/parts/DSPaginator/{getOptions.d.ts → config/getOptions.d.ts} +0 -0
- /package/dist/types/parts/DSPaginator/{useOnElementOnResize.d.ts → config/useOnElementOnResize.d.ts} +0 -0
- /package/dist/types/parts/DSPaginator/{usePaginationSearch.d.ts → config/usePaginationSearch.d.ts} +0 -0
- /package/dist/types/parts/DSPerPageSelector/{getOptions.d.ts → config/getOptions.d.ts} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SlotPropsAsObj = {
|
|
3
|
+
dsPaginationRoot: { "aria-label": "just a typescript test" },
|
|
4
|
+
dsPaginationWrapper: { "aria-label": "just a typescript test" }
|
|
5
|
+
};
|
|
6
|
+
const SlotPropsAsFunctions = {
|
|
7
|
+
dsPaginationRoot: () => ({ "aria-label": "just a typescript test" }),
|
|
8
|
+
dsPaginationWrapper: () => ({ "aria-label": "just a typescript test" })
|
|
9
|
+
};
|
|
10
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
11
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginationContainer/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\n\nimport type { DSPaginationContainerT } from '../react-desc-prop-types.js';\nimport type { DSPaginationName, PaginationSlots } from '../../../constants/index.js';\n\nconst SlotPropsAsObj: Partial<DSPaginationContainerT.Props> = {\n dsPaginationRoot: { 'aria-label': 'just a typescript test' },\n dsPaginationWrapper: { 'aria-label': 'just a typescript test' },\n};\nconst SlotPropsAsFunctions: DSPaginationContainerT.SlotFunctionArguments = {\n dsPaginationRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n};\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSPaginationName, typeof PaginationSlots>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACOvB,MAAM,iBAAwD;AAAA,EAC5D,kBAAkB,EAAE,cAAc,yBAAyB;AAAA,EAC3D,qBAAqB,EAAE,cAAc,yBAAyB;AAChE;AACA,MAAM,uBAAqE;AAAA,EACzE,kBAAkB,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClE,qBAAqB,OAAO,EAAE,cAAc,yBAAyB;AACvE;AACA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { styled, xStyledCommonProps } from "@elliemae/ds-system";
|
|
5
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
6
|
+
import { DSPaginationSeparatorPropTypesSchema } from "./react-desc-prop-types.js";
|
|
7
|
+
import { usePaginationSeparator } from "./config/usePaginationSeparator.js";
|
|
8
|
+
import {
|
|
9
|
+
PAGINATION_SEPARATOR_SLOTS,
|
|
10
|
+
DSPaginationName,
|
|
11
|
+
DSPaginationSeparatorName,
|
|
12
|
+
PAGINATION_SEPARATOR_DATA_TESTID
|
|
13
|
+
} from "./constants/index.js";
|
|
14
|
+
const StyledDSPaginationSeparator = styled(Grid, {
|
|
15
|
+
name: DSPaginationName,
|
|
16
|
+
slot: PAGINATION_SEPARATOR_SLOTS.SEPARATOR
|
|
17
|
+
})`
|
|
18
|
+
background-color: ${(props) => props.theme.colors.neutral[300]};
|
|
19
|
+
width: 1px;
|
|
20
|
+
height: 30px;
|
|
21
|
+
${xStyledCommonProps}
|
|
22
|
+
`;
|
|
23
|
+
const DSPaginationSeparator = (props) => {
|
|
24
|
+
const { xstyledProps, globalAttributes, ownerPropsConfig } = usePaginationSeparator(props);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
StyledDSPaginationSeparator,
|
|
27
|
+
{
|
|
28
|
+
"data-testid": PAGINATION_SEPARATOR_DATA_TESTID.SEPARATOR,
|
|
29
|
+
...globalAttributes,
|
|
30
|
+
...xstyledProps,
|
|
31
|
+
...ownerPropsConfig
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
DSPaginationSeparator.displayName = DSPaginationSeparatorName;
|
|
36
|
+
const DSPaginationSeparatorWithSchema = describe(DSPaginationSeparator);
|
|
37
|
+
DSPaginationSeparatorWithSchema.propTypes = DSPaginationSeparatorPropTypesSchema;
|
|
38
|
+
export {
|
|
39
|
+
DSPaginationSeparator,
|
|
40
|
+
DSPaginationSeparatorWithSchema,
|
|
41
|
+
StyledDSPaginationSeparator
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=DSPaginationSeparator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginationSeparator/DSPaginationSeparator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, type XstyledProps } from '@elliemae/ds-props-helpers';\nimport { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSPaginationSeparatorT, DSPaginationSeparatorPropTypesSchema } from './react-desc-prop-types.js';\nimport { usePaginationSeparator } from './config/usePaginationSeparator.js';\nimport {\n PAGINATION_SEPARATOR_SLOTS,\n DSPaginationName,\n DSPaginationSeparatorName,\n PAGINATION_SEPARATOR_DATA_TESTID,\n} from './constants/index.js';\n\nexport const StyledDSPaginationSeparator = styled(Grid, {\n name: DSPaginationName,\n slot: PAGINATION_SEPARATOR_SLOTS.SEPARATOR,\n})<React.ComponentProps<typeof Grid> & XstyledProps>`\n background-color: ${(props) => props.theme.colors.neutral[300]};\n width: 1px;\n height: 30px;\n ${xStyledCommonProps}\n`;\n\nconst DSPaginationSeparator: React.ComponentType<DSPaginationSeparatorT.Props> = (props) => {\n const { xstyledProps, globalAttributes, ownerPropsConfig } = usePaginationSeparator(props);\n\n return (\n <StyledDSPaginationSeparator\n data-testid={PAGINATION_SEPARATOR_DATA_TESTID.SEPARATOR}\n {...globalAttributes}\n {...xstyledProps}\n {...ownerPropsConfig}\n />\n );\n};\n\nDSPaginationSeparator.displayName = DSPaginationSeparatorName;\nconst DSPaginationSeparatorWithSchema = describe(DSPaginationSeparator);\nDSPaginationSeparatorWithSchema.propTypes = DSPaginationSeparatorPropTypesSchema;\n\nexport { DSPaginationSeparator, DSPaginationSeparatorWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2BnB;AA1BJ,SAAS,gBAAmC;AAC5C,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,YAAY;AACrB,SAAsC,4CAA4C;AAClF,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,8BAA8B,OAAO,MAAM;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,2BAA2B;AACnC,CAAC;AAAA,sBACqB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,IAG5D,kBAAkB;AAAA;AAGtB,MAAM,wBAA2E,CAAC,UAAU;AAC1F,QAAM,EAAE,cAAc,kBAAkB,iBAAiB,IAAI,uBAAuB,KAAK;AAEzF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,iCAAiC;AAAA,MAC7C,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,sBAAsB,cAAc;AACpC,MAAM,kCAAkC,SAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import {
|
|
4
|
+
useGetGlobalAttributes,
|
|
5
|
+
useGetXstyledProps,
|
|
6
|
+
useMemoMergePropsWithDefault,
|
|
7
|
+
useOwnerProps
|
|
8
|
+
} from "@elliemae/ds-props-helpers";
|
|
9
|
+
import {
|
|
10
|
+
DSPaginationSeparatorPropTypesSchema,
|
|
11
|
+
defaultProps
|
|
12
|
+
} from "../react-desc-prop-types.js";
|
|
13
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
14
|
+
const usePaginationSeparator = (propsFromUser) => {
|
|
15
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
16
|
+
propsFromUser,
|
|
17
|
+
defaultProps
|
|
18
|
+
);
|
|
19
|
+
useValidateProps(propsWithDefault, DSPaginationSeparatorPropTypesSchema);
|
|
20
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
21
|
+
const globalAttributes = useGetGlobalAttributes(
|
|
22
|
+
propsWithDefault
|
|
23
|
+
);
|
|
24
|
+
const ownerPropsConfig = useOwnerProps(propsWithDefault);
|
|
25
|
+
return React2.useMemo(
|
|
26
|
+
() => ({
|
|
27
|
+
propsWithDefault,
|
|
28
|
+
xstyledProps,
|
|
29
|
+
globalAttributes,
|
|
30
|
+
ownerPropsConfig
|
|
31
|
+
}),
|
|
32
|
+
[propsWithDefault, xstyledProps, globalAttributes, ownerPropsConfig]
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
usePaginationSeparator
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=usePaginationSeparator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginationSeparator/config/usePaginationSeparator.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\n\nimport type { DSGridT } from '@elliemae/ds-grid';\nimport {\n type DSPaginationSeparatorT,\n DSPaginationSeparatorPropTypesSchema,\n defaultProps,\n} from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport const usePaginationSeparator = (propsFromUser: DSPaginationSeparatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationSeparatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSPaginationSeparatorPropTypesSchema);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // GLOBAL ATTRIBUTES\n // =============================================================================\n const globalAttributes = useGetGlobalAttributes<DSPaginationSeparatorT.InternalProps, HTMLDivElement, DSGridT.Props>(\n propsWithDefault,\n );\n // =============================================================================\n // OWNER PROPS\n // =============================================================================\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n // custom code goes here, this is an example\n // const instanceUid = React.useMemo(() => `ds-pagination-separator-${uid(5)}`, []);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n globalAttributes,\n ownerPropsConfig,\n }),\n [propsWithDefault, xstyledProps, globalAttributes, ownerPropsConfig],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AAE1B,MAAM,yBAAyB,CAAC,kBAAgD;AAIrF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,oCAAoC;AAIvE,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,mBAAmB;AAAA,IACvB;AAAA,EACF;AAIA,QAAM,mBAAmB,cAAc,gBAAgB;AAYvD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,cAAc,kBAAkB,gBAAgB;AAAA,EACrE;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSPaginationSeparatorName } from "../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSPaginationSeparatorName);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useValidateProps
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginationSeparator/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 DSPaginationSeparatorT } from '../react-desc-prop-types.js';\nimport { DSPaginationSeparatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSPaginationSeparatorT.InternalProps,\n propTypes: ValidationMap<DSPaginationSeparatorT.Props>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSPaginationSeparatorName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,iCAAiC;AAEnC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,yBAAyB;AAC5E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
import { DSPaginationName } from "../../../constants/index.js";
|
|
4
|
+
const DSPaginationSeparatorName = "DSPaginationSeparator";
|
|
5
|
+
const PAGINATION_SEPARATOR_SLOTS = {
|
|
6
|
+
SEPARATOR: "separator"
|
|
7
|
+
};
|
|
8
|
+
const PAGINATION_SEPARATOR_DATA_TESTID = slotObjectToDataTestIds(DSPaginationName, PAGINATION_SEPARATOR_SLOTS);
|
|
9
|
+
export {
|
|
10
|
+
DSPaginationName,
|
|
11
|
+
DSPaginationSeparatorName,
|
|
12
|
+
PAGINATION_SEPARATOR_DATA_TESTID,
|
|
13
|
+
PAGINATION_SEPARATOR_SLOTS
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginationSeparator/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 DSPaginationSeparatorName = 'DSPaginationSeparator';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const PAGINATION_SEPARATOR_SLOTS = {\n SEPARATOR: 'separator',\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 PAGINATION_SEPARATOR_DATA_TESTID = slotObjectToDataTestIds(DSPaginationName, PAGINATION_SEPARATOR_SLOTS);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAG1B,MAAM,4BAA4B;AAGlC,MAAM,6BAA6B;AAAA,EACxC,WAAW;AACb;AAGO,MAAM,mCAAmC,wBAAwB,kBAAkB,0BAA0B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSPaginationSeparator, DSPaginationSeparatorWithSchema } from "./DSPaginationSeparator.js";
|
|
3
|
+
import {
|
|
4
|
+
DSPaginationSeparatorName,
|
|
5
|
+
PAGINATION_SEPARATOR_DATA_TESTID,
|
|
6
|
+
PAGINATION_SEPARATOR_SLOTS
|
|
7
|
+
} from "./constants/index.js";
|
|
8
|
+
export {
|
|
9
|
+
DSPaginationSeparator,
|
|
10
|
+
DSPaginationSeparatorName,
|
|
11
|
+
DSPaginationSeparatorWithSchema,
|
|
12
|
+
PAGINATION_SEPARATOR_DATA_TESTID,
|
|
13
|
+
PAGINATION_SEPARATOR_SLOTS
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginationSeparator/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSPaginationSeparator, DSPaginationSeparatorWithSchema } from './DSPaginationSeparator.js';\nexport {\n DSPaginationSeparatorName,\n PAGINATION_SEPARATOR_DATA_TESTID,\n PAGINATION_SEPARATOR_SLOTS,\n} from './constants/index.js';\nexport type { DSPaginationSeparatorT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uBAAuB,uCAAuC;AACvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { getPropsPerSlotPropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSPaginationName, PAGINATION_SEPARATOR_SLOTS } from "./constants/index.js";
|
|
4
|
+
const defaultProps = {};
|
|
5
|
+
const DSPaginationSeparatorPropTypes = {
|
|
6
|
+
...getPropsPerSlotPropTypes(DSPaginationName, PAGINATION_SEPARATOR_SLOTS),
|
|
7
|
+
...globalAttributesPropTypes,
|
|
8
|
+
...xstyledPropTypes
|
|
9
|
+
};
|
|
10
|
+
const DSPaginationSeparatorPropTypesSchema = DSPaginationSeparatorPropTypes;
|
|
11
|
+
export {
|
|
12
|
+
DSPaginationSeparatorPropTypes,
|
|
13
|
+
DSPaginationSeparatorPropTypesSchema,
|
|
14
|
+
defaultProps
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginationSeparator/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { getPropsPerSlotPropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSPaginationName, PAGINATION_SEPARATOR_SLOTS } from './constants/index.js';\n\nexport declare namespace DSPaginationSeparatorT {\n export interface RequiredProps {}\n\n export interface DefaultProps {}\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSPaginationName, typeof PAGINATION_SEPARATOR_SLOTS> {}\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPaginationSeparatorT.DefaultProps = {};\n\nexport const DSPaginationSeparatorPropTypes: DSPropTypesSchema<DSPaginationSeparatorT.Props> = {\n ...getPropsPerSlotPropTypes(DSPaginationName, PAGINATION_SEPARATOR_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n};\n\nexport const DSPaginationSeparatorPropTypesSchema =\n DSPaginationSeparatorPropTypes as unknown as ValidationMap<DSPaginationSeparatorT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,0BAA0B,2BAA2B,wBAAwB;AAEtF,SAAS,kBAAkB,kCAAkC;AAwBtD,MAAM,eAAoD,CAAC;AAE3D,MAAM,iCAAkF;AAAA,EAC7F,GAAG,yBAAyB,kBAAkB,0BAA0B;AAAA,EACxE,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,uCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { DSCircularIndeterminateIndicator } from "@elliemae/ds-circular-progress-indicator";
|
|
5
|
+
import { DSDropdownMenuV2 } from "@elliemae/ds-dropdownmenu-v2";
|
|
6
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
7
|
+
import { ChevronDown } from "@elliemae/ds-icons";
|
|
8
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
9
|
+
import { DSTypography } from "@elliemae/ds-typography";
|
|
10
|
+
import { DSPaginationSeparator } from "../DSPaginationSeparator/index.js";
|
|
11
|
+
import { createPaginatorHeader } from "./config/createPaginatorHeader.js";
|
|
12
|
+
import { usePaginator } from "./config/usePaginator.js";
|
|
13
|
+
import { DSPaginatorName, PAGINATOR_DATA_TESTID } from "./constants/index.js";
|
|
14
|
+
import { DSPaginatorPropTypesSchema } from "./react-desc-prop-types.js";
|
|
15
|
+
import { PaginationDropdownButtonPaginator, InvisibleDiv } from "./styled.js";
|
|
16
|
+
const DSPaginator = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
propsWithDefault: { pageIndex, pageCount, isLoadingPageCount, onPageChange, pageDetails, pageDetailsTitle },
|
|
19
|
+
xstyledProps,
|
|
20
|
+
globalAttributes,
|
|
21
|
+
ownerPropsConfig,
|
|
22
|
+
btnRef,
|
|
23
|
+
btnWidth,
|
|
24
|
+
pageInfoWidth,
|
|
25
|
+
options,
|
|
26
|
+
isOpened,
|
|
27
|
+
setIsOpened,
|
|
28
|
+
detailWidth,
|
|
29
|
+
actionRef,
|
|
30
|
+
onKeyDown
|
|
31
|
+
} = usePaginator(props);
|
|
32
|
+
const Header = useMemo(
|
|
33
|
+
() => createPaginatorHeader({ pageDetailsTitle, pageInfoWidth, ownerPropsConfig }),
|
|
34
|
+
[pageDetailsTitle, pageInfoWidth, ownerPropsConfig]
|
|
35
|
+
);
|
|
36
|
+
const buttonOnClick = useMemo(() => {
|
|
37
|
+
if (globalAttributes.onClick) return globalAttributes.onClick;
|
|
38
|
+
return () => setIsOpened((prev) => !prev);
|
|
39
|
+
}, [globalAttributes.onClick, setIsOpened]);
|
|
40
|
+
return /* @__PURE__ */ jsxs(
|
|
41
|
+
DSDropdownMenuV2,
|
|
42
|
+
{
|
|
43
|
+
isOpened,
|
|
44
|
+
options,
|
|
45
|
+
selectedOptions: { [pageIndex.toString()]: true },
|
|
46
|
+
onOptionClick: (_, clickedOption) => {
|
|
47
|
+
onPageChange(clickedOption.value);
|
|
48
|
+
setIsOpened(false);
|
|
49
|
+
btnRef.current?.focus();
|
|
50
|
+
},
|
|
51
|
+
onClickOutside: () => {
|
|
52
|
+
setIsOpened(false);
|
|
53
|
+
btnRef.current?.focus();
|
|
54
|
+
},
|
|
55
|
+
customOffset: [-23, 2],
|
|
56
|
+
startPlacementPreference: "top-start",
|
|
57
|
+
actionRef,
|
|
58
|
+
onKeyDown,
|
|
59
|
+
minWidth: pageDetails.length !== 0 ? btnWidth + 23 : pageCount.toString().length * 6 + 90,
|
|
60
|
+
maxHeight: 300,
|
|
61
|
+
HeaderComp: Header,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
PaginationDropdownButtonPaginator,
|
|
65
|
+
{
|
|
66
|
+
buttonType: "raw",
|
|
67
|
+
disabled: isLoadingPageCount,
|
|
68
|
+
innerRef: btnRef,
|
|
69
|
+
"aria-pressed": isOpened,
|
|
70
|
+
"aria-label": `Page ${pageIndex} out of ${pageCount}, ${pageDetails.length !== 0 ? pageDetails[pageIndex - 1] : "\b\b"}. Press to change the current page`,
|
|
71
|
+
"data-testid": PAGINATOR_DATA_TESTID.PAGINATOR,
|
|
72
|
+
...globalAttributes,
|
|
73
|
+
...xstyledProps,
|
|
74
|
+
...ownerPropsConfig,
|
|
75
|
+
onClick: buttonOnClick,
|
|
76
|
+
children: /* @__PURE__ */ jsxs(Grid, { gutter: "xxxs", alignItems: "center", style: { gridAutoFlow: "column" }, children: [
|
|
77
|
+
/* @__PURE__ */ jsx(DSTypography, { fontSize: "18px", variant: "b1", as: "span", fontWeight: "semibold", textAlign: "start", children: pageIndex }),
|
|
78
|
+
"/ ",
|
|
79
|
+
pageCount,
|
|
80
|
+
isLoadingPageCount && /* @__PURE__ */ jsx(DSCircularIndeterminateIndicator, { ml: "xxxs", mr: "xxxs", size: "xs" }),
|
|
81
|
+
pageDetails.length !== 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
+
/* @__PURE__ */ jsx(DSPaginationSeparator, { height: "12px", ml: "12px", mr: "xxxs", ...ownerPropsConfig }),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
DSTypography,
|
|
85
|
+
{
|
|
86
|
+
fontSize: "13px",
|
|
87
|
+
w: detailWidth,
|
|
88
|
+
mr: "xxs",
|
|
89
|
+
variant: "b1",
|
|
90
|
+
as: "span",
|
|
91
|
+
fontWeight: "semibold",
|
|
92
|
+
textAlign: "start",
|
|
93
|
+
children: pageDetails[pageIndex - 1]
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ jsx(ChevronDown, { ml: "xxxs", color: ["brand-primary", "700"] })
|
|
98
|
+
] })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__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)) })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
DSPaginator.displayName = DSPaginatorName;
|
|
107
|
+
const DSPaginatorWithSchema = describe(DSPaginator);
|
|
108
|
+
DSPaginatorWithSchema.propTypes = DSPaginatorPropTypesSchema;
|
|
109
|
+
export {
|
|
110
|
+
DSPaginator,
|
|
111
|
+
DSPaginatorWithSchema
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=DSPaginator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/DSPaginator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport type { DSButtonT } from '@elliemae/ds-button-v2';\nimport { DSCircularIndeterminateIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport { DSDropdownMenuV2, type DSDropdownMenuT } from '@elliemae/ds-dropdownmenu-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ChevronDown } from '@elliemae/ds-icons';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSPaginationSeparator } from '../DSPaginationSeparator/index.js';\nimport { createPaginatorHeader } from './config/createPaginatorHeader.js';\nimport { usePaginator } from './config/usePaginator.js';\nimport { DSPaginatorName, PAGINATOR_DATA_TESTID } from './constants/index.js';\nimport { DSPaginatorPropTypesSchema, type DSPaginatorT } from './react-desc-prop-types.js';\nimport { PaginationDropdownButtonPaginator, InvisibleDiv } from './styled.js';\n\nconst DSPaginator: React.ComponentType<DSPaginatorT.Props> = (props) => {\n const {\n propsWithDefault: { pageIndex, pageCount, isLoadingPageCount, onPageChange, pageDetails, pageDetailsTitle },\n xstyledProps,\n globalAttributes,\n ownerPropsConfig,\n btnRef,\n btnWidth,\n pageInfoWidth,\n options,\n isOpened,\n setIsOpened,\n detailWidth,\n actionRef,\n onKeyDown,\n } = usePaginator(props);\n\n const Header = useMemo(\n () => createPaginatorHeader({ pageDetailsTitle, pageInfoWidth, ownerPropsConfig }),\n [pageDetailsTitle, pageInfoWidth, ownerPropsConfig],\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 <PaginationDropdownButtonPaginator\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={PAGINATOR_DATA_TESTID.PAGINATOR}\n {...globalAttributes}\n {...xstyledProps}\n {...ownerPropsConfig}\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\" {...ownerPropsConfig} />\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 </PaginationDropdownButtonPaginator>\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.displayName = DSPaginatorName;\nconst DSPaginatorWithSchema = describe(DSPaginator);\nDSPaginatorWithSchema.propTypes = DSPaginatorPropTypesSchema;\n\nexport { DSPaginator, DSPaginatorWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+Eb,SAME,UANF,KAME,YANF;AA/EV,SAAgB,eAAe;AAE/B,SAAS,wCAAwC;AACjD,SAAS,wBAA8C;AACvD,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB,6BAA6B;AACvD,SAAS,kCAAqD;AAC9D,SAAS,mCAAmC,oBAAoB;AAEhE,MAAM,cAAuD,CAAC,UAAU;AACtE,QAAM;AAAA,IACJ,kBAAkB,EAAE,WAAW,WAAW,oBAAoB,cAAc,aAAa,iBAAiB;AAAA,IAC1G;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,aAAa,KAAK;AAEtB,QAAM,SAAS;AAAA,IACb,MAAM,sBAAsB,EAAE,kBAAkB,eAAe,iBAAiB,CAAC;AAAA,IACjF,CAAC,kBAAkB,eAAe,gBAAgB;AAAA,EACpD;AAEA,QAAM,gBAA4C,QAAQ,MAAM;AAC9D,QAAI,iBAAiB,QAAS,QAAO,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,CAAC,GAAG,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,SAAS,WAAW,SAAS,KAC/C,YAAY,WAAW,IAAI,YAAY,YAAY,CAAC,IAAI,MAC1D;AAAA,YACA,eAAa,sBAAsB;AAAA,YAClC,GAAG;AAAA,YACH,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,QAAQ,GAAG,kBAAkB;AAAA,gBAC/E;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,CAAC;AAAA;AAAA,gBAC5B;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,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/parts/DSPaginator/{createPaginatorHeader.js → config/createPaginatorHeader.js}
RENAMED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
-
import { DSPaginationSeparator } from "../../
|
|
5
|
-
const createPaginatorHeader = ({
|
|
4
|
+
import { DSPaginationSeparator } from "../../DSPaginationSeparator/index.js";
|
|
5
|
+
const createPaginatorHeader = ({
|
|
6
|
+
pageDetailsTitle,
|
|
7
|
+
pageInfoWidth,
|
|
8
|
+
ownerPropsConfig
|
|
9
|
+
}) => {
|
|
6
10
|
const Comp = () => {
|
|
7
11
|
if (pageDetailsTitle === "") return /* @__PURE__ */ jsx(Fragment, { children: "Page" });
|
|
8
12
|
return /* @__PURE__ */ jsxs(Grid, { cols: [`${pageInfoWidth + 50}px`, "8px", "auto"], children: [
|
|
9
13
|
/* @__PURE__ */ jsx("span", { style: { marginLeft: "8px" }, children: "Page" }),
|
|
10
|
-
/* @__PURE__ */ jsx(DSPaginationSeparator, { height: "100%" }),
|
|
14
|
+
/* @__PURE__ */ jsx(DSPaginationSeparator, { height: "100%", ...ownerPropsConfig }),
|
|
11
15
|
/* @__PURE__ */ jsx("span", { children: pageDetailsTitle })
|
|
12
16
|
] });
|
|
13
17
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/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 '../../DSPaginationSeparator/index.js';\n\ninterface PaginatorHeaderOptions {\n pageDetailsTitle: string;\n pageInfoWidth: number;\n ownerPropsConfig: Record<string, unknown>;\n}\n\nexport const createPaginatorHeader = ({\n pageDetailsTitle,\n pageInfoWidth,\n ownerPropsConfig,\n}: 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%\" {...ownerPropsConfig} />\n <span>{pageDetailsTitle}</span>\n </Grid>\n );\n };\n return Comp;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBiB,wBAGlC,YAHkC;AAfxC,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAQ/B,MAAM,wBAAwB,CAAC;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,OAAO,MAAM;AACjB,QAAI,qBAAqB,GAAI,QAAO,gCAAE,kBAAI;AAE1C,WACE,qBAAC,QAAK,MAAM,CAAC,GAAG,gBAAgB,EAAE,MAAM,OAAO,MAAM,GACnD;AAAA,0BAAC,UAAK,OAAO,EAAE,YAAY,MAAM,GAAG,kBAAI;AAAA,MACxC,oBAAC,yBAAsB,QAAO,QAAQ,GAAG,kBAAkB;AAAA,MAC3D,oBAAC,UAAM,4BAAiB;AAAA,OAC1B;AAAA,EAEJ;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/getOptions.tsx"],
|
|
4
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-v2';\n\ninterface OptionWithDetailsT {\n pageInfoWidth: number;\n pageIndex: number;\n index: number;\n pageDetails: string[] | readonly 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[] | readonly 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
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,EAAE,MAAM,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,KAAK;AAAA;AAAA,MACpB;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
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/useOnElementOnResize.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useState, useEffect, useRef, useMemo } from 'react';\n\n// Custom hook to track dimension of a component\n// Taken and modified from https://stackoverflow.com/a/60218754\nexport const useOnElementResize = <T extends HTMLElement>(\n targetRef: React.RefObject<T>,\n): Record<'width' | 'height', number> => {\n const [width, setWidth] = useState(targetRef.current?.offsetWidth ?? 0);\n const [height, setHeight] = useState(targetRef.current?.offsetHeight ?? 0);\n const observer = useRef<ResizeObserver>();\n\n useEffect(() => {\n function outputsize() {\n setWidth(targetRef.current?.offsetWidth ?? 0);\n setHeight(targetRef.current?.offsetHeight ?? 0);\n }\n\n observer.current = new ResizeObserver(outputsize);\n const el = targetRef.current as Element | null;\n if (el) observer.current.observe(el);\n\n return () => {\n if (el) observer.current?.disconnect();\n };\n }, [targetRef]);\n\n return useMemo(\n () => ({\n width,\n height,\n }),\n [width, height],\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,UAAU,WAAW,QAAQ,eAAe;AAI9C,MAAM,qBAAqB,CAChC,cACuC;AACvC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,UAAU,SAAS,eAAe,CAAC;AACtE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,UAAU,SAAS,gBAAgB,CAAC;AACzE,QAAM,WAAW,OAAuB;AAExC,YAAU,MAAM;AACd,aAAS,aAAa;AACpB,eAAS,UAAU,SAAS,eAAe,CAAC;AAC5C,gBAAU,UAAU,SAAS,gBAAgB,CAAC;AAAA,IAChD;AAEA,aAAS,UAAU,IAAI,eAAe,UAAU;AAChD,UAAM,KAAK,UAAU;AACrB,QAAI,GAAI,UAAS,QAAQ,QAAQ,EAAE;AAEnC,WAAO,MAAM;AACX,UAAI,GAAI,UAAS,SAAS,WAAW;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAEd,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,OAAO,MAAM;AAAA,EAChB;AACF;",
|
|
6
6
|
"names": []
|
package/dist/esm/parts/DSPaginator/{usePaginationSearch.js.map → config/usePaginationSearch.js.map}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/usePaginationSearch.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport const usePaginationSearch = (\n pageCount: string | number,\n actionRef: React.MutableRefObject<Record<string, (dsId: string) => void>>,\n): React.KeyboardEventHandler => {\n const [searchValue, setSearchValue] = useState('');\n const [shouldResetSearchValue, setShouldResetSearchValue] = useState(true);\n\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n useEffect(() => {\n if (typeof pageCount === 'string') return;\n\n if (searchValue !== '' && Number.parseInt(searchValue, 10) <= pageCount) {\n actionRef.current.setActiveDescendant(searchValue);\n actionRef.current.scrollOptionIntoView(searchValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchValue]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.code.startsWith('Digit')) {\n if (shouldResetSearchValue) setSearchValue(e.key);\n else setSearchValue((prevValue) => prevValue + e.key);\n\n setShouldResetSearchValue(false);\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => {\n setShouldResetSearchValue(true);\n }, 1000);\n }\n },\n [shouldResetSearchValue],\n );\n\n return onKeyDown;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AAElD,MAAM,sBAAsB,CACjC,WACA,cAC+B;AAC/B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,EAAE;AACjD,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,SAAS,IAAI;AAEzE,QAAM,aAAa,OAAuB;AAE1C,YAAU,MAAM;AACd,QAAI,OAAO,cAAc,SAAU;AAEnC,QAAI,gBAAgB,MAAM,OAAO,SAAS,aAAa,EAAE,KAAK,WAAW;AACvE,gBAAU,QAAQ,oBAAoB,WAAW;AACjD,gBAAU,QAAQ,qBAAqB,WAAW;AAAA,IACpD;AAAA,EAEF,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,YAAY;AAAA,IAChB,CAAC,MAA2B;AAC1B,UAAI,EAAE,KAAK,WAAW,OAAO,GAAG;AAC9B,YAAI,uBAAwB,gBAAe,EAAE,GAAG;AAAA,YAC3C,gBAAe,CAAC,cAAc,YAAY,EAAE,GAAG;AAEpD,kCAA0B,KAAK;AAC/B,YAAI,WAAW,QAAS,cAAa,WAAW,OAAO;AACvD,mBAAW,UAAU,WAAW,MAAM;AACpC,oCAA0B,IAAI;AAAA,QAChC,GAAG,GAAI;AAAA,MACT;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB;AAAA,EACzB;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
useGetGlobalAttributes,
|
|
4
|
+
useGetXstyledProps,
|
|
5
|
+
useMemoMergePropsWithDefault,
|
|
6
|
+
useOwnerProps
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
8
|
+
import React2, { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { DSPaginatorPropTypesSchema, defaultProps } from "../react-desc-prop-types.js";
|
|
10
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
6
11
|
import { useOnElementResize } from "./useOnElementOnResize.js";
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
import { getOptions } from "./getOptions.js";
|
|
13
|
+
import { usePaginationSearch } from "./usePaginationSearch.js";
|
|
14
|
+
const usePaginator = (propsFromUser) => {
|
|
15
|
+
const propsWithDefault = useMemoMergePropsWithDefault(propsFromUser, defaultProps);
|
|
16
|
+
useValidateProps(propsWithDefault, DSPaginatorPropTypesSchema);
|
|
17
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
18
|
+
const globalAttributes = useGetGlobalAttributes(
|
|
19
|
+
propsWithDefault
|
|
20
|
+
);
|
|
21
|
+
const ownerPropsConfig = useOwnerProps(propsWithDefault);
|
|
22
|
+
const { pageIndex, pageCount, pageDetails } = propsWithDefault;
|
|
9
23
|
const [isOpened, setIsOpened] = useState(false);
|
|
10
24
|
const [detailWidth, setDetailWidth] = useState(0);
|
|
11
25
|
const [pageInfoWidth, setPageInfoWidth] = useState(0);
|
|
@@ -17,8 +31,6 @@ const usePaginator = (props) => {
|
|
|
17
31
|
[pageCount, pageIndex, pageDetails, pageInfoWidth]
|
|
18
32
|
);
|
|
19
33
|
const onKeyDown = usePaginationSearch(pageCount, actionRef);
|
|
20
|
-
const globalAttributes = useGetGlobalAttributes(props);
|
|
21
|
-
const xstyledAttributes = useGetXstyledProps(props);
|
|
22
34
|
useEffect(() => {
|
|
23
35
|
if (isOpened) {
|
|
24
36
|
actionRef.current.setActiveDescendant(pageIndex.toString());
|
|
@@ -38,20 +50,38 @@ const usePaginator = (props) => {
|
|
|
38
50
|
return btnWidth - 56;
|
|
39
51
|
});
|
|
40
52
|
}, [btnWidth, detailWidth]);
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
return React2.useMemo(
|
|
54
|
+
() => ({
|
|
55
|
+
propsWithDefault,
|
|
56
|
+
xstyledProps,
|
|
57
|
+
globalAttributes,
|
|
58
|
+
ownerPropsConfig,
|
|
59
|
+
btnRef,
|
|
60
|
+
btnWidth,
|
|
61
|
+
pageInfoWidth,
|
|
62
|
+
options,
|
|
63
|
+
isOpened,
|
|
64
|
+
detailWidth,
|
|
65
|
+
actionRef,
|
|
66
|
+
setIsOpened,
|
|
67
|
+
onKeyDown
|
|
68
|
+
}),
|
|
69
|
+
[
|
|
70
|
+
propsWithDefault,
|
|
71
|
+
xstyledProps,
|
|
72
|
+
globalAttributes,
|
|
73
|
+
ownerPropsConfig,
|
|
74
|
+
btnRef,
|
|
75
|
+
btnWidth,
|
|
76
|
+
pageInfoWidth,
|
|
77
|
+
options,
|
|
78
|
+
isOpened,
|
|
79
|
+
detailWidth,
|
|
80
|
+
actionRef,
|
|
81
|
+
setIsOpened,
|
|
82
|
+
onKeyDown
|
|
83
|
+
]
|
|
84
|
+
);
|
|
55
85
|
};
|
|
56
86
|
export {
|
|
57
87
|
usePaginator
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPaginator/config/usePaginator.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\nimport React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport type { DSButtonV3T } from '@elliemae/ds-button-v2';\nimport { type DSPaginatorT, DSPaginatorPropTypesSchema, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useOnElementResize } from './useOnElementOnResize.js';\nimport { getOptions } from './getOptions.js';\nimport { usePaginationSearch } from './usePaginationSearch.js';\n\nexport const usePaginator = (propsFromUser: DSPaginatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginatorT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSPaginatorPropTypesSchema);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // GLOBAL ATTRIBUTES\n // =============================================================================\n const globalAttributes = useGetGlobalAttributes<DSPaginatorT.InternalProps, HTMLButtonElement, DSButtonV3T.Props>(\n propsWithDefault,\n );\n // =============================================================================\n // OWNER PROPS\n // =============================================================================\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n\n const { pageIndex, pageCount, pageDetails } = propsWithDefault;\n\n const [isOpened, setIsOpened] = useState(false);\n const [detailWidth, setDetailWidth] = useState(0);\n const [pageInfoWidth, setPageInfoWidth] = useState(0);\n\n const btnRef = useRef<HTMLButtonElement>(null);\n const actionRef = useRef<Record<string, (dsId: string) => void>>({});\n\n const { width: btnWidth } = useOnElementResize(btnRef);\n\n const options = useMemo(\n () => getOptions({ pageCount, pageIndex, pageDetails, pageInfoWidth }),\n [pageCount, pageIndex, pageDetails, pageInfoWidth],\n );\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n // const eventHandlers = useEventHandlers({ propsWithDefault, instanceUid }); // <-- complex logic should be made atomics this way\n const onKeyDown = usePaginationSearch(pageCount, actionRef);\n useEffect(() => {\n if (isOpened) {\n actionRef.current.setActiveDescendant(pageIndex.toString());\n actionRef.current.scrollOptionIntoView(pageIndex.toString());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpened]);\n\n useLayoutEffect(() => {\n const invisibleDetails = [\n ...document.body.querySelectorAll('[data-testid=\"ds-pagination-invisible-detail-for-width-calc\"]'),\n ] as HTMLDivElement[];\n const maxWidth = invisibleDetails.reduce((acc, cur) => Math.max(acc, cur.getBoundingClientRect().width), 0);\n setDetailWidth(maxWidth);\n }, [pageDetails]);\n\n useEffect(() => {\n setPageInfoWidth(() => {\n // Here we get the size of the page info\n // Inside of the button, we have the page info, the chevron, separators, page details and padding\n // We substract the detailWidth if present, and the padding + chevron + separators in each case\n if (detailWidth) return btnWidth - detailWidth - 89;\n return btnWidth - 56;\n });\n }, [btnWidth, detailWidth]);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n globalAttributes,\n ownerPropsConfig,\n btnRef,\n btnWidth,\n pageInfoWidth,\n options,\n isOpened,\n detailWidth,\n actionRef,\n setIsOpened,\n onKeyDown,\n }),\n [\n propsWithDefault,\n xstyledProps,\n globalAttributes,\n ownerPropsConfig,\n btnRef,\n btnWidth,\n pageInfoWidth,\n options,\n isOpened,\n detailWidth,\n actionRef,\n setIsOpened,\n onKeyDown,\n ],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAOA,UAAS,WAAW,iBAAiB,SAAS,QAAQ,gBAAgB;AAG7E,SAA4B,4BAA4B,oBAAoB;AAC5E,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAE7B,MAAM,eAAe,CAAC,kBAAsC;AAIjE,QAAM,mBAAmB,6BAAyD,eAAe,YAAY;AAC7G,mBAAiB,kBAAkB,0BAA0B;AAI7D,QAAM,eAAe,mBAAmB,gBAAgB;AAIxD,QAAM,mBAAmB;AAAA,IACvB;AAAA,EACF;AAIA,QAAM,mBAAmB,cAAc,gBAAgB;AAKvD,QAAM,EAAE,WAAW,WAAW,YAAY,IAAI;AAE9C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,CAAC;AAChD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AAEpD,QAAM,SAAS,OAA0B,IAAI;AAC7C,QAAM,YAAY,OAA+C,CAAC,CAAC;AAEnE,QAAM,EAAE,OAAO,SAAS,IAAI,mBAAmB,MAAM;AAErD,QAAM,UAAU;AAAA,IACd,MAAM,WAAW,EAAE,WAAW,WAAW,aAAa,cAAc,CAAC;AAAA,IACrE,CAAC,WAAW,WAAW,aAAa,aAAa;AAAA,EACnD;AAKA,QAAM,YAAY,oBAAoB,WAAW,SAAS;AAC1D,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,gBAAU,QAAQ,oBAAoB,UAAU,SAAS,CAAC;AAC1D,gBAAU,QAAQ,qBAAqB,UAAU,SAAS,CAAC;AAAA,IAC7D;AAAA,EAEF,GAAG,CAAC,QAAQ,CAAC;AAEb,kBAAgB,MAAM;AACpB,UAAM,mBAAmB;AAAA,MACvB,GAAG,SAAS,KAAK,iBAAiB,+DAA+D;AAAA,IACnG;AACA,UAAM,WAAW,iBAAiB,OAAO,CAAC,KAAK,QAAQ,KAAK,IAAI,KAAK,IAAI,sBAAsB,EAAE,KAAK,GAAG,CAAC;AAC1G,mBAAe,QAAQ;AAAA,EACzB,GAAG,CAAC,WAAW,CAAC;AAEhB,YAAU,MAAM;AACd,qBAAiB,MAAM;AAIrB,UAAI,YAAa,QAAO,WAAW,cAAc;AACjD,aAAO,WAAW;AAAA,IACpB,CAAC;AAAA,EACH,GAAG,CAAC,UAAU,WAAW,CAAC;AAE1B,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSPaginatorName } from "../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSPaginatorName);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useValidateProps
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
import { DSPaginationName } from "../../../constants/index.js";
|
|
4
|
+
const DSPaginatorName = "DSPaginator";
|
|
5
|
+
const PAGINATOR_SLOTS = {
|
|
6
|
+
PAGINATOR: "paginator"
|
|
7
|
+
};
|
|
8
|
+
const PAGINATOR_DATA_TESTID = slotObjectToDataTestIds(DSPaginationName, PAGINATOR_SLOTS);
|
|
9
|
+
export {
|
|
10
|
+
DSPaginationName,
|
|
11
|
+
DSPaginatorName,
|
|
12
|
+
PAGINATOR_DATA_TESTID,
|
|
13
|
+
PAGINATOR_SLOTS
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|