@availity/mui-table 0.2.0 → 0.2.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 +7 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/lib/TableCell.test.tsx +2 -2
- package/src/lib/TableCell.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.2.1](https://github.com/Availity/element/compare/@availity/mui-table@0.2.0...@availity/mui-table@0.2.1) (2024-11-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-table:** replace placeholder dash ([fbed326](https://github.com/Availity/element/commit/fbed3260738275b1d17ff31005c7ea338cf0fe02))
|
|
11
|
+
|
|
5
12
|
## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-table@0.1.27...@availity/mui-table@0.2.0) (2024-11-20)
|
|
6
13
|
|
|
7
14
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var TableCell = (_a) => {
|
|
|
94
94
|
var _b = _a, { disableEmptyPlaceholder = false, children } = _b, props = __objRest(_b, ["disableEmptyPlaceholder", "children"]);
|
|
95
95
|
const isPlaceholderActive = !disableEmptyPlaceholder && !children;
|
|
96
96
|
const placeholder = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
97
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { "aria-hidden": true, children: "
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { "aria-hidden": true, children: "\u2014" }),
|
|
98
98
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: import_mui_utils.visuallyHidden, children: "No Data" })
|
|
99
99
|
] });
|
|
100
100
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_TableCell.default, __spreadProps(__spreadValues({}, props), { children: isPlaceholderActive ? placeholder : children }));
|
package/dist/index.mjs
CHANGED
|
@@ -55,7 +55,7 @@ var TableCell = (_a) => {
|
|
|
55
55
|
var _b = _a, { disableEmptyPlaceholder = false, children } = _b, props = __objRest(_b, ["disableEmptyPlaceholder", "children"]);
|
|
56
56
|
const isPlaceholderActive = !disableEmptyPlaceholder && !children;
|
|
57
57
|
const placeholder = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
-
/* @__PURE__ */ jsx3("div", { "aria-hidden": true, children: "
|
|
58
|
+
/* @__PURE__ */ jsx3("div", { "aria-hidden": true, children: "\u2014" }),
|
|
59
59
|
/* @__PURE__ */ jsx3("div", { style: visuallyHidden, children: "No Data" })
|
|
60
60
|
] });
|
|
61
61
|
return /* @__PURE__ */ jsx3(MuiTableCell, __spreadProps(__spreadValues({}, props), { children: isPlaceholderActive ? placeholder : children }));
|
package/package.json
CHANGED
|
@@ -8,12 +8,12 @@ describe('TableCell', () => {
|
|
|
8
8
|
});
|
|
9
9
|
test('should add placeholder to empty cell', () => {
|
|
10
10
|
const { getByText } = render(<TableCell></TableCell>);
|
|
11
|
-
expect(getByText('
|
|
11
|
+
expect(getByText('—')).toBeTruthy();
|
|
12
12
|
expect(getByText('No Data')).toBeTruthy();
|
|
13
13
|
});
|
|
14
14
|
test('shouldnt add placeholder to empty cell when disableEmptyPlaceholder is true', () => {
|
|
15
15
|
const { queryByText } = render(<TableCell disableEmptyPlaceholder></TableCell>);
|
|
16
|
-
expect(queryByText('
|
|
16
|
+
expect(queryByText('—')).toBeNull();
|
|
17
17
|
expect(queryByText('No Data')).toBeNull();
|
|
18
18
|
});
|
|
19
19
|
});
|
package/src/lib/TableCell.tsx
CHANGED
|
@@ -20,7 +20,7 @@ export type TableCellProps = {
|
|
|
20
20
|
|
|
21
21
|
export const TableCell = ({disableEmptyPlaceholder = false, children, ...props}: TableCellProps): JSX.Element => {
|
|
22
22
|
const isPlaceholderActive = !disableEmptyPlaceholder && !children;
|
|
23
|
-
const placeholder = <><div aria-hidden
|
|
23
|
+
const placeholder = <><div aria-hidden>—</div><div style={visuallyHidden}>No Data</div></>;
|
|
24
24
|
|
|
25
25
|
return <MuiTableCell {...props}>{isPlaceholderActive ? placeholder : children}</MuiTableCell>;
|
|
26
26
|
};
|