@availity/mui-pagination 0.4.0 → 0.4.2
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/CHANGELOG.md +14 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -15
- package/dist/index.mjs +7 -15
- package/package.json +8 -1
- package/src/lib/Pagination.tsx +9 -2
- package/src/lib/ResourcePagination.tsx +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.4.2](https://github.com/Availity/element/compare/@availity/mui-pagination@0.4.1...@availity/mui-pagination@0.4.2) (2025-02-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-pagination:** add react-query peer dependency ([39ae736](https://github.com/Availity/element/commit/39ae736a8a9a2a9529691f4edb841f2c774262c7))
|
|
11
|
+
|
|
12
|
+
## [0.4.1](https://github.com/Availity/element/compare/@availity/mui-pagination@0.4.0...@availity/mui-pagination@0.4.1) (2025-02-06)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* enchance aria label generation for pagination ([17e7747](https://github.com/Availity/element/commit/17e77476fd71482f3ae78898a9d9886ccaf5d90f))
|
|
18
|
+
|
|
5
19
|
## [0.4.0](https://github.com/Availity/element/compare/@availity/mui-pagination@0.3.13...@availity/mui-pagination@0.4.0) (2025-02-04)
|
|
6
20
|
|
|
7
21
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ type PaginationProps = {
|
|
|
6
6
|
* @default 'determined by theme' */
|
|
7
7
|
size?: 'medium' | 'large';
|
|
8
8
|
} & Omit<PaginationProps$1, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
|
|
9
|
-
declare const Pagination: (
|
|
9
|
+
declare const Pagination: (props: PaginationProps) => JSX.Element;
|
|
10
10
|
|
|
11
11
|
type PaginationItemProps = Omit<PaginationItemProps$1, 'components' | 'color' | 'shape' | 'size'>;
|
|
12
12
|
declare const PaginationItem: (props: PaginationItemProps) => JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type PaginationProps = {
|
|
|
6
6
|
* @default 'determined by theme' */
|
|
7
7
|
size?: 'medium' | 'large';
|
|
8
8
|
} & Omit<PaginationProps$1, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
|
|
9
|
-
declare const Pagination: (
|
|
9
|
+
declare const Pagination: (props: PaginationProps) => JSX.Element;
|
|
10
10
|
|
|
11
11
|
type PaginationItemProps = Omit<PaginationItemProps$1, 'components' | 'color' | 'shape' | 'size'>;
|
|
12
12
|
declare const PaginationItem: (props: PaginationItemProps) => JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -22,18 +22,6 @@ var __spreadValues = (a, b) => {
|
|
|
22
22
|
return a;
|
|
23
23
|
};
|
|
24
24
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
25
|
var __export = (target, all) => {
|
|
38
26
|
for (var name in all)
|
|
39
27
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -95,9 +83,13 @@ var PaginationItem = (props) => {
|
|
|
95
83
|
|
|
96
84
|
// src/lib/Pagination.tsx
|
|
97
85
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
var getItemAriaLabel = (type, page) => {
|
|
87
|
+
if (type === "page")
|
|
88
|
+
return `Go to page ${page}`;
|
|
89
|
+
return `Go to ${type} page`;
|
|
90
|
+
};
|
|
91
|
+
var Pagination = (props) => {
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Pagination.default, __spreadProps(__spreadValues({}, props), { getItemAriaLabel, renderItem: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaginationItem, __spreadValues({}, item)) }));
|
|
101
93
|
};
|
|
102
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
103
95
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -17,18 +17,6 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
20
|
|
|
33
21
|
// src/lib/Pagination.tsx
|
|
34
22
|
import { default as MuiPagination } from "@mui/material/Pagination";
|
|
@@ -63,9 +51,13 @@ var PaginationItem = (props) => {
|
|
|
63
51
|
|
|
64
52
|
// src/lib/Pagination.tsx
|
|
65
53
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
var getItemAriaLabel = (type, page) => {
|
|
55
|
+
if (type === "page")
|
|
56
|
+
return `Go to page ${page}`;
|
|
57
|
+
return `Go to ${type} page`;
|
|
58
|
+
};
|
|
59
|
+
var Pagination = (props) => {
|
|
60
|
+
return /* @__PURE__ */ jsx2(MuiPagination, __spreadProps(__spreadValues({}, props), { getItemAriaLabel, renderItem: (item) => /* @__PURE__ */ jsx2(PaginationItem, __spreadValues({}, item)) }));
|
|
69
61
|
};
|
|
70
62
|
export {
|
|
71
63
|
Pagination,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-pagination",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Availity MUI Pagination Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@availity/mui-icon": "0.14.0",
|
|
44
44
|
"@mui/material": "^5.15.15",
|
|
45
|
+
"@tanstack/react-query": "^4.36.1",
|
|
45
46
|
"react": "18.2.0",
|
|
46
47
|
"react-dom": "18.2.0",
|
|
47
48
|
"tsup": "^8.0.2",
|
|
@@ -50,8 +51,14 @@
|
|
|
50
51
|
"peerDependencies": {
|
|
51
52
|
"@availity/mui-icon": "0.14.0",
|
|
52
53
|
"@mui/material": "^5.11.9",
|
|
54
|
+
"@tanstack/react-query": "^4.36.1",
|
|
53
55
|
"react": ">=16.3.0"
|
|
54
56
|
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"@tanstack/react-query": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
55
62
|
"publishConfig": {
|
|
56
63
|
"access": "public"
|
|
57
64
|
}
|
package/src/lib/Pagination.tsx
CHANGED
|
@@ -7,6 +7,13 @@ export type PaginationProps = {
|
|
|
7
7
|
size?: 'medium' | 'large';
|
|
8
8
|
} & Omit<MuiPaginationProps, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const getItemAriaLabel: MuiPaginationProps['getItemAriaLabel'] = (type, page) => {
|
|
11
|
+
if (type === 'page') return `Go to page ${page}`;
|
|
12
|
+
return `Go to ${type} page`;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Pagination = (props: PaginationProps): JSX.Element => {
|
|
16
|
+
return (
|
|
17
|
+
<MuiPagination {...props} getItemAriaLabel={getItemAriaLabel} renderItem={(item) => <PaginationItem {...item} />} />
|
|
18
|
+
);
|
|
12
19
|
};
|