@availity/mui-table 0.2.10 → 0.3.1
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 +29 -0
- package/dist/index.js +12 -2
- package/dist/index.mjs +12 -2
- package/package.json +23 -15
- package/src/lib/TablePagination.tsx +18 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.3.1](https://github.com/Availity/element/compare/@availity/mui-table@0.3.0...@availity/mui-table@0.3.1) (2025-02-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-table:** update pagination types ([51f1071](https://github.com/Availity/element/commit/51f10718f3659b8414edf6fdcf23be16ff10f2ad))
|
|
11
|
+
|
|
12
|
+
## [0.3.0](https://github.com/Availity/element/compare/@availity/mui-table@0.2.10...@availity/mui-table@0.3.0) (2025-02-04)
|
|
13
|
+
|
|
14
|
+
### Dependency Updates
|
|
15
|
+
|
|
16
|
+
* `mui-button` updated to version `0.2.10`
|
|
17
|
+
* `mui-chip` updated to version `0.2.10`
|
|
18
|
+
* `mui-form-utils` updated to version `0.2.10`
|
|
19
|
+
* `mui-icon` updated to version `0.2.10`
|
|
20
|
+
* `mui-layout` updated to version `0.2.10`
|
|
21
|
+
* `mui-link` updated to version `0.2.10`
|
|
22
|
+
* `mui-menu` updated to version `0.2.10`
|
|
23
|
+
* `mui-paper` updated to version `0.2.10`
|
|
24
|
+
* `mui-textfield` updated to version `0.2.10`
|
|
25
|
+
* `mui-typography` updated to version `0.2.10`
|
|
26
|
+
* `mui-pagination` updated to version `0.2.10`
|
|
27
|
+
* `mui-utils` updated to version `0.2.10`
|
|
28
|
+
* `mui-transitions` updated to version `0.2.10`
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* configure package.json to allow esm to be used ([5a5393d](https://github.com/Availity/element/commit/5a5393de761f52608e714dd94a05106937dd95db))
|
|
33
|
+
|
|
5
34
|
## [0.2.10](https://github.com/Availity/element/compare/@availity/mui-table@0.2.9...@availity/mui-table@0.2.10) (2025-01-27)
|
|
6
35
|
|
|
7
36
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -133,7 +133,7 @@ var TablePagination = (0, import_react.forwardRef)((props, ref) => {
|
|
|
133
133
|
const _a = props, { Actions, paginationProps } = _a, rest = __objRest(_a, ["Actions", "paginationProps"]);
|
|
134
134
|
const [openDetected, setOpenDetected] = (0, import_react.useState)(false);
|
|
135
135
|
const ActionsPagination = (props2) => {
|
|
136
|
-
const _a2 = props2, { count, page, rowsPerPage, onPageChange, backIconButtonProps,
|
|
136
|
+
const _a2 = props2, { count, page, rowsPerPage, onPageChange, nextIconButtonProps, backIconButtonProps, slotProps } = _a2, rest2 = __objRest(_a2, ["count", "page", "rowsPerPage", "onPageChange", "nextIconButtonProps", "backIconButtonProps", "slotProps"]);
|
|
137
137
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
138
138
|
typeof count === "number" && count / rowsPerPage > 1 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
139
139
|
import_mui_pagination.Pagination,
|
|
@@ -148,7 +148,17 @@ var TablePagination = (0, import_react.forwardRef)((props, ref) => {
|
|
|
148
148
|
Actions || null
|
|
149
149
|
] });
|
|
150
150
|
};
|
|
151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
152
|
+
import_TablePagination.default,
|
|
153
|
+
__spreadProps(__spreadValues({
|
|
154
|
+
ActionsComponent: ActionsPagination
|
|
155
|
+
}, rest), {
|
|
156
|
+
slotProps: {
|
|
157
|
+
select: __spreadValues({ IconComponent }, (0, import_mui_form_utils.SelectAccessibilityOverrides)(openDetected, setOpenDetected))
|
|
158
|
+
},
|
|
159
|
+
ref
|
|
160
|
+
})
|
|
161
|
+
);
|
|
152
162
|
});
|
|
153
163
|
|
|
154
164
|
// src/lib/TableRow.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -98,7 +98,7 @@ var TablePagination = forwardRef((props, ref) => {
|
|
|
98
98
|
const _a = props, { Actions, paginationProps } = _a, rest = __objRest(_a, ["Actions", "paginationProps"]);
|
|
99
99
|
const [openDetected, setOpenDetected] = useState(false);
|
|
100
100
|
const ActionsPagination = (props2) => {
|
|
101
|
-
const _a2 = props2, { count, page, rowsPerPage, onPageChange, backIconButtonProps,
|
|
101
|
+
const _a2 = props2, { count, page, rowsPerPage, onPageChange, nextIconButtonProps, backIconButtonProps, slotProps } = _a2, rest2 = __objRest(_a2, ["count", "page", "rowsPerPage", "onPageChange", "nextIconButtonProps", "backIconButtonProps", "slotProps"]);
|
|
102
102
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
103
103
|
typeof count === "number" && count / rowsPerPage > 1 ? /* @__PURE__ */ jsx7(
|
|
104
104
|
Pagination,
|
|
@@ -113,7 +113,17 @@ var TablePagination = forwardRef((props, ref) => {
|
|
|
113
113
|
Actions || null
|
|
114
114
|
] });
|
|
115
115
|
};
|
|
116
|
-
return /* @__PURE__ */ jsx7(
|
|
116
|
+
return /* @__PURE__ */ jsx7(
|
|
117
|
+
MuiTablePagination,
|
|
118
|
+
__spreadProps(__spreadValues({
|
|
119
|
+
ActionsComponent: ActionsPagination
|
|
120
|
+
}, rest), {
|
|
121
|
+
slotProps: {
|
|
122
|
+
select: __spreadValues({ IconComponent }, SelectAccessibilityOverrides(openDetected, setOpenDetected))
|
|
123
|
+
},
|
|
124
|
+
ref
|
|
125
|
+
})
|
|
126
|
+
);
|
|
117
127
|
});
|
|
118
128
|
|
|
119
129
|
// src/lib/TableRow.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-table",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Availity MUI Table Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -23,6 +23,14 @@
|
|
|
23
23
|
"main": "./dist/index.js",
|
|
24
24
|
"module": "./dist/index.mjs",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.mjs",
|
|
31
|
+
"require": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
26
34
|
"scripts": {
|
|
27
35
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
28
36
|
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
@@ -33,22 +41,22 @@
|
|
|
33
41
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
34
42
|
},
|
|
35
43
|
"dependencies": {
|
|
36
|
-
"@availity/mui-form-utils": "0.
|
|
37
|
-
"@availity/mui-icon": "0.
|
|
38
|
-
"@availity/mui-pagination": "0.
|
|
39
|
-
"@availity/mui-utils": "0.
|
|
44
|
+
"@availity/mui-form-utils": "0.17.0",
|
|
45
|
+
"@availity/mui-icon": "0.14.0",
|
|
46
|
+
"@availity/mui-pagination": "0.4.0",
|
|
47
|
+
"@availity/mui-utils": "0.2.0"
|
|
40
48
|
},
|
|
41
49
|
"devDependencies": {
|
|
42
|
-
"@availity/mui-button": "0.
|
|
43
|
-
"@availity/mui-chip": "0.
|
|
44
|
-
"@availity/mui-form-utils": "0.
|
|
45
|
-
"@availity/mui-icon": "0.
|
|
46
|
-
"@availity/mui-layout": "0.
|
|
47
|
-
"@availity/mui-link": "0.
|
|
48
|
-
"@availity/mui-menu": "0.
|
|
49
|
-
"@availity/mui-paper": "0.
|
|
50
|
-
"@availity/mui-textfield": "0.
|
|
51
|
-
"@availity/mui-typography": "0.
|
|
50
|
+
"@availity/mui-button": "0.7.0",
|
|
51
|
+
"@availity/mui-chip": "0.3.0",
|
|
52
|
+
"@availity/mui-form-utils": "0.17.0",
|
|
53
|
+
"@availity/mui-icon": "0.14.0",
|
|
54
|
+
"@availity/mui-layout": "0.3.0",
|
|
55
|
+
"@availity/mui-link": "0.5.0",
|
|
56
|
+
"@availity/mui-menu": "0.3.0",
|
|
57
|
+
"@availity/mui-paper": "0.2.0",
|
|
58
|
+
"@availity/mui-textfield": "0.7.0",
|
|
59
|
+
"@availity/mui-typography": "0.3.0",
|
|
52
60
|
"@mui/material": "^5.15.15",
|
|
53
61
|
"react": "18.2.0",
|
|
54
62
|
"react-dom": "18.2.0",
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
default as MuiTablePagination,
|
|
4
4
|
TablePaginationProps as MuiTablePaginationProps,
|
|
5
5
|
} from '@mui/material/TablePagination';
|
|
6
|
+
import { TablePaginationActionsProps as MuiTablePaginationActionsProps } from '@mui/material/TablePagination/TablePaginationActions';
|
|
6
7
|
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
7
8
|
import { TableCellBaseProps } from '@mui/material/TableCell';
|
|
8
9
|
import { Pagination, PaginationProps } from '@availity/mui-pagination';
|
|
@@ -34,18 +35,21 @@ type TablePaginationActionsProps = {
|
|
|
34
35
|
page: number;
|
|
35
36
|
rowsPerPage: number;
|
|
36
37
|
onPageChange: (event: React.MouseEvent<HTMLButtonElement>, newPage: number) => void;
|
|
37
|
-
} &
|
|
38
|
+
} & MuiTablePaginationActionsProps;
|
|
38
39
|
|
|
39
40
|
const IconComponent = (args: SvgIconProps) => (
|
|
40
|
-
<TriangleExpandIcon fontSize=
|
|
41
|
+
<TriangleExpandIcon fontSize="xxsmall" sx={{ marginRight: '4px' }} {...args} />
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
export const TablePagination = forwardRef<unknown, TablePaginationProps>((props, ref) => {
|
|
44
45
|
const { Actions, paginationProps, ...rest } = props;
|
|
45
|
-
const [
|
|
46
|
+
const [openDetected, setOpenDetected] = useState(false);
|
|
46
47
|
|
|
47
48
|
const ActionsPagination = (props: TablePaginationActionsProps): JSX.Element => {
|
|
48
|
-
|
|
49
|
+
// Pull secondary props off so they are not passed to Pagination component
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
|
+
const { count, page, rowsPerPage, onPageChange, nextIconButtonProps, backIconButtonProps, slotProps, ...rest } =
|
|
52
|
+
props;
|
|
49
53
|
|
|
50
54
|
return (
|
|
51
55
|
<>
|
|
@@ -65,5 +69,14 @@ export const TablePagination = forwardRef<unknown, TablePaginationProps>((props,
|
|
|
65
69
|
);
|
|
66
70
|
};
|
|
67
71
|
|
|
68
|
-
return
|
|
72
|
+
return (
|
|
73
|
+
<MuiTablePagination
|
|
74
|
+
ActionsComponent={ActionsPagination}
|
|
75
|
+
{...rest}
|
|
76
|
+
slotProps={{
|
|
77
|
+
select: { IconComponent: IconComponent, ...SelectAccessibilityOverrides(openDetected, setOpenDetected) },
|
|
78
|
+
}}
|
|
79
|
+
ref={ref}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
69
82
|
});
|