grep-components 1.20.0-grepf-1818.1 → 1.20.0-grepf-1816.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.
|
@@ -4,6 +4,7 @@ import { TableColumn } from '..';
|
|
|
4
4
|
interface Properties<T> extends TableSortLabelProps {
|
|
5
5
|
column: TableColumn<T>;
|
|
6
6
|
onSortBy?: (row: T) => void;
|
|
7
|
+
empty?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare type Component<T> = React.FunctionComponent<Properties<T>>;
|
|
9
10
|
export declare const TableHeaderCell: Component<any>;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import React__default, { useRef, useContext, createContext, createElement, Fragment, forwardRef, useMemo as useMemo$1, useState, useCallback as useCallback$1, useEffect, useLayoutEffect } from 'react';
|
|
8
8
|
import AccountCircle from '@mui/icons-material/AccountCircle';
|
|
9
9
|
import ArrowDropdown from '@mui/icons-material/ArrowDropDown';
|
|
10
|
-
import { Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemIcon, Divider,
|
|
10
|
+
import { Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemIcon, Divider, styled, TableCell, TableRow, TableSortLabel, TableHead, TablePagination, TableContainer, Table, TableBody, TableFooter, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, Grid, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
|
|
11
11
|
import { useTheme } from '@mui/material/styles';
|
|
12
12
|
import { useHistory, NavLink, Prompt } from 'react-router-dom';
|
|
13
13
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
@@ -3328,10 +3328,9 @@ var ContainedLinkList = function (props) {
|
|
|
3328
3328
|
var classes = useStyles$e().classes;
|
|
3329
3329
|
return (React.createElement(Box, { className: classes.container, style: props.style },
|
|
3330
3330
|
React.createElement(Typography, { className: classes.title }, props.title),
|
|
3331
|
-
React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, { divider: true, key: page.id,
|
|
3332
|
-
React.createElement(
|
|
3333
|
-
|
|
3334
|
-
React.createElement(ListItemText, { primary: page.label })))); }))));
|
|
3331
|
+
React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, { button: true, divider: true, key: page.id, onClick: function () { return props.onPageClick(page); } },
|
|
3332
|
+
page.linkIcon && React.createElement(ListItemIcon$1, null, page.linkIcon),
|
|
3333
|
+
React.createElement(ListItemText, { primary: page.label }))); }))));
|
|
3335
3334
|
};
|
|
3336
3335
|
|
|
3337
3336
|
var OverflowTooltip = /** @class */ (function (_super) {
|
|
@@ -3439,14 +3438,14 @@ var useTableHeaderStyles = makeStyles()(function (_theme, _a) {
|
|
|
3439
3438
|
});
|
|
3440
3439
|
|
|
3441
3440
|
var TableHeaderCell = function (_a) {
|
|
3442
|
-
var column = _a.column, onSortBy = _a.onSortBy, direction = _a.direction, active = _a.active, children = _a.children, props = __rest$1(_a, ["column", "onSortBy", "direction", "active", "children"]);
|
|
3441
|
+
var column = _a.column, onSortBy = _a.onSortBy, direction = _a.direction, active = _a.active, children = _a.children, _b = _a.empty, empty = _b === void 0 ? false : _b, props = __rest$1(_a, ["column", "onSortBy", "direction", "active", "children", "empty"]);
|
|
3443
3442
|
var classes = useTableHeaderStyles({ column: column }).classes;
|
|
3444
3443
|
var sortable = !!(onSortBy && column.sortable);
|
|
3445
|
-
if (sortable) {
|
|
3446
|
-
return (React__default.createElement(TableCell, __assign({ variant:
|
|
3444
|
+
if (sortable && !empty) {
|
|
3445
|
+
return (React__default.createElement(TableCell, __assign({ variant: empty ? 'body' : 'head', className: classes.th }, props),
|
|
3447
3446
|
React__default.createElement(TableSortLabel, { active: active, direction: direction }, children)));
|
|
3448
3447
|
}
|
|
3449
|
-
return (React__default.createElement(TableCell, __assign({ variant:
|
|
3448
|
+
return empty ? (React__default.createElement("td", { className: classes.th }, children)) : (React__default.createElement(TableCell, __assign({ variant: empty ? 'body' : 'head', className: classes.th }, props), children));
|
|
3450
3449
|
};
|
|
3451
3450
|
|
|
3452
3451
|
var TableHeader = function (_a) {
|
|
@@ -3458,7 +3457,7 @@ var TableHeader = function (_a) {
|
|
|
3458
3457
|
React__default.createElement(TableRow, null, headerColumns.map(function (column, index) {
|
|
3459
3458
|
var sortable = !!(onSortBy && column.sortable);
|
|
3460
3459
|
var label = column.label, colDef = column.colDef;
|
|
3461
|
-
return (React__default.createElement(TableHeaderCell, { key: index, column: column, direction: sortDirection, active: sortable ? sortBy === colDef : undefined, onClick: function () { return sortable && onSortBy(column); }, onKeyDown: onActivation(function (e) {
|
|
3460
|
+
return (React__default.createElement(TableHeaderCell, { key: index, empty: !label, column: column, direction: sortDirection, active: sortable ? sortBy === colDef : undefined, onClick: function () { return sortable && onSortBy(column); }, onKeyDown: onActivation(function (e) {
|
|
3462
3461
|
if (sortable) {
|
|
3463
3462
|
e.preventDefault();
|
|
3464
3463
|
onSortBy(column);
|