umwd-components 0.1.767 → 0.1.769

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.
@@ -57,7 +57,6 @@ function EnhancedTable(props) {
57
57
  const target = e.target;
58
58
  if (target.checked) {
59
59
  const newSelected = data.map((n) => n.documentId);
60
- console.log("newSelected", newSelected);
61
60
  setSelected(newSelected);
62
61
  return;
63
62
  }
@@ -160,7 +159,7 @@ function EnhancedTable(props) {
160
159
  });
161
160
  }
162
161
  }, [order, orderBy, page, rowsPerPage, filters]);
163
- return (jsxs(Box, { sx: { width: "100%" }, children: [jsxs(Paper, { sx: { width: "100%", mb: 2 }, children: [jsx(EnhancedTableToolbar, { selected: selected, setSelected: setSelected, title: title, functions: functions, selectFunctions: selectFunctions, showFilters: showFilters, onToggleFilters: () => setShowFilters(!showFilters), hasFilterableColumns: hasFilterableColumns }), jsx(TableContainer, { children: jsxs(Table, { sx: { minWidth: 750 }, "aria-labelledby": "tableTitle", size: dense ? "small" : "medium", children: [jsx(EnhancedTableHead, { numSelected: selected.length, order: order, orderBy: orderBy, onSelectAllClick: handleSelectAllClick, onRequestSort: handleRequestSort, rowCount: data.length, headCells: headCells, withSelection: withSelection, withSubRows: !!subHeadCells }), jsxs(TableBody, { children: [showFilters && (jsx(EnhancedTableFilterRow, { headCells: headCells, filters: filters, onFilterChange: handleFilterChange, withSelection: withSelection, withSubRows: !!subHeadCells })), data.map((row, index) => (jsx(EnhancedTableRow, { row: row, headCells: headCells, subHeadCells: subHeadCells, withSelection: withSelection, isSelected: selected.includes(row.documentId), handleSelectClick: handleSelectClick, subTitle: subTitle }, row.documentId || index))), emptyRows > 0 && (jsx(TableRow, { style: {
162
+ return (jsxs(Box, { sx: { width: "100%" }, children: [jsxs(Paper, { sx: { width: "100%", mb: 2 }, children: [jsx(EnhancedTableToolbar, { selected: selected, setSelected: setSelected, title: title, functions: functions, selectFunctions: selectFunctions, showFilters: showFilters, onToggleFilters: () => setShowFilters(!showFilters), hasFilterableColumns: hasFilterableColumns }), jsx(TableContainer, { children: jsxs(Table, { sx: { minWidth: 750 }, "aria-labelledby": "tableTitle", size: dense ? "small" : "medium", children: [jsx(EnhancedTableHead, { numSelected: selected.length, order: order, orderBy: orderBy, onSelectAllClick: handleSelectAllClick, onRequestSort: handleRequestSort, rowCount: data.length, headCells: headCells, withSelection: withSelection, withSubRows: !!subHeadCells }), jsxs(TableBody, { children: [showFilters && (jsx(EnhancedTableFilterRow, { headCells: headCells, filters: filters, onFilterChange: handleFilterChange, withSelection: withSelection, withSubRows: !!subHeadCells })), data.map((row, index) => (jsx(EnhancedTableRow, { row: row, headCells: headCells, subHeadCells: subHeadCells, withSelection: withSelection, isSelected: selected.includes(row.documentId), handleSelectClick: handleSelectClick, subTitle: subTitle }, row.documentId || row.key || index))), emptyRows > 0 && (jsx(TableRow, { style: {
164
163
  height: (dense ? 33 : 53) * emptyRows,
165
164
  }, children: jsx(TableCell, { colSpan: headCells.length +
166
165
  (withSelection ? 1 : 0) +
@@ -23,11 +23,8 @@ function EnhancedTableRow(props, index) {
23
23
  const { row, headCells, subHeadCells, withSelection, isSelected, handleSelectClick, subTitle, } = props;
24
24
  const { subRows } = row;
25
25
  const [open, setOpen] = React.useState(false);
26
- const labelId = `enhanced-table-checkbox-${index}`;
27
26
  const colspan = headCells.length + (withSelection ? 1 : 0) + (subHeadCells ? 1 : 0);
28
- return (jsxs(Fragment, { children: [jsxs(TableRow, { sx: { "& > *": { borderBottom: "unset" } }, children: [withSelection && (jsx(TableCell, { padding: "checkbox", children: jsx(Checkbox, { color: "primary", checked: isSelected, inputProps: {
29
- "aria-labelledby": labelId,
30
- }, onClick: (event) => handleSelectClick && handleSelectClick(event, row.documentId) }) })), subRows && subHeadCells && (jsx(TableCell, { children: jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) }) })), headCells.map((cell, index) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: row[cell.id] }, cell.id + index)))] }), subRows && subHeadCells && (jsx(TableRow, { children: jsx(TableCell, { style: { paddingBottom: 0, paddingTop: 0 }, colSpan: colspan, children: jsx(Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: jsxs(Box, { sx: { margin: 1 }, children: [jsx(Typography, { variant: "h6", gutterBottom: true, component: "div", children: subTitle }), jsxs(Table, { size: "small", "aria-label": "purchases", children: [jsx(TableHead, { children: jsx(TableRow, { children: subHeadCells.map((cell) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: cell.label }, `${row.documentId}${cell.id}`))) }) }), jsx(TableBody, { children: subRows.map((subRow, index) => (jsx(TableRow, { children: subHeadCells.map((cell, index) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: subRow[cell.id] }, `${subRow.documentId}${index}`))) }, `${subRow.documentId}`))) })] })] }) }) }) }))] }));
27
+ return (jsxs(Fragment, { children: [jsxs(TableRow, { sx: { "& > *": { borderBottom: "unset" } }, children: [withSelection && (jsx(TableCell, { padding: "checkbox", children: jsx(Checkbox, { color: "primary", checked: isSelected, onClick: (event) => handleSelectClick && handleSelectClick(event, row.documentId) }) })), subRows && subHeadCells && (jsx(TableCell, { children: jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) }) })), headCells.map((cell, index) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: row[cell.id] }, cell.id + index)))] }), subRows && subHeadCells && (jsx(TableRow, { children: jsx(TableCell, { style: { paddingBottom: 0, paddingTop: 0 }, colSpan: colspan, children: jsx(Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: jsxs(Box, { sx: { margin: 1 }, children: [jsx(Typography, { variant: "h6", gutterBottom: true, component: "div", children: subTitle }), jsxs(Table, { size: "small", "aria-label": "purchases", children: [jsx(TableHead, { children: jsx(TableRow, { children: subHeadCells.map((cell) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: cell.label }, `${row.documentId}${cell.id}`))) }) }), jsx(TableBody, { children: subRows.map((subRow, index) => (jsx(TableRow, { children: subHeadCells.map((cell, index) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: subRow[cell.id] }, `${subRow.documentId}${subRow.key}${cell.id}${index}`))) }, `${subRow.documentId}-${subRow.key}-${index}`))) })] })] }) }) }) }))] }));
31
28
  }
32
29
 
33
30
  export { EnhancedTableRow as default };