@availity/mui-table 0.3.1 → 0.3.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 CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.3.2](https://github.com/Availity/element/compare/@availity/mui-table@0.3.1...@availity/mui-table@0.3.2) (2025-02-06)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `mui-pagination` updated to version `0.3.1`
10
+
11
+ ### Bug Fixes
12
+
13
+ * enchance aria label generation for pagination ([17e7747](https://github.com/Availity/element/commit/17e77476fd71482f3ae78898a9d9886ccaf5d90f))
14
+
5
15
  ## [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
16
 
7
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-table",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Availity MUI Table Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@availity/mui-form-utils": "0.17.0",
45
45
  "@availity/mui-icon": "0.14.0",
46
- "@availity/mui-pagination": "0.4.0",
46
+ "@availity/mui-pagination": "0.4.1",
47
47
  "@availity/mui-utils": "0.2.0"
48
48
  },
49
49
  "devDependencies": {
@@ -1,6 +1,7 @@
1
1
  // Each exported component in the package should have its own stories file
2
-
2
+ import { useEffect, useState } from 'react';
3
3
  import type { Meta, StoryObj } from '@storybook/react';
4
+
4
5
  import { Table, TableFooter, TableRow, TablePagination, TablePaginationProps } from '..';
5
6
 
6
7
  const meta: Meta<typeof TablePagination> = {
@@ -26,19 +27,49 @@ const meta: Meta<typeof TablePagination> = {
26
27
  export default meta;
27
28
 
28
29
  export const _TablePagination: StoryObj<typeof TablePagination> = {
29
- render: (args: TablePaginationProps) => <TablePagination {...args} />,
30
+ render: (args: TablePaginationProps) => {
31
+ const [page, setPage] = useState(args.page);
32
+
33
+ useEffect(() => {
34
+ setPage(args.page);
35
+ }, [args.page]);
36
+
37
+ return (
38
+ <TablePagination
39
+ {...args}
40
+ page={page}
41
+ onPageChange={(event, page) => {
42
+ setPage(page);
43
+ }}
44
+ />
45
+ );
46
+ },
30
47
  };
31
48
 
32
49
  export const _AsPartOfTable: StoryObj<typeof TablePagination> = {
33
- render: (args: TablePaginationProps) => (
34
- <Table role="presentation">
35
- <TableFooter>
36
- <TableRow>
37
- <TablePagination {...args} />
38
- </TableRow>
39
- </TableFooter>
40
- </Table>
41
- ),
50
+ render: (args: TablePaginationProps) => {
51
+ const [page, setPage] = useState(args.page);
52
+
53
+ useEffect(() => {
54
+ setPage(args.page);
55
+ }, [args.page]);
56
+
57
+ return (
58
+ <Table role="presentation">
59
+ <TableFooter>
60
+ <TableRow>
61
+ <TablePagination
62
+ {...args}
63
+ page={page}
64
+ onPageChange={(event, page) => {
65
+ setPage(page);
66
+ }}
67
+ />
68
+ </TableRow>
69
+ </TableFooter>
70
+ </Table>
71
+ );
72
+ },
42
73
  args: {
43
74
  component: undefined,
44
75
  },