@availity/mui-table 0.1.24 → 0.1.26

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,25 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.1.26](https://github.com/Availity/element/compare/@availity/mui-table@0.1.25...@availity/mui-table@0.1.26) (2024-10-25)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `mui-chip` updated to version `0.1.25`
10
+ * `mui-form-utils` updated to version `0.1.25`
11
+ * `mui-textfield` updated to version `0.1.25`
12
+ * `mui-pagination` updated to version `0.1.25`
13
+ ## [0.1.25](https://github.com/Availity/element/compare/@availity/mui-table@0.1.24...@availity/mui-table@0.1.25) (2024-10-18)
14
+
15
+ ### Dependency Updates
16
+
17
+ * `mui-form-utils` updated to version `0.1.24`
18
+ * `mui-textfield` updated to version `0.1.24`
19
+
20
+ ### Bug Fixes
21
+
22
+ * **mui-form-utils:** resolve aria-controls warnings ([487fe12](https://github.com/Availity/element/commit/487fe12229a2f1510f8e7ba76028f798896a1b20))
23
+
5
24
  ## [0.1.24](https://github.com/Availity/element/compare/@availity/mui-table@0.1.23...@availity/mui-table@0.1.24) (2024-10-15)
6
25
 
7
26
  ### Dependency Updates
package/dist/index.d.mts CHANGED
@@ -7,7 +7,7 @@ import { TableContainerProps as TableContainerProps$1 } from '@mui/material/Tabl
7
7
  import { TableFooterProps as TableFooterProps$1 } from '@mui/material/TableFooter';
8
8
  import { TableHeadProps as TableHeadProps$1 } from '@mui/material/TableHead';
9
9
  import { TablePaginationProps as TablePaginationProps$1 } from '@mui/material/TablePagination';
10
- import { PaginationProps as PaginationProps$1 } from '@mui/material/Pagination';
10
+ import { PaginationProps } from '@availity/mui-pagination';
11
11
  import { TableRowProps as TableRowProps$1 } from '@mui/material/TableRow';
12
12
  import { TableSortLabelProps as TableSortLabelProps$1 } from '@mui/material/TableSortLabel';
13
13
 
@@ -48,12 +48,6 @@ type TableHeadProps = {
48
48
  } & TableHeadProps$1;
49
49
  declare const TableHead: (props: TableHeadProps) => JSX.Element;
50
50
 
51
- type PaginationProps = {
52
- /** The size of the component
53
- * @default 'determined by theme' */
54
- size?: 'medium' | 'large';
55
- } & Omit<PaginationProps$1, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
56
-
57
51
  type TablePaginationProps = {
58
52
  Actions?: React.ReactNode;
59
53
  component?: ElementType<TableCellBaseProps>;
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { TableContainerProps as TableContainerProps$1 } from '@mui/material/Tabl
7
7
  import { TableFooterProps as TableFooterProps$1 } from '@mui/material/TableFooter';
8
8
  import { TableHeadProps as TableHeadProps$1 } from '@mui/material/TableHead';
9
9
  import { TablePaginationProps as TablePaginationProps$1 } from '@mui/material/TablePagination';
10
- import { PaginationProps as PaginationProps$1 } from '@mui/material/Pagination';
10
+ import { PaginationProps } from '@availity/mui-pagination';
11
11
  import { TableRowProps as TableRowProps$1 } from '@mui/material/TableRow';
12
12
  import { TableSortLabelProps as TableSortLabelProps$1 } from '@mui/material/TableSortLabel';
13
13
 
@@ -48,12 +48,6 @@ type TableHeadProps = {
48
48
  } & TableHeadProps$1;
49
49
  declare const TableHead: (props: TableHeadProps) => JSX.Element;
50
50
 
51
- type PaginationProps = {
52
- /** The size of the component
53
- * @default 'determined by theme' */
54
- size?: 'medium' | 'large';
55
- } & Omit<PaginationProps$1, 'color' | 'getItemAriaLabel' | 'renderItem' | 'shape' | 'size'>;
56
-
57
51
  type TablePaginationProps = {
58
52
  Actions?: React.ReactNode;
59
53
  component?: ElementType<TableCellBaseProps>;
package/dist/index.js CHANGED
@@ -117,52 +117,17 @@ var TableHead = (props) => {
117
117
  // src/lib/TablePagination.tsx
118
118
  var import_react = require("react");
119
119
  var import_TablePagination = __toESM(require("@mui/material/TablePagination"));
120
-
121
- // ../pagination/src/lib/Pagination.tsx
122
- var import_Pagination = __toESM(require("@mui/material/Pagination"));
123
-
124
- // ../pagination/src/lib/PaginationItem.tsx
125
- var import_PaginationItem = __toESM(require("@mui/material/PaginationItem"));
126
- var import_mui_icon = require("@availity/mui-icon");
120
+ var import_mui_pagination = require("@availity/mui-pagination");
121
+ var import_mui_form_utils = require("@availity/mui-form-utils");
127
122
  var import_jsx_runtime7 = require("react/jsx-runtime");
128
- var slots = {
129
- first: () => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
130
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_mui_icon.NavigatePreviousIcon, { sx: { mr: ".2rem" } }),
131
- " First"
132
- ] }),
133
- previous: () => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
134
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_mui_icon.NavigatePreviousIcon, { sx: { mr: ".2rem" } }),
135
- " Prev"
136
- ] }),
137
- next: () => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
138
- "Next ",
139
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_mui_icon.NavigateNextIcon, { sx: { ml: ".2rem" } })
140
- ] }),
141
- last: () => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
142
- "Last ",
143
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_mui_icon.NavigateNextIcon, { sx: { ml: ".2rem" } })
144
- ] })
145
- };
146
- var PaginationItem = (props) => {
147
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_PaginationItem.default, __spreadValues({ slots }, props));
148
- };
149
-
150
- // ../pagination/src/lib/Pagination.tsx
151
- var import_jsx_runtime8 = require("react/jsx-runtime");
152
- var Pagination = (_a) => {
153
- var rest = __objRest(_a, []);
154
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Pagination.default, __spreadProps(__spreadValues({}, rest), { renderItem: (item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaginationItem, __spreadValues({}, item)) }));
155
- };
156
-
157
- // src/lib/TablePagination.tsx
158
- var import_jsx_runtime9 = require("react/jsx-runtime");
159
123
  var TablePagination = (0, import_react.forwardRef)((props, ref) => {
160
124
  const _a = props, { Actions, paginationProps } = _a, rest = __objRest(_a, ["Actions", "paginationProps"]);
125
+ const [openDetected, setOpenDetected] = (0, import_react.useState)(false);
161
126
  const ActionsPagination = (props2) => {
162
127
  const _a2 = props2, { count, page, rowsPerPage, onPageChange, backIconButtonProps, nextIconButtonProps } = _a2, rest2 = __objRest(_a2, ["count", "page", "rowsPerPage", "onPageChange", "backIconButtonProps", "nextIconButtonProps"]);
163
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
164
- typeof count === "number" && count / rowsPerPage > 1 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
165
- Pagination,
128
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
129
+ typeof count === "number" && count / rowsPerPage > 1 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
130
+ import_mui_pagination.Pagination,
166
131
  __spreadProps(__spreadValues(__spreadValues({}, rest2), paginationProps), {
167
132
  count: Math.ceil(Math.abs(count / rowsPerPage)),
168
133
  page: page + 1,
@@ -174,14 +139,14 @@ var TablePagination = (0, import_react.forwardRef)((props, ref) => {
174
139
  Actions || null
175
140
  ] });
176
141
  };
177
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_TablePagination.default, __spreadProps(__spreadValues({ ActionsComponent: ActionsPagination }, rest), { ref }));
142
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_TablePagination.default, __spreadProps(__spreadValues({ ActionsComponent: ActionsPagination }, rest), { slotProps: { select: __spreadValues({}, (0, import_mui_form_utils.SelectAccessibilityOverrides)(openDetected, setOpenDetected)) }, ref }));
178
143
  });
179
144
 
180
145
  // src/lib/TableRow.tsx
181
146
  var import_TableRow = __toESM(require("@mui/material/TableRow"));
182
- var import_jsx_runtime10 = require("react/jsx-runtime");
147
+ var import_jsx_runtime8 = require("react/jsx-runtime");
183
148
  var TableRow = (props) => {
184
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_TableRow.default, __spreadValues({}, props));
149
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_TableRow.default, __spreadValues({}, props));
185
150
  };
186
151
 
187
152
  // src/lib/TableSortLabel.tsx
@@ -203,16 +168,16 @@ var visuallyHidden = {
203
168
  var visuallyHidden_default = visuallyHidden;
204
169
 
205
170
  // src/lib/TableSortLabel.tsx
206
- var import_mui_icon2 = require("@availity/mui-icon");
207
- var import_jsx_runtime11 = require("react/jsx-runtime");
171
+ var import_mui_icon = require("@availity/mui-icon");
172
+ var import_jsx_runtime9 = require("react/jsx-runtime");
208
173
  var TableSortLabel = (props) => {
209
- const IconComponent = props.active ? import_mui_icon2.SortDownIcon : import_mui_icon2.SortIcon;
210
- const SortedDescription = props.active ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Box.default, { component: "span", sx: visuallyHidden_default, children: props.direction === "desc" ? "sorted descending" : "sorted ascending" }) : null;
211
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
174
+ const IconComponent = props.active ? import_mui_icon.SortDownIcon : import_mui_icon.SortIcon;
175
+ const SortedDescription = props.active ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Box.default, { component: "span", sx: visuallyHidden_default, children: props.direction === "desc" ? "sorted descending" : "sorted ascending" }) : null;
176
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
212
177
  import_TableSortLabel.default,
213
178
  __spreadProps(__spreadValues({}, props), {
214
179
  IconComponent,
215
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
180
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
216
181
  props.children,
217
182
  " ",
218
183
  SortedDescription
package/dist/index.mjs CHANGED
@@ -78,57 +78,20 @@ var TableHead = (props) => {
78
78
  };
79
79
 
80
80
  // src/lib/TablePagination.tsx
81
- import { forwardRef } from "react";
81
+ import { forwardRef, useState } from "react";
82
82
  import {
83
83
  default as MuiTablePagination
84
84
  } from "@mui/material/TablePagination";
85
-
86
- // ../pagination/src/lib/Pagination.tsx
87
- import { default as MuiPagination } from "@mui/material/Pagination";
88
-
89
- // ../pagination/src/lib/PaginationItem.tsx
90
- import {
91
- default as MuiPaginationItem
92
- } from "@mui/material/PaginationItem";
93
- import { NavigateNextIcon, NavigatePreviousIcon } from "@availity/mui-icon";
85
+ import { Pagination } from "@availity/mui-pagination";
86
+ import { SelectAccessibilityOverrides } from "@availity/mui-form-utils";
94
87
  import { Fragment, jsx as jsx7, jsxs } from "react/jsx-runtime";
95
- var slots = {
96
- first: () => /* @__PURE__ */ jsxs(Fragment, { children: [
97
- /* @__PURE__ */ jsx7(NavigatePreviousIcon, { sx: { mr: ".2rem" } }),
98
- " First"
99
- ] }),
100
- previous: () => /* @__PURE__ */ jsxs(Fragment, { children: [
101
- /* @__PURE__ */ jsx7(NavigatePreviousIcon, { sx: { mr: ".2rem" } }),
102
- " Prev"
103
- ] }),
104
- next: () => /* @__PURE__ */ jsxs(Fragment, { children: [
105
- "Next ",
106
- /* @__PURE__ */ jsx7(NavigateNextIcon, { sx: { ml: ".2rem" } })
107
- ] }),
108
- last: () => /* @__PURE__ */ jsxs(Fragment, { children: [
109
- "Last ",
110
- /* @__PURE__ */ jsx7(NavigateNextIcon, { sx: { ml: ".2rem" } })
111
- ] })
112
- };
113
- var PaginationItem = (props) => {
114
- return /* @__PURE__ */ jsx7(MuiPaginationItem, __spreadValues({ slots }, props));
115
- };
116
-
117
- // ../pagination/src/lib/Pagination.tsx
118
- import { jsx as jsx8 } from "react/jsx-runtime";
119
- var Pagination = (_a) => {
120
- var rest = __objRest(_a, []);
121
- return /* @__PURE__ */ jsx8(MuiPagination, __spreadProps(__spreadValues({}, rest), { renderItem: (item) => /* @__PURE__ */ jsx8(PaginationItem, __spreadValues({}, item)) }));
122
- };
123
-
124
- // src/lib/TablePagination.tsx
125
- import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
126
88
  var TablePagination = forwardRef((props, ref) => {
127
89
  const _a = props, { Actions, paginationProps } = _a, rest = __objRest(_a, ["Actions", "paginationProps"]);
90
+ const [openDetected, setOpenDetected] = useState(false);
128
91
  const ActionsPagination = (props2) => {
129
92
  const _a2 = props2, { count, page, rowsPerPage, onPageChange, backIconButtonProps, nextIconButtonProps } = _a2, rest2 = __objRest(_a2, ["count", "page", "rowsPerPage", "onPageChange", "backIconButtonProps", "nextIconButtonProps"]);
130
- return /* @__PURE__ */ jsxs2(Fragment2, { children: [
131
- typeof count === "number" && count / rowsPerPage > 1 ? /* @__PURE__ */ jsx9(
93
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
94
+ typeof count === "number" && count / rowsPerPage > 1 ? /* @__PURE__ */ jsx7(
132
95
  Pagination,
133
96
  __spreadProps(__spreadValues(__spreadValues({}, rest2), paginationProps), {
134
97
  count: Math.ceil(Math.abs(count / rowsPerPage)),
@@ -141,14 +104,14 @@ var TablePagination = forwardRef((props, ref) => {
141
104
  Actions || null
142
105
  ] });
143
106
  };
144
- return /* @__PURE__ */ jsx9(MuiTablePagination, __spreadProps(__spreadValues({ ActionsComponent: ActionsPagination }, rest), { ref }));
107
+ return /* @__PURE__ */ jsx7(MuiTablePagination, __spreadProps(__spreadValues({ ActionsComponent: ActionsPagination }, rest), { slotProps: { select: __spreadValues({}, SelectAccessibilityOverrides(openDetected, setOpenDetected)) }, ref }));
145
108
  });
146
109
 
147
110
  // src/lib/TableRow.tsx
148
111
  import { default as MuiTableRow } from "@mui/material/TableRow";
149
- import { jsx as jsx10 } from "react/jsx-runtime";
112
+ import { jsx as jsx8 } from "react/jsx-runtime";
150
113
  var TableRow = (props) => {
151
- return /* @__PURE__ */ jsx10(MuiTableRow, __spreadValues({}, props));
114
+ return /* @__PURE__ */ jsx8(MuiTableRow, __spreadValues({}, props));
152
115
  };
153
116
 
154
117
  // src/lib/TableSortLabel.tsx
@@ -173,15 +136,15 @@ var visuallyHidden_default = visuallyHidden;
173
136
 
174
137
  // src/lib/TableSortLabel.tsx
175
138
  import { SortDownIcon, SortIcon } from "@availity/mui-icon";
176
- import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
139
+ import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
177
140
  var TableSortLabel = (props) => {
178
141
  const IconComponent = props.active ? SortDownIcon : SortIcon;
179
- const SortedDescription = props.active ? /* @__PURE__ */ jsx11(Box, { component: "span", sx: visuallyHidden_default, children: props.direction === "desc" ? "sorted descending" : "sorted ascending" }) : null;
180
- return /* @__PURE__ */ jsx11(
142
+ const SortedDescription = props.active ? /* @__PURE__ */ jsx9(Box, { component: "span", sx: visuallyHidden_default, children: props.direction === "desc" ? "sorted descending" : "sorted ascending" }) : null;
143
+ return /* @__PURE__ */ jsx9(
181
144
  MuiTableSortLabel,
182
145
  __spreadProps(__spreadValues({}, props), {
183
146
  IconComponent,
184
- children: /* @__PURE__ */ jsxs3(Fragment3, { children: [
147
+ children: /* @__PURE__ */ jsxs2(Fragment2, { children: [
185
148
  props.children,
186
149
  " ",
187
150
  SortedDescription
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-table",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Availity MUI Table Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -33,18 +33,20 @@
33
33
  "publish:canary": "yarn npm publish --access public --tag canary"
34
34
  },
35
35
  "dependencies": {
36
- "@availity/mui-icon": "0.10.1"
36
+ "@availity/mui-form-utils": "0.13.2",
37
+ "@availity/mui-icon": "0.10.1",
38
+ "@availity/mui-pagination": "0.3.3"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@availity/mui-button": "0.6.10",
40
- "@availity/mui-chip": "0.2.20",
41
- "@availity/mui-form-utils": "0.13.0",
42
+ "@availity/mui-chip": "0.2.21",
43
+ "@availity/mui-form-utils": "0.13.2",
42
44
  "@availity/mui-icon": "0.10.1",
43
45
  "@availity/mui-layout": "0.1.6",
44
46
  "@availity/mui-link": "0.4.3",
45
47
  "@availity/mui-menu": "0.2.10",
46
48
  "@availity/mui-paper": "0.1.9",
47
- "@availity/mui-textfield": "0.6.8",
49
+ "@availity/mui-textfield": "0.6.10",
48
50
  "@availity/mui-typography": "0.2.0",
49
51
  "@mui/material": "^5.15.15",
50
52
  "react": "18.2.0",
@@ -1,10 +1,11 @@
1
- import { ElementType, forwardRef } from 'react';
1
+ import { ElementType, forwardRef, useState } from 'react';
2
2
  import {
3
3
  default as MuiTablePagination,
4
4
  TablePaginationProps as MuiTablePaginationProps,
5
5
  } from '@mui/material/TablePagination';
6
6
  import { TableCellBaseProps } from '@mui/material/TableCell';
7
7
  import { Pagination, PaginationProps } from '@availity/mui-pagination';
8
+ import { SelectAccessibilityOverrides } from '@availity/mui-form-utils';
8
9
 
9
10
  export type TablePaginationProps = {
10
11
  Actions?: React.ReactNode;
@@ -35,6 +36,7 @@ type TablePaginationActionsProps = {
35
36
 
36
37
  export const TablePagination = forwardRef<unknown, TablePaginationProps>((props, ref) => {
37
38
  const { Actions, paginationProps, ...rest } = props;
39
+ const [ openDetected, setOpenDetected ] = useState(false);
38
40
 
39
41
  const ActionsPagination = (props: TablePaginationActionsProps): JSX.Element => {
40
42
  const { count, page, rowsPerPage, onPageChange, backIconButtonProps, nextIconButtonProps, ...rest } = props;
@@ -57,5 +59,5 @@ export const TablePagination = forwardRef<unknown, TablePaginationProps>((props,
57
59
  );
58
60
  };
59
61
 
60
- return <MuiTablePagination ActionsComponent={ActionsPagination} {...rest} ref={ref} />;
62
+ return <MuiTablePagination ActionsComponent={ActionsPagination} {...rest} slotProps={{select: {...SelectAccessibilityOverrides(openDetected, setOpenDetected)}}} ref={ref} />;
61
63
  });