@trackunit/react-components 0.0.205 → 0.0.207
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/index.js +11 -12
- package/package.json +2 -2
- package/src/components/Pagination/Pagination.d.ts +9 -14
package/index.js
CHANGED
|
@@ -1739,8 +1739,11 @@ const Popover = ({
|
|
|
1739
1739
|
return jsxs(Fragment, {
|
|
1740
1740
|
children: [cloneElement(children, getReferenceProps(Object.assign({
|
|
1741
1741
|
ref
|
|
1742
|
-
}, children.props))), jsx(FloatingPortal, {
|
|
1742
|
+
}, children.props))), jsx(FloatingPortal, Object.assign({
|
|
1743
|
+
id: "tu-floating-ui"
|
|
1744
|
+
}, {
|
|
1743
1745
|
children: open && jsx(FloatingFocusManager, Object.assign({
|
|
1746
|
+
guards: false,
|
|
1744
1747
|
context: context,
|
|
1745
1748
|
modal: false,
|
|
1746
1749
|
order: ["reference", "content"],
|
|
@@ -1763,7 +1766,7 @@ const Popover = ({
|
|
|
1763
1766
|
})
|
|
1764
1767
|
}))
|
|
1765
1768
|
}))
|
|
1766
|
-
})]
|
|
1769
|
+
}))]
|
|
1767
1770
|
});
|
|
1768
1771
|
};
|
|
1769
1772
|
// Utility to merge refs — Heavily inspired by https://github.com/gregberge/react-merge-refs
|
|
@@ -3051,13 +3054,11 @@ const Pagination = ({
|
|
|
3051
3054
|
canPreviousPage,
|
|
3052
3055
|
canNextPage,
|
|
3053
3056
|
loading,
|
|
3054
|
-
eventName,
|
|
3055
|
-
parentName,
|
|
3056
3057
|
className,
|
|
3057
3058
|
dataTestId,
|
|
3058
|
-
logPageChange,
|
|
3059
3059
|
getTranslatedCount,
|
|
3060
3060
|
getTranslatedPage,
|
|
3061
|
+
onPageChange,
|
|
3061
3062
|
cursorBase
|
|
3062
3063
|
}) => {
|
|
3063
3064
|
const [page, setPage] = React.useState(pageIndex);
|
|
@@ -3109,14 +3110,12 @@ const Pagination = ({
|
|
|
3109
3110
|
setPage(to);
|
|
3110
3111
|
setPageInputValue(String(to + 1));
|
|
3111
3112
|
}
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
to: to !== undefined ? to : "",
|
|
3117
|
-
action: description
|
|
3113
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange({
|
|
3114
|
+
from,
|
|
3115
|
+
to,
|
|
3116
|
+
description
|
|
3118
3117
|
});
|
|
3119
|
-
}, [page,
|
|
3118
|
+
}, [page, onPageChange, previousPage, nextPage, parsePageString, pageInputValue, gotoPage]);
|
|
3120
3119
|
const handleOnBlur = () => {
|
|
3121
3120
|
handlePageChange("manual");
|
|
3122
3121
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.207",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@trackunit/ui-icons": "0.0.54",
|
|
19
19
|
"react-browser-hooks": "2.2.4",
|
|
20
20
|
"react-useportal": "1.0.17",
|
|
21
|
-
"@floating-ui/react-dom-interactions": "0.
|
|
21
|
+
"@floating-ui/react-dom-interactions": "0.13.3",
|
|
22
22
|
"react-router-dom": "6.4.3",
|
|
23
23
|
"react-helmet": "6.1.0",
|
|
24
24
|
"react-select": "5.7.0",
|
|
@@ -28,14 +28,6 @@ export interface IPaginationProps {
|
|
|
28
28
|
* A flag to enable next page button
|
|
29
29
|
*/
|
|
30
30
|
canNextPage?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* A parent name
|
|
33
|
-
*/
|
|
34
|
-
parentName: string;
|
|
35
|
-
/**
|
|
36
|
-
* A event name used for logging
|
|
37
|
-
*/
|
|
38
|
-
eventName?: string;
|
|
39
31
|
/**
|
|
40
32
|
* A flag indicating loading state
|
|
41
33
|
*/
|
|
@@ -48,10 +40,6 @@ export interface IPaginationProps {
|
|
|
48
40
|
* A data test id
|
|
49
41
|
*/
|
|
50
42
|
dataTestId?: string;
|
|
51
|
-
/**
|
|
52
|
-
* You can attach logging handler for page change
|
|
53
|
-
*/
|
|
54
|
-
logPageChange?: (eventName: string, event: EventProperties) => void;
|
|
55
43
|
/**
|
|
56
44
|
* An helper to get translation for count.
|
|
57
45
|
*/
|
|
@@ -60,16 +48,23 @@ export interface IPaginationProps {
|
|
|
60
48
|
* An helper to get translation for page.
|
|
61
49
|
*/
|
|
62
50
|
getTranslatedPage: () => string;
|
|
51
|
+
/**
|
|
52
|
+
* Callback that fires on page change with details about the action
|
|
53
|
+
*/
|
|
54
|
+
onPageChange?: (change: {
|
|
55
|
+
from?: number;
|
|
56
|
+
to?: number;
|
|
57
|
+
description?: string;
|
|
58
|
+
}) => void;
|
|
63
59
|
/**
|
|
64
60
|
* An flag to disable jumping to particular page by text input, could be used for cursor based pagination
|
|
65
61
|
*/
|
|
66
62
|
cursorBase?: boolean;
|
|
67
63
|
}
|
|
68
|
-
export declare type EventProperties = Record<string, string | number | boolean | null | undefined | (string | number)[]>;
|
|
69
64
|
/**
|
|
70
65
|
* Pagination Description. It could be used when you need navigation for your paging feature.
|
|
71
66
|
*
|
|
72
67
|
* @param {IPaginationProps} props - The props for the Pagination component
|
|
73
68
|
* @returns {JSX.Element} Pagination component
|
|
74
69
|
*/
|
|
75
|
-
export declare const Pagination: ({ gotoPage, previousPage, nextPage, pageCount, pageIndex, canPreviousPage, canNextPage, loading,
|
|
70
|
+
export declare const Pagination: ({ gotoPage, previousPage, nextPage, pageCount, pageIndex, canPreviousPage, canNextPage, loading, className, dataTestId, getTranslatedCount, getTranslatedPage, onPageChange, cursorBase, }: IPaginationProps) => JSX.Element;
|