@elliemae/ds-pagination 3.16.0-next.2 → 3.16.0-next.21
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/DSPaginationDefinitions.js +17 -1
- package/dist/cjs/DSPaginationDefinitions.js.map +2 -2
- package/dist/cjs/Pagination.js +11 -7
- package/dist/cjs/Pagination.js.map +2 -2
- package/dist/cjs/PaginationDataTestID.js +7 -1
- package/dist/cjs/PaginationDataTestID.js.map +2 -2
- package/dist/cjs/index.js +36 -2
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/DSPageNextButton.js +74 -0
- package/dist/cjs/parts/DSPageNextButton.js.map +7 -0
- package/dist/cjs/parts/DSPagePrevButton.js +74 -0
- package/dist/cjs/parts/DSPagePrevButton.js.map +7 -0
- package/dist/cjs/parts/DSPaginationContainer.js +61 -0
- package/dist/cjs/parts/DSPaginationContainer.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/createPaginatorHeader.js +50 -0
- package/dist/cjs/parts/DSPaginator/createPaginatorHeader.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/getOptions.js +76 -0
- package/dist/cjs/parts/DSPaginator/getOptions.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/index.js +148 -0
- package/dist/cjs/parts/DSPaginator/index.js.map +7 -0
- package/dist/cjs/{hooks → parts/DSPaginator}/usePaginationSearch.js +9 -2
- package/dist/cjs/parts/DSPaginator/usePaginationSearch.js.map +7 -0
- package/dist/cjs/parts/DSPaginator/usePaginator.js +91 -0
- package/dist/cjs/parts/DSPaginator/usePaginator.js.map +7 -0
- package/dist/cjs/parts/{PagePrevButton.js → DSPerPageSelector/getOptions.js} +25 -22
- package/dist/cjs/parts/DSPerPageSelector/getOptions.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/index.js +106 -0
- package/dist/cjs/parts/DSPerPageSelector/index.js.map +7 -0
- package/dist/cjs/parts/DSPerPageSelector/usePerPageSelector.js +72 -0
- package/dist/cjs/parts/DSPerPageSelector/usePerPageSelector.js.map +7 -0
- package/dist/cjs/parts/PaginationContent.js +41 -52
- package/dist/cjs/parts/PaginationContent.js.map +3 -3
- package/dist/cjs/parts/index.js +49 -0
- package/dist/cjs/parts/index.js.map +7 -0
- package/dist/cjs/props.js +85 -0
- package/dist/cjs/props.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +111 -33
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +21 -27
- package/dist/cjs/styled.js.map +2 -2
- package/dist/esm/DSPaginationDefinitions.js +13 -1
- package/dist/esm/DSPaginationDefinitions.js.map +2 -2
- package/dist/esm/Pagination.js +4 -4
- package/dist/esm/Pagination.js.map +1 -1
- package/dist/esm/PaginationDataTestID.js +3 -1
- package/dist/esm/PaginationDataTestID.js.map +2 -2
- package/dist/esm/index.js +39 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/DSPageNextButton.js +50 -0
- package/dist/esm/parts/DSPageNextButton.js.map +7 -0
- package/dist/esm/parts/DSPagePrevButton.js +50 -0
- package/dist/esm/parts/DSPagePrevButton.js.map +7 -0
- package/dist/esm/parts/DSPaginationContainer.js +31 -0
- package/dist/esm/parts/DSPaginationContainer.js.map +7 -0
- package/dist/esm/parts/DSPaginator/createPaginatorHeader.js +20 -0
- package/dist/esm/parts/DSPaginator/createPaginatorHeader.js.map +7 -0
- package/dist/esm/parts/DSPaginator/getOptions.js +46 -0
- package/dist/esm/parts/DSPaginator/getOptions.js.map +7 -0
- package/dist/esm/parts/DSPaginator/index.js +118 -0
- package/dist/esm/parts/DSPaginator/index.js.map +7 -0
- package/dist/esm/{hooks → parts/DSPaginator}/usePaginationSearch.js +5 -2
- package/dist/esm/parts/DSPaginator/usePaginationSearch.js.map +7 -0
- package/dist/esm/parts/DSPaginator/usePaginator.js +61 -0
- package/dist/esm/parts/DSPaginator/usePaginator.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/getOptions.js +22 -0
- package/dist/esm/parts/DSPerPageSelector/getOptions.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/index.js +76 -0
- package/dist/esm/parts/DSPerPageSelector/index.js.map +7 -0
- package/dist/esm/parts/DSPerPageSelector/usePerPageSelector.js +42 -0
- package/dist/esm/parts/DSPerPageSelector/usePerPageSelector.js.map +7 -0
- package/dist/esm/parts/PaginationContent.js +37 -52
- package/dist/esm/parts/PaginationContent.js.map +2 -2
- package/dist/esm/parts/index.js +19 -0
- package/dist/esm/parts/index.js.map +7 -0
- package/dist/esm/props.js +55 -0
- package/dist/esm/props.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +88 -14
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +15 -25
- package/dist/esm/styled.js.map +2 -2
- package/dist/types/DSPaginationDefinitions.d.ts +6 -0
- package/dist/types/Pagination.d.ts +2 -2
- package/dist/types/PaginationDataTestID.d.ts +2 -0
- package/dist/types/index.d.ts +17 -1
- package/dist/types/parts/DSPageNextButton.d.ts +4 -0
- package/dist/types/parts/DSPagePrevButton.d.ts +4 -0
- package/dist/types/parts/DSPaginationContainer.d.ts +4 -0
- package/dist/types/parts/DSPaginator/createPaginatorHeader.d.ts +6 -0
- package/dist/types/parts/DSPaginator/getOptions.d.ts +7 -0
- package/dist/types/parts/DSPaginator/index.d.ts +4 -0
- package/dist/types/parts/DSPaginator/usePaginationSearch.d.ts +2 -0
- package/dist/types/parts/DSPaginator/usePaginator.d.ts +17 -0
- package/dist/types/parts/DSPerPageSelector/getOptions.d.ts +3 -0
- package/dist/types/parts/DSPerPageSelector/index.d.ts +4 -0
- package/dist/types/parts/DSPerPageSelector/usePerPageSelector.d.ts +13 -0
- package/dist/types/parts/PaginationContent.d.ts +1 -1
- package/dist/types/parts/index.d.ts +5 -0
- package/dist/types/props.d.ts +20 -0
- package/dist/types/react-desc-prop-types.d.ts +528 -9
- package/dist/types/styled.d.ts +7 -9
- package/dist/types/tests/a11y/axe.test.d.ts +1 -0
- package/dist/types/tests/callbacks/paginator.test.d.ts +1 -0
- package/dist/types/tests/callbacks/per-page-selector.test.d.ts +1 -0
- package/dist/types/tests/callbacks/prev-next-buttons.test.d.ts +1 -0
- package/dist/types/tests/keyboard/navigation.test.d.ts +1 -0
- package/dist/types/tests/keyboard/paginator-search.test.d.ts +1 -0
- package/dist/types/tests/render/page-count-loading.test.d.ts +1 -0
- package/dist/types/tests/render/paginator.test.d.ts +1 -0
- package/dist/types/tests/render/per-page-selector.test.d.ts +1 -0
- package/dist/types/tests/render/segmented-paginator.test.d.ts +1 -0
- package/dist/types/tests/render/simple.render.test.d.ts +1 -0
- package/package.json +18 -12
- package/dist/cjs/hooks/usePaginationSearch.js.map +0 -7
- package/dist/cjs/parts/PageNextButton.js +0 -52
- package/dist/cjs/parts/PageNextButton.js.map +0 -7
- package/dist/cjs/parts/PagePrevButton.js.map +0 -7
- package/dist/cjs/parts/Paginator.js +0 -162
- package/dist/cjs/parts/Paginator.js.map +0 -7
- package/dist/cjs/parts/PerPageSelector.js +0 -114
- package/dist/cjs/parts/PerPageSelector.js.map +0 -7
- package/dist/esm/hooks/usePaginationSearch.js.map +0 -7
- package/dist/esm/parts/PageNextButton.js +0 -26
- package/dist/esm/parts/PageNextButton.js.map +0 -7
- package/dist/esm/parts/PagePrevButton.js +0 -23
- package/dist/esm/parts/PagePrevButton.js.map +0 -7
- package/dist/esm/parts/Paginator.js +0 -136
- package/dist/esm/parts/Paginator.js.map +0 -7
- package/dist/esm/parts/PerPageSelector.js +0 -88
- package/dist/esm/parts/PerPageSelector.js.map +0 -7
- package/dist/types/hooks/usePaginationSearch.d.ts +0 -1
- package/dist/types/parts/PageNextButton.d.ts +0 -3
- package/dist/types/parts/PagePrevButton.d.ts +0 -3
- package/dist/types/parts/Paginator.d.ts +0 -11
- package/dist/types/parts/PerPageSelector.d.ts +0 -4
package/dist/cjs/styled.js
CHANGED
|
@@ -18,25 +18,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
24
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
29
|
var styled_exports = {};
|
|
26
30
|
__export(styled_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
PaginationContainer: () => PaginationContainer,
|
|
30
|
-
PaginationDetail: () => PaginationDetail,
|
|
31
|
+
DSPaginationSeparator: () => DSPaginationSeparator,
|
|
32
|
+
InvisibleDiv: () => InvisibleDiv,
|
|
31
33
|
PaginationDropdownButton: () => PaginationDropdownButton,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
PreviousNextPageButton: () => PreviousNextPageButton,
|
|
35
|
+
StyledPaginationContainer: () => StyledPaginationContainer,
|
|
36
|
+
StyledPaginationWrapper: () => StyledPaginationWrapper
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(styled_exports);
|
|
37
39
|
var React = __toESM(require("react"));
|
|
38
40
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
39
|
-
var
|
|
41
|
+
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
40
42
|
var import_ds_system = require("@elliemae/ds-system");
|
|
41
43
|
const styledFocusCss = import_ds_system.css`
|
|
42
44
|
&:after {
|
|
@@ -52,43 +54,35 @@ const styledFocusCss = import_ds_system.css`
|
|
|
52
54
|
z-index: 7;
|
|
53
55
|
}
|
|
54
56
|
`;
|
|
55
|
-
const
|
|
57
|
+
const StyledPaginationContainer = (0, import_ds_system.styled)(import_ds_grid.Grid)`
|
|
56
58
|
height: 42px;
|
|
57
59
|
max-width: 100%;
|
|
58
60
|
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
59
62
|
box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.5);
|
|
60
63
|
position: relative;
|
|
61
64
|
${import_ds_system.xStyledCommonProps}
|
|
62
65
|
`;
|
|
63
|
-
const
|
|
64
|
-
display:
|
|
66
|
+
const StyledPaginationWrapper = import_ds_system.styled.div`
|
|
67
|
+
display: grid;
|
|
68
|
+
grid-auto-flow: column;
|
|
65
69
|
justify-content: center;
|
|
66
70
|
align-items: center;
|
|
67
71
|
`;
|
|
68
|
-
const
|
|
72
|
+
const DSPaginationSeparator = (0, import_ds_system.styled)(import_ds_grid.Grid)`
|
|
69
73
|
background-color: ${(props) => props.theme.colors.neutral[300]};
|
|
70
74
|
width: 1px;
|
|
71
|
-
height:
|
|
72
|
-
`;
|
|
73
|
-
const PaginationBoldText = import_ds_system.styled.span`
|
|
74
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
75
|
-
position: relative;
|
|
75
|
+
height: 30px;
|
|
76
76
|
${import_ds_system.xStyledCommonProps}
|
|
77
77
|
`;
|
|
78
|
-
const
|
|
78
|
+
const InvisibleDiv = import_ds_system.styled.div`
|
|
79
79
|
opacity: 0;
|
|
80
80
|
white-space: nowrap;
|
|
81
81
|
overflow: hidden;
|
|
82
82
|
text-overflow: ellipsis;
|
|
83
83
|
position: absolute;
|
|
84
84
|
`;
|
|
85
|
-
const
|
|
86
|
-
text-align: left;
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
overflow: hidden;
|
|
89
|
-
text-overflow: ellipsis;
|
|
90
|
-
`;
|
|
91
|
-
const PaginationDropdownButton = (0, import_ds_system.styled)(import_ds_button.DSButtonV2)`
|
|
85
|
+
const PaginationDropdownButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2)`
|
|
92
86
|
height: 42px;
|
|
93
87
|
display: grid;
|
|
94
88
|
grid-auto-flow: column;
|
|
@@ -99,7 +93,7 @@ const PaginationDropdownButton = (0, import_ds_system.styled)(import_ds_button.D
|
|
|
99
93
|
padding-right: 16px;
|
|
100
94
|
grid-gap: 8px;
|
|
101
95
|
font-size: 13px;
|
|
102
|
-
color:
|
|
96
|
+
color: neutral-700;
|
|
103
97
|
cursor: pointer;
|
|
104
98
|
border-radius: 0;
|
|
105
99
|
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
@@ -111,7 +105,7 @@ const PaginationDropdownButton = (0, import_ds_system.styled)(import_ds_button.D
|
|
|
111
105
|
}
|
|
112
106
|
white-space: nowrap;
|
|
113
107
|
`;
|
|
114
|
-
const PreviousNextPageButton = (0, import_ds_system.styled)(
|
|
108
|
+
const PreviousNextPageButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2)`
|
|
115
109
|
height: 42px;
|
|
116
110
|
display: grid;
|
|
117
111
|
place-items: center;
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { xStyledCommonProps, styled, css } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { xStyledCommonProps, styled, css } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport type {} from '@xstyled/system';\n\nconst styledFocusCss = css`\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nexport const StyledPaginationContainer = styled(Grid)<React.ComponentProps<typeof Grid> & XstyledProps>`\n height: 42px;\n max-width: 100%;\n align-items: center;\n justify-content: center;\n box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.5);\n position: relative;\n ${xStyledCommonProps}\n`;\n\nexport const StyledPaginationWrapper = styled.div`\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n`;\n\nexport const DSPaginationSeparator = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral[300]};\n width: 1px;\n height: 30px;\n ${xStyledCommonProps}\n`;\n\nexport const InvisibleDiv = styled.div`\n opacity: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n position: absolute;\n`;\n\nexport const PaginationDropdownButton = styled(DSButtonV2)`\n height: 42px;\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n position: relative;\n padding-left: 16px;\n padding-right: 16px;\n grid-gap: 8px;\n font-size: 13px;\n color: neutral-700;\n cursor: pointer;\n border-radius: 0;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n :focus {\n ${styledFocusCss}\n }\n &[aria-disabled='true'] {\n cursor: not-allowed;\n }\n white-space: nowrap;\n`;\n\nexport const PreviousNextPageButton = styled(DSButtonV2)`\n height: 42px;\n display: grid;\n place-items: center;\n position: relative;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 0;\n cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n :focus {\n ${styledFocusCss}\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AACrB,0BAA2B;AAC3B,uBAAgD;AAIhD,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAMtD,MAAM,gCAA4B,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOhD;AAAA;AAGG,MAAM,0BAA0B,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvC,MAAM,4BAAwB,yBAAO,mBAAI;AAAA,sBAC1B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA,IAG3D;AAAA;AAGG,MAAM,eAAe,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ5B,MAAM,+BAA2B,yBAAO,8BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAcxC,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA,MAE9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQC,MAAM,6BAAyB,yBAAO,8BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQ3C,CAAC,UAAW,MAAM,WAAW,gBAAgB;AAAA;AAAA,MAEnD;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
const DSPaginationName = "DSPagination";
|
|
3
|
+
const PaginationContainerName = "DSPaginationContainer";
|
|
4
|
+
const PerPageSelectorName = "DSPerPageSelector";
|
|
5
|
+
const PagePrevButtonName = "DSPagePrevButton";
|
|
6
|
+
const PageNextButtonName = "DSPageNextButton";
|
|
7
|
+
const PaginatorName = "DSPaginator";
|
|
8
|
+
const PaginationSeparatorName = "DSPaginationSeparator";
|
|
3
9
|
export {
|
|
4
|
-
DSPaginationName
|
|
10
|
+
DSPaginationName,
|
|
11
|
+
PageNextButtonName,
|
|
12
|
+
PagePrevButtonName,
|
|
13
|
+
PaginationContainerName,
|
|
14
|
+
PaginationSeparatorName,
|
|
15
|
+
PaginatorName,
|
|
16
|
+
PerPageSelectorName
|
|
5
17
|
};
|
|
6
18
|
//# sourceMappingURL=DSPaginationDefinitions.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSPaginationDefinitions.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSPaginationName = 'DSPagination';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSPaginationName = 'DSPagination';\n\nexport const PaginationContainerName = 'DSPaginationContainer';\n\nexport const PerPageSelectorName = 'DSPerPageSelector';\n\nexport const PagePrevButtonName = 'DSPagePrevButton';\n\nexport const PageNextButtonName = 'DSPageNextButton';\n\nexport const PaginatorName = 'DSPaginator';\n\nexport const PaginationSeparatorName = 'DSPaginationSeparator';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB;AAEzB,MAAM,0BAA0B;AAEhC,MAAM,sBAAsB;AAE5B,MAAM,qBAAqB;AAE3B,MAAM,qBAAqB;AAE3B,MAAM,gBAAgB;AAEtB,MAAM,0BAA0B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Pagination.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-
|
|
4
|
-
import { PaginationContent } from "./parts/PaginationContent";
|
|
5
|
-
import { DSPaginationName } from "./DSPaginationDefinitions";
|
|
6
|
-
import { defaultProps, DSPaginationPropTypesSchema } from "./react-desc-prop-types";
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { PaginationContent } from "./parts/PaginationContent.js";
|
|
5
|
+
import { DSPaginationName } from "./DSPaginationDefinitions.js";
|
|
6
|
+
import { defaultProps, DSPaginationPropTypesSchema } from "./react-desc-prop-types.js";
|
|
7
7
|
const DSPagination = (props) => {
|
|
8
8
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
9
9
|
useValidateTypescriptPropTypes(propsWithDefault, DSPaginationPropTypesSchema, DSPaginationName);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Pagination.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { PaginationContent } from './parts/PaginationContent.js';\nimport { DSPaginationName } from './DSPaginationDefinitions.js';\nimport type { DSPaginationT } from './react-desc-prop-types.js';\nimport { defaultProps, DSPaginationPropTypesSchema } from './react-desc-prop-types.js';\n\nconst DSPagination: React.ComponentType<DSPaginationT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, DSPaginationPropTypesSchema, DSPaginationName);\n\n return <PaginationContent {...propsWithDefault} />;\n};\n\nDSPagination.propTypes = DSPaginationPropTypesSchema;\nDSPagination.displayName = DSPaginationName;\nconst DSPaginationWithSchema = describe(DSPagination).description('DSPagination');\nDSPaginationWithSchema.propTypes = DSPaginationPropTypesSchema;\n\nexport { DSPagination, DSPaginationWithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACWd;AAVT,SAAS,UAAU,8BAA8B,sCAAsC;AACvF,SAAS,yBAAyB;AAClC,SAAS,wBAAwB;AAEjC,SAAS,cAAc,mCAAmC;AAE1D,MAAM,eAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA0D,OAAO,YAAY;AACtG,iCAA+B,kBAAkB,6BAA6B,gBAAgB;AAE9F,SAAO,oBAAC,qBAAmB,GAAG,kBAAkB;AAClD;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY,EAAE,YAAY,cAAc;AAChF,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
const PAGINATION_DATA_TESTID = {
|
|
3
3
|
PREVIOUS_BUTTON: "data-table-pagination-prev-button",
|
|
4
4
|
NEXT_BUTTON: "data-table-pagination-next-button",
|
|
5
|
-
CONTAINER: "data-table-pagination-container"
|
|
5
|
+
CONTAINER: "data-table-pagination-container",
|
|
6
|
+
PER_PAGE_SELECTOR: "ds-pagination-per-page-selector",
|
|
7
|
+
PAGINATOR: "ds-pagination-paginator"
|
|
6
8
|
};
|
|
7
9
|
export {
|
|
8
10
|
PAGINATION_DATA_TESTID
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/PaginationDataTestID.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const PAGINATION_DATA_TESTID = {\n PREVIOUS_BUTTON: 'data-table-pagination-prev-button',\n NEXT_BUTTON: 'data-table-pagination-next-button',\n CONTAINER: 'data-table-pagination-container',\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,WAAW;AACb;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const PAGINATION_DATA_TESTID = {\n PREVIOUS_BUTTON: 'data-table-pagination-prev-button',\n NEXT_BUTTON: 'data-table-pagination-next-button',\n CONTAINER: 'data-table-pagination-container',\n PER_PAGE_SELECTOR: 'ds-pagination-per-page-selector',\n PAGINATOR: 'ds-pagination-paginator',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,yBAAyB;AAAA,EACpC,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,WAAW;AACb;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { DSPaginationSeparator } from "./styled.js";
|
|
3
|
+
import { DSPaginationStyledPartPropTypesSchema } from "./react-desc-prop-types.js";
|
|
4
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { PaginationSeparatorName } from "./DSPaginationDefinitions.js";
|
|
6
|
+
DSPaginationSeparator.propTypes = DSPaginationStyledPartPropTypesSchema;
|
|
7
|
+
DSPaginationSeparator.displayName = PaginationSeparatorName;
|
|
8
|
+
const DSPaginationSeparatorWithSchema = describe(DSPaginationSeparator).description("Pagination Separator");
|
|
9
|
+
import { DSPagination, DSPaginationWithSchema } from "./Pagination.js";
|
|
10
|
+
import {
|
|
11
|
+
DSPageNextButton,
|
|
12
|
+
DSPageNextButtonWithSchema,
|
|
13
|
+
DSPagePrevButton,
|
|
14
|
+
DSPagePrevButtonWithSchema,
|
|
15
|
+
DSPaginationContainer,
|
|
16
|
+
DSPaginationContainerWithSchema,
|
|
17
|
+
DSPerPageSelector,
|
|
18
|
+
DSPerPageSelectorWithSchema,
|
|
19
|
+
DSPaginator,
|
|
20
|
+
DSPaginatorWithSchema
|
|
21
|
+
} from "./parts/index.js";
|
|
22
|
+
import { DSPaginationSeparator as DSPaginationSeparator2 } from "./styled.js";
|
|
23
|
+
import { PAGINATION_DATA_TESTID } from "./PaginationDataTestID.js";
|
|
24
|
+
export {
|
|
25
|
+
DSPageNextButton,
|
|
26
|
+
DSPageNextButtonWithSchema,
|
|
27
|
+
DSPagePrevButton,
|
|
28
|
+
DSPagePrevButtonWithSchema,
|
|
29
|
+
DSPagination,
|
|
30
|
+
DSPaginationContainer,
|
|
31
|
+
DSPaginationContainerWithSchema,
|
|
32
|
+
DSPaginationSeparator2 as DSPaginationSeparator,
|
|
33
|
+
DSPaginationSeparatorWithSchema,
|
|
34
|
+
DSPaginationWithSchema,
|
|
35
|
+
DSPaginator,
|
|
36
|
+
DSPaginatorWithSchema,
|
|
37
|
+
DSPerPageSelector,
|
|
38
|
+
DSPerPageSelectorWithSchema,
|
|
39
|
+
PAGINATION_DATA_TESTID
|
|
40
|
+
};
|
|
3
41
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;",
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSPaginationSeparator } from './styled.js';\nimport { DSPaginationStyledPartPropTypesSchema } from './react-desc-prop-types.js';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { PaginationSeparatorName } from './DSPaginationDefinitions.js';\n\nDSPaginationSeparator.propTypes = DSPaginationStyledPartPropTypesSchema;\nDSPaginationSeparator.displayName = PaginationSeparatorName;\nconst DSPaginationSeparatorWithSchema = describe(DSPaginationSeparator).description('Pagination Separator');\n\nexport { DSPagination, DSPaginationWithSchema } from './Pagination.js';\nexport {\n DSPageNextButton,\n DSPageNextButtonWithSchema,\n DSPagePrevButton,\n DSPagePrevButtonWithSchema,\n DSPaginationContainer,\n DSPaginationContainerWithSchema,\n DSPerPageSelector,\n DSPerPageSelectorWithSchema,\n DSPaginator,\n DSPaginatorWithSchema,\n} from './parts/index.js';\n\nexport { DSPaginationSeparator } from './styled.js';\n\nexport { DSPaginationSeparatorWithSchema };\n\nexport { PAGINATION_DATA_TESTID } from './PaginationDataTestID.js';\n\nexport type { DSPaginationT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,6BAA6B;AACtC,SAAS,6CAA6C;AACtD,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AAExC,sBAAsB,YAAY;AAClC,sBAAsB,cAAc;AACpC,MAAM,kCAAkC,SAAS,qBAAqB,EAAE,YAAY,sBAAsB;AAE1G,SAAS,cAAc,8BAA8B;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,yBAAAA,8BAA6B;AAItC,SAAS,8BAA8B;",
|
|
6
|
+
"names": ["DSPaginationSeparator"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { omit } from "lodash";
|
|
4
|
+
import { ChevronRight } from "@elliemae/ds-icons";
|
|
5
|
+
import {
|
|
6
|
+
describe,
|
|
7
|
+
useGetGlobalAttributes,
|
|
8
|
+
useGetXstyledProps,
|
|
9
|
+
useMemoMergePropsWithDefault,
|
|
10
|
+
useValidateTypescriptPropTypes
|
|
11
|
+
} from "@elliemae/ds-props-helpers";
|
|
12
|
+
import { PAGINATION_DATA_TESTID } from "../PaginationDataTestID.js";
|
|
13
|
+
import { PreviousNextPageButton } from "../styled.js";
|
|
14
|
+
import { pageNextButtonDefaultProps, DSPageNextButtonPropTypesSchema } from "../react-desc-prop-types.js";
|
|
15
|
+
import { PageNextButtonName } from "../DSPaginationDefinitions.js";
|
|
16
|
+
const DSPageNextButton = (props) => {
|
|
17
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
18
|
+
props,
|
|
19
|
+
pageNextButtonDefaultProps
|
|
20
|
+
);
|
|
21
|
+
useValidateTypescriptPropTypes(propsWithDefault, DSPageNextButtonPropTypesSchema, PageNextButtonName);
|
|
22
|
+
const { canNextPage, onNextPage } = propsWithDefault;
|
|
23
|
+
const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), "shape", "size", "type");
|
|
24
|
+
const xstyledAttributes = useGetXstyledProps(propsWithDefault);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
PreviousNextPageButton,
|
|
27
|
+
{
|
|
28
|
+
disabled: !canNextPage,
|
|
29
|
+
buttonType: "raw",
|
|
30
|
+
"data-testid": PAGINATION_DATA_TESTID.NEXT_BUTTON,
|
|
31
|
+
"aria-label": "Go to next page",
|
|
32
|
+
...globalAttributes,
|
|
33
|
+
...xstyledAttributes,
|
|
34
|
+
onClick: () => {
|
|
35
|
+
if (canNextPage)
|
|
36
|
+
onNextPage();
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { color: canNextPage ? ["brand-primary", "700"] : ["neutral", "500"] })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
DSPageNextButton.propTypes = DSPageNextButtonPropTypesSchema;
|
|
43
|
+
DSPageNextButton.displayName = PageNextButtonName;
|
|
44
|
+
const DSPageNextButtonWithSchema = describe(DSPageNextButton).description("Per Page Selector");
|
|
45
|
+
DSPageNextButtonWithSchema.propTypes = DSPageNextButtonPropTypesSchema;
|
|
46
|
+
export {
|
|
47
|
+
DSPageNextButton,
|
|
48
|
+
DSPageNextButtonWithSchema
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=DSPageNextButton.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSPageNextButton.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { omit } from 'lodash';\nimport { ChevronRight } from '@elliemae/ds-icons';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';\nimport { PreviousNextPageButton } from '../styled.js';\nimport { pageNextButtonDefaultProps, DSPageNextButtonPropTypesSchema } from '../react-desc-prop-types.js';\nimport { PageNextButtonName } from '../DSPaginationDefinitions.js';\nimport type { DSPaginationT } from '../react-desc-prop-types.js';\n\nexport const DSPageNextButton: React.ComponentType<DSPaginationT.PageNextButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.PageNextButtonInternalProps>(\n props,\n pageNextButtonDefaultProps,\n );\n useValidateTypescriptPropTypes(propsWithDefault, DSPageNextButtonPropTypesSchema, PageNextButtonName);\n\n const { canNextPage, onNextPage } = propsWithDefault;\n const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), 'shape', 'size', 'type');\n const xstyledAttributes = useGetXstyledProps(propsWithDefault);\n\n return (\n <PreviousNextPageButton\n disabled={!canNextPage}\n buttonType=\"raw\"\n data-testid={PAGINATION_DATA_TESTID.NEXT_BUTTON}\n aria-label=\"Go to next page\"\n {...globalAttributes}\n {...xstyledAttributes}\n onClick={() => {\n if (canNextPage) onNextPage();\n }}\n >\n <ChevronRight color={canNextPage ? ['brand-primary', '700'] : ['neutral', '500']} />\n </PreviousNextPageButton>\n );\n};\n\nDSPageNextButton.propTypes = DSPageNextButtonPropTypesSchema;\nDSPageNextButton.displayName = PageNextButtonName;\nexport const DSPageNextButtonWithSchema = describe(DSPageNextButton).description('Per Page Selector');\nDSPageNextButtonWithSchema.propTypes = DSPageNextButtonPropTypesSchema;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwCjB;AAtCN,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B,uCAAuC;AAC5E,SAAS,0BAA0B;AAG5B,MAAM,mBAA2E,CAAC,UAAU;AACjG,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,kBAAkB,iCAAiC,kBAAkB;AAEpG,QAAM,EAAE,aAAa,WAAW,IAAI;AACpC,QAAM,mBAAmB,KAAK,uBAAuB,gBAAgB,GAAG,SAAS,QAAQ,MAAM;AAC/F,QAAM,oBAAoB,mBAAmB,gBAAgB;AAE7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC;AAAA,MACX,YAAW;AAAA,MACX,eAAa,uBAAuB;AAAA,MACpC,cAAW;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,SAAS,MAAM;AACb,YAAI;AAAa,qBAAW;AAAA,MAC9B;AAAA,MAEA,8BAAC,gBAAa,OAAO,cAAc,CAAC,iBAAiB,KAAK,IAAI,CAAC,WAAW,KAAK,GAAG;AAAA;AAAA,EACpF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AACxB,MAAM,6BAA6B,SAAS,gBAAgB,EAAE,YAAY,mBAAmB;AACpG,2BAA2B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { omit } from "lodash";
|
|
4
|
+
import { ChevronLeft } from "@elliemae/ds-icons";
|
|
5
|
+
import { PAGINATION_DATA_TESTID } from "../PaginationDataTestID.js";
|
|
6
|
+
import { PreviousNextPageButton } from "../styled.js";
|
|
7
|
+
import { pagePrevButtonDefaultProps, DSPagePrevButtonPropTypesSchema } from "../react-desc-prop-types.js";
|
|
8
|
+
import {
|
|
9
|
+
describe,
|
|
10
|
+
useGetGlobalAttributes,
|
|
11
|
+
useGetXstyledProps,
|
|
12
|
+
useMemoMergePropsWithDefault,
|
|
13
|
+
useValidateTypescriptPropTypes
|
|
14
|
+
} from "@elliemae/ds-props-helpers";
|
|
15
|
+
import { PagePrevButtonName } from "../DSPaginationDefinitions.js";
|
|
16
|
+
const DSPagePrevButton = (props) => {
|
|
17
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
18
|
+
props,
|
|
19
|
+
pagePrevButtonDefaultProps
|
|
20
|
+
);
|
|
21
|
+
useValidateTypescriptPropTypes(propsWithDefault, DSPagePrevButtonPropTypesSchema, PagePrevButtonName);
|
|
22
|
+
const { canPreviousPage, onPreviousPage } = propsWithDefault;
|
|
23
|
+
const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), "shape", "size", "type");
|
|
24
|
+
const xstyledAttributes = useGetXstyledProps(propsWithDefault);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
PreviousNextPageButton,
|
|
27
|
+
{
|
|
28
|
+
disabled: !canPreviousPage,
|
|
29
|
+
buttonType: "raw",
|
|
30
|
+
"data-testid": PAGINATION_DATA_TESTID.PREVIOUS_BUTTON,
|
|
31
|
+
"aria-label": "Go to previous page",
|
|
32
|
+
...globalAttributes,
|
|
33
|
+
...xstyledAttributes,
|
|
34
|
+
onClick: () => {
|
|
35
|
+
if (canPreviousPage)
|
|
36
|
+
onPreviousPage();
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { color: canPreviousPage ? ["brand-primary", "700"] : ["neutral", "500"] })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
DSPagePrevButton.propTypes = DSPagePrevButtonPropTypesSchema;
|
|
43
|
+
DSPagePrevButton.displayName = PagePrevButtonName;
|
|
44
|
+
const DSPagePrevButtonWithSchema = describe(DSPagePrevButton).description("Per Page Selector");
|
|
45
|
+
DSPagePrevButtonWithSchema.propTypes = DSPagePrevButtonPropTypesSchema;
|
|
46
|
+
export {
|
|
47
|
+
DSPagePrevButton,
|
|
48
|
+
DSPagePrevButtonWithSchema
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=DSPagePrevButton.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSPagePrevButton.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { omit } from 'lodash';\nimport { ChevronLeft } from '@elliemae/ds-icons';\nimport { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';\nimport { PreviousNextPageButton } from '../styled.js';\nimport { pagePrevButtonDefaultProps, DSPagePrevButtonPropTypesSchema } from '../react-desc-prop-types.js';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { PagePrevButtonName } from '../DSPaginationDefinitions.js';\nimport type { DSPaginationT } from '../react-desc-prop-types.js';\n\nexport const DSPagePrevButton: React.ComponentType<DSPaginationT.PagePrevButtonProps> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSPaginationT.PagePrevButtonInternalProps>(\n props,\n pagePrevButtonDefaultProps,\n );\n useValidateTypescriptPropTypes(propsWithDefault, DSPagePrevButtonPropTypesSchema, PagePrevButtonName);\n\n const { canPreviousPage, onPreviousPage } = propsWithDefault;\n const globalAttributes = omit(useGetGlobalAttributes(propsWithDefault), 'shape', 'size', 'type');\n const xstyledAttributes = useGetXstyledProps(propsWithDefault);\n\n return (\n <PreviousNextPageButton\n disabled={!canPreviousPage}\n buttonType=\"raw\"\n data-testid={PAGINATION_DATA_TESTID.PREVIOUS_BUTTON}\n aria-label=\"Go to previous page\"\n {...globalAttributes}\n {...xstyledAttributes}\n onClick={() => {\n if (canPreviousPage) onPreviousPage();\n }}\n >\n <ChevronLeft color={canPreviousPage ? ['brand-primary', '700'] : ['neutral', '500']} />\n </PreviousNextPageButton>\n );\n};\n\nDSPagePrevButton.propTypes = DSPagePrevButtonPropTypesSchema;\nDSPagePrevButton.displayName = PagePrevButtonName;\nexport const DSPagePrevButtonWithSchema = describe(DSPagePrevButton).description('Per Page Selector');\nDSPagePrevButtonWithSchema.propTypes = DSPagePrevButtonPropTypesSchema;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwCjB;AAtCN,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B,uCAAuC;AAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAG5B,MAAM,mBAA2E,CAAC,UAAU;AACjG,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,kBAAkB,iCAAiC,kBAAkB;AAEpG,QAAM,EAAE,iBAAiB,eAAe,IAAI;AAC5C,QAAM,mBAAmB,KAAK,uBAAuB,gBAAgB,GAAG,SAAS,QAAQ,MAAM;AAC/F,QAAM,oBAAoB,mBAAmB,gBAAgB;AAE7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC;AAAA,MACX,YAAW;AAAA,MACX,eAAa,uBAAuB;AAAA,MACpC,cAAW;AAAA,MACV,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,SAAS,MAAM;AACb,YAAI;AAAiB,yBAAe;AAAA,MACtC;AAAA,MAEA,8BAAC,eAAY,OAAO,kBAAkB,CAAC,iBAAiB,KAAK,IAAI,CAAC,WAAW,KAAK,GAAG;AAAA;AAAA,EACvF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AACxB,MAAM,6BAA6B,SAAS,gBAAgB,EAAE,YAAY,mBAAmB;AACpG,2BAA2B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { omit } from "lodash";
|
|
4
|
+
import { describe, useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { PAGINATION_DATA_TESTID } from "../PaginationDataTestID.js";
|
|
6
|
+
import { StyledPaginationContainer, StyledPaginationWrapper } from "../styled.js";
|
|
7
|
+
import { DSPaginationContainerPropTypesSchema } from "../react-desc-prop-types.js";
|
|
8
|
+
import { PaginationContainerName } from "../DSPaginationDefinitions.js";
|
|
9
|
+
const DSPaginationContainer = (props) => {
|
|
10
|
+
const globalAttributes = omit(useGetGlobalAttributes(props), ["rows", "wrap"]);
|
|
11
|
+
const xstyledProps = useGetXstyledProps(props);
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
StyledPaginationContainer,
|
|
14
|
+
{
|
|
15
|
+
"data-testid": PAGINATION_DATA_TESTID.CONTAINER,
|
|
16
|
+
...globalAttributes,
|
|
17
|
+
...xstyledProps,
|
|
18
|
+
cols: ["minmax(auto, 80%)"],
|
|
19
|
+
children: /* @__PURE__ */ jsx(StyledPaginationWrapper, { children: props.children })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
DSPaginationContainer.propTypes = DSPaginationContainerPropTypesSchema;
|
|
24
|
+
DSPaginationContainer.displayName = PaginationContainerName;
|
|
25
|
+
const DSPaginationContainerWithSchema = describe(DSPaginationContainer).description("Per Page Selector");
|
|
26
|
+
DSPaginationContainerWithSchema.propTypes = DSPaginationContainerPropTypesSchema;
|
|
27
|
+
export {
|
|
28
|
+
DSPaginationContainer,
|
|
29
|
+
DSPaginationContainerWithSchema
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=DSPaginationContainer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSPaginationContainer.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash';\nimport { describe, useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { PAGINATION_DATA_TESTID } from '../PaginationDataTestID.js';\nimport { StyledPaginationContainer, StyledPaginationWrapper } from '../styled.js';\nimport { DSPaginationContainerPropTypesSchema } from '../react-desc-prop-types.js';\nimport { PaginationContainerName } from '../DSPaginationDefinitions.js';\nimport type { DSPaginationT } from '../react-desc-prop-types.js';\n\nexport const DSPaginationContainer: React.ComponentType<DSPaginationT.ContainerProps> = (props) => {\n const globalAttributes = omit(useGetGlobalAttributes(props), ['rows', 'wrap']);\n const xstyledProps = useGetXstyledProps(props);\n\n return (\n <StyledPaginationContainer\n data-testid={PAGINATION_DATA_TESTID.CONTAINER}\n {...globalAttributes}\n {...xstyledProps}\n cols={['minmax(auto, 80%)']}\n >\n <StyledPaginationWrapper>{props.children}</StyledPaginationWrapper>\n </StyledPaginationContainer>\n );\n};\n\nDSPaginationContainer.propTypes = DSPaginationContainerPropTypesSchema;\nDSPaginationContainer.displayName = PaginationContainerName;\nexport const DSPaginationContainerWithSchema = describe(DSPaginationContainer).description('Per Page Selector');\nDSPaginationContainerWithSchema.propTypes = DSPaginationContainerPropTypesSchema;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoBjB;AAnBN,SAAS,YAAY;AACrB,SAAS,UAAU,wBAAwB,0BAA0B;AACrE,SAAS,8BAA8B;AACvC,SAAS,2BAA2B,+BAA+B;AACnE,SAAS,4CAA4C;AACrD,SAAS,+BAA+B;AAGjC,MAAM,wBAA2E,CAAC,UAAU;AACjG,QAAM,mBAAmB,KAAK,uBAAuB,KAAK,GAAG,CAAC,QAAQ,MAAM,CAAC;AAC7E,QAAM,eAAe,mBAAmB,KAAK;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,uBAAuB;AAAA,MACnC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,MAAM,CAAC,mBAAmB;AAAA,MAE1B,8BAAC,2BAAyB,gBAAM,UAAS;AAAA;AAAA,EAC3C;AAEJ;AAEA,sBAAsB,YAAY;AAClC,sBAAsB,cAAc;AAC7B,MAAM,kCAAkC,SAAS,qBAAqB,EAAE,YAAY,mBAAmB;AAC9G,gCAAgC,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { DSPaginationSeparator } from "../../styled.js";
|
|
5
|
+
const createPaginatorHeader = ({ pageDetailsTitle, pageInfoWidth }) => {
|
|
6
|
+
const Comp = () => {
|
|
7
|
+
if (pageDetailsTitle === "")
|
|
8
|
+
return /* @__PURE__ */ jsx(Fragment, { children: "Page" });
|
|
9
|
+
return /* @__PURE__ */ jsxs(Grid, { cols: [`${pageInfoWidth + 50}px`, "8px", "auto"], children: [
|
|
10
|
+
/* @__PURE__ */ jsx("span", { style: { marginLeft: "8px" }, children: "Page" }),
|
|
11
|
+
/* @__PURE__ */ jsx(DSPaginationSeparator, { height: "100%" }),
|
|
12
|
+
/* @__PURE__ */ jsx("span", { children: pageDetailsTitle })
|
|
13
|
+
] });
|
|
14
|
+
};
|
|
15
|
+
return Comp;
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
createPaginatorHeader
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=createPaginatorHeader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/createPaginatorHeader.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSPaginationSeparator } from '../../styled.js';\n\ninterface PaginatorHeaderOptions {\n pageDetailsTitle: string;\n pageInfoWidth: number;\n}\n\nexport const createPaginatorHeader = ({ pageDetailsTitle, pageInfoWidth }: PaginatorHeaderOptions) => {\n const Comp = () => {\n if (pageDetailsTitle === '') return <>Page</>;\n\n return (\n <Grid cols={[`${pageInfoWidth + 50}px`, '8px', 'auto']}>\n <span style={{ marginLeft: '8px' }}>Page</span>\n <DSPaginationSeparator height=\"100%\" />\n <span>{pageDetailsTitle}</span>\n </Grid>\n );\n };\n return Comp;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACWiB,wBAGlC,YAHkC;AAVxC,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAO/B,MAAM,wBAAwB,CAAC,EAAE,kBAAkB,cAAc,MAA8B;AACpG,QAAM,OAAO,MAAM;AACjB,QAAI,qBAAqB;AAAI,aAAO,gCAAE,kBAAI;AAE1C,WACE,qBAAC,QAAK,MAAM,CAAC,GAAG,gBAAgB,QAAQ,OAAO,MAAM,GACnD;AAAA,0BAAC,UAAK,OAAO,EAAE,YAAY,MAAM,GAAG,kBAAI;AAAA,MACxC,oBAAC,yBAAsB,QAAO,QAAO;AAAA,MACrC,oBAAC,UAAM,4BAAiB;AAAA,OAC1B;AAAA,EAEJ;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { Checkmark } from "@elliemae/ds-icons";
|
|
5
|
+
const OptionWithDetails = (props) => {
|
|
6
|
+
const Comp = () => {
|
|
7
|
+
const { pageInfoWidth, pageIndex, index, pageDetails } = props;
|
|
8
|
+
return /* @__PURE__ */ jsxs(Grid, { cols: ["16px", `${pageInfoWidth + 16}px`, "auto"], gutter: "xxs", alignItems: "center", children: [
|
|
9
|
+
pageIndex - 1 === index ? /* @__PURE__ */ jsx(Checkmark, { size: "s", color: ["brand-primary", "600"] }) : /* @__PURE__ */ jsx("div", {}),
|
|
10
|
+
/* @__PURE__ */ jsx("span", { children: index + 1 }),
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
style: {
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
textOverflow: "ellipsis",
|
|
17
|
+
overflow: "hidden"
|
|
18
|
+
},
|
|
19
|
+
children: pageDetails[index]
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
return Comp;
|
|
25
|
+
};
|
|
26
|
+
const getOptions = (args) => {
|
|
27
|
+
const { pageCount, pageIndex, pageDetails, pageInfoWidth } = args;
|
|
28
|
+
const amountOfPages = typeof pageCount === "string" ? pageIndex + 1 : pageCount;
|
|
29
|
+
const options = new Array(amountOfPages).fill(0).map((_, index) => {
|
|
30
|
+
const option = {
|
|
31
|
+
dsId: (index + 1).toString(),
|
|
32
|
+
label: (index + 1).toString(),
|
|
33
|
+
value: index + 1,
|
|
34
|
+
type: "single"
|
|
35
|
+
};
|
|
36
|
+
if (pageDetails?.length) {
|
|
37
|
+
option.render = OptionWithDetails({ pageInfoWidth, pageIndex, index, pageDetails });
|
|
38
|
+
}
|
|
39
|
+
return option;
|
|
40
|
+
});
|
|
41
|
+
return options;
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
getOptions
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=getOptions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/getOptions.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { DSDropdownMenuT } from '@elliemae/ds-dropdownmenu';\n\ninterface OptionWithDetailsT {\n pageInfoWidth: number;\n pageIndex: number;\n index: number;\n pageDetails: string[];\n}\n\nconst OptionWithDetails = (props: OptionWithDetailsT) => {\n const Comp = () => {\n const { pageInfoWidth, pageIndex, index, pageDetails } = props;\n return (\n <Grid cols={['16px', `${pageInfoWidth + 16}px`, 'auto']} gutter=\"xxs\" alignItems=\"center\">\n {pageIndex - 1 === index ? <Checkmark size=\"s\" color={['brand-primary', '600']} /> : <div />}\n <span>{index + 1}</span>\n <span\n style={{\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n }}\n >\n {pageDetails[index]}\n </span>\n </Grid>\n );\n };\n return Comp;\n};\n\nexport const getOptions = (args: {\n pageCount: number | string;\n pageIndex: number;\n pageDetails: string[];\n pageInfoWidth: number;\n}): DSDropdownMenuT.ItemSingleOptions[] => {\n const { pageCount, pageIndex, pageDetails, pageInfoWidth } = args;\n\n const amountOfPages = typeof pageCount === 'string' ? pageIndex + 1 : pageCount;\n\n const options = new Array(amountOfPages).fill(0).map((_, index) => {\n const option: DSDropdownMenuT.ItemSingleOptions = {\n dsId: (index + 1).toString(),\n label: (index + 1).toString(),\n value: index + 1,\n type: 'single',\n };\n if (pageDetails?.length) {\n option.render = OptionWithDetails({ pageInfoWidth, pageIndex, index, pageDetails });\n }\n return option;\n });\n return options;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBjB,SAC6B,KAD7B;AAfN,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAU1B,MAAM,oBAAoB,CAAC,UAA8B;AACvD,QAAM,OAAO,MAAM;AACjB,UAAM,EAAE,eAAe,WAAW,OAAO,YAAY,IAAI;AACzD,WACE,qBAAC,QAAK,MAAM,CAAC,QAAQ,GAAG,gBAAgB,QAAQ,MAAM,GAAG,QAAO,OAAM,YAAW,UAC9E;AAAA,kBAAY,MAAM,QAAQ,oBAAC,aAAU,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAAK,oBAAC,SAAI;AAAA,MAC1F,oBAAC,UAAM,kBAAQ,GAAE;AAAA,MACjB;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,YAAY;AAAA,YACZ,cAAc;AAAA,YACd,UAAU;AAAA,UACZ;AAAA,UAEC,sBAAY,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
|
+
"names": []
|
|
7
|
+
}
|