tycho-components 0.7.12 → 0.7.13
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.
|
@@ -10,5 +10,5 @@ type Props = {
|
|
|
10
10
|
hiddenColumns?: string[];
|
|
11
11
|
filter?: [string, string];
|
|
12
12
|
};
|
|
13
|
-
export default function
|
|
13
|
+
export default function AppTableList({ columns, data, className, onClickRow, onMouseEnter, onMouseLeave, hiddenColumns, filter, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { ThemeProvider } from '@emotion/react';
|
|
4
|
+
import Table from '@mui/material/Table';
|
|
5
|
+
import TableBody from '@mui/material/TableBody';
|
|
6
|
+
import TableCell from '@mui/material/TableCell';
|
|
7
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
8
|
+
import TableHead from '@mui/material/TableHead';
|
|
9
|
+
import TableRow from '@mui/material/TableRow';
|
|
3
10
|
import { flexRender, getCoreRowModel, getFilteredRowModel, useReactTable, } from '@tanstack/react-table';
|
|
4
|
-
import { Table, ThemeProvider } from 'react-bootstrap';
|
|
5
11
|
import { tableTheme } from './AppTableTheme';
|
|
6
12
|
import './styles.scss';
|
|
7
13
|
import { useEffect } from 'react';
|
|
8
|
-
export default function
|
|
14
|
+
export default function AppTableList({ columns, data, className = '', onClickRow, onMouseEnter, onMouseLeave, hiddenColumns, filter, }) {
|
|
9
15
|
const columnVisibility = hiddenColumns?.reduce((acc, key) => {
|
|
10
16
|
acc[key] = false;
|
|
11
17
|
return acc;
|
|
@@ -33,7 +39,10 @@ export default function AppListTable({ columns, data, className = '', onClickRow
|
|
|
33
39
|
table.getColumn(filter[0])?.setFilterValue(undefined);
|
|
34
40
|
}
|
|
35
41
|
}, [filter]);
|
|
36
|
-
|
|
42
|
+
const tableClass = cx('ds-table', {
|
|
43
|
+
[className || '']: className || '',
|
|
44
|
+
});
|
|
45
|
+
return (_jsx(ThemeProvider, { theme: tableTheme, children: _jsx("div", { className: tableClass, children: _jsx(TableContainer, { children: _jsxs(Table, { children: [_jsx(TableHead, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => (_jsx(TableCell, { style: { width: header.getSize() }, children: header.isPlaceholder
|
|
37
46
|
? null
|
|
38
47
|
: flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), _jsx(TableBody, { children: table.getRowModel().rows.map((row) => (_jsx(TableRow, { onClick: () => handleClickRow(row), onMouseEnter: () => onMouseEnter?.(row), onMouseLeave: () => onMouseLeave?.(row), children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id))) })] }) }) }) }));
|
|
39
48
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { default as AppPicture } from "./AppPicture";
|
|
|
22
22
|
export { default as AppPlaceholder } from "./AppPlaceholder";
|
|
23
23
|
export { default as AppSelect } from "./AppSelect";
|
|
24
24
|
export { default as AppTable } from "./AppTable";
|
|
25
|
-
export { default as
|
|
25
|
+
export { default as AppTableList } from "./AppTable/AppTableList";
|
|
26
26
|
export { EMPTY_GRID_PAGE, EMPTY_PAGE } from "./AppTable/types/AppPage";
|
|
27
27
|
export type { AppPage } from "./AppTable/types/AppPage";
|
|
28
28
|
export { convertPageable, EMPTY_GRID_PAGEABLE, EMPTY_PAGEABLE, } from "./AppTable/types/AppPageable";
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export { default as AppPicture } from "./AppPicture";
|
|
|
17
17
|
export { default as AppPlaceholder } from "./AppPlaceholder";
|
|
18
18
|
export { default as AppSelect } from "./AppSelect";
|
|
19
19
|
export { default as AppTable } from "./AppTable";
|
|
20
|
-
export { default as
|
|
20
|
+
export { default as AppTableList } from "./AppTable/AppTableList";
|
|
21
21
|
export { EMPTY_GRID_PAGE, EMPTY_PAGE } from "./AppTable/types/AppPage";
|
|
22
22
|
export { convertPageable, EMPTY_GRID_PAGEABLE, EMPTY_PAGEABLE, } from "./AppTable/types/AppPageable";
|
|
23
23
|
export { default as AppToast } from "./AppToast";
|