grep-components 1.20.0-grepf-1808.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
|
@@ -3438,14 +3438,14 @@ var useTableHeaderStyles = makeStyles()(function (_theme, _a) {
|
|
|
3438
3438
|
});
|
|
3439
3439
|
|
|
3440
3440
|
var TableHeaderCell = function (_a) {
|
|
3441
|
-
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"]);
|
|
3442
3442
|
var classes = useTableHeaderStyles({ column: column }).classes;
|
|
3443
3443
|
var sortable = !!(onSortBy && column.sortable);
|
|
3444
|
-
if (sortable) {
|
|
3445
|
-
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),
|
|
3446
3446
|
React__default.createElement(TableSortLabel, { active: active, direction: direction }, children)));
|
|
3447
3447
|
}
|
|
3448
|
-
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));
|
|
3449
3449
|
};
|
|
3450
3450
|
|
|
3451
3451
|
var TableHeader = function (_a) {
|
|
@@ -3457,7 +3457,7 @@ var TableHeader = function (_a) {
|
|
|
3457
3457
|
React__default.createElement(TableRow, null, headerColumns.map(function (column, index) {
|
|
3458
3458
|
var sortable = !!(onSortBy && column.sortable);
|
|
3459
3459
|
var label = column.label, colDef = column.colDef;
|
|
3460
|
-
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) {
|
|
3461
3461
|
if (sortable) {
|
|
3462
3462
|
e.preventDefault();
|
|
3463
3463
|
onSortBy(column);
|
|
@@ -20872,6 +20872,7 @@ var AppBar = function (_a) {
|
|
|
20872
20872
|
var username = _a.username, currentPath = _a.currentPath, isProd = _a.isProd, appTitle = _a.appTitle, userMenuItems = _a.userMenuItems, menuItems = _a.menuItems, userRole = _a.userRole, colors = _a.colors;
|
|
20873
20873
|
var _b = __read(React.useState(null), 2), userMenuAnchor = _b[0], setUserMenuAnchor = _b[1];
|
|
20874
20874
|
var _handleIconButtonClick = function (event) {
|
|
20875
|
+
event.preventDefault();
|
|
20875
20876
|
setUserMenuAnchor(event.currentTarget);
|
|
20876
20877
|
};
|
|
20877
20878
|
var _handleCloseUserMenu = function () {
|
|
@@ -20883,24 +20884,6 @@ var AppBar = function (_a) {
|
|
|
20883
20884
|
: currentPath.includes(page.redirectUrl || '');
|
|
20884
20885
|
return (React.createElement(ToolbarMenuItem, { className: isActive ? 'active' : '', to: page.redirectUrl || '', key: page.name, tabIndex: 0 }, page === null || page === void 0 ? void 0 : page.translatedTextRef));
|
|
20885
20886
|
};
|
|
20886
|
-
var renderMenuItems = function () {
|
|
20887
|
-
var newItemList = [];
|
|
20888
|
-
userMenuItems.forEach(function (item, index) {
|
|
20889
|
-
newItemList.push(item);
|
|
20890
|
-
if (userMenuItems.length > index + 1) {
|
|
20891
|
-
newItemList.push({ isDivider: true, id: '', label: '' });
|
|
20892
|
-
}
|
|
20893
|
-
});
|
|
20894
|
-
return newItemList.map(function (i, index) {
|
|
20895
|
-
return i.isDivider ? (React.createElement(Divider$1, { key: index })) : (React.createElement(MenuItem$1, { key: i.id, onClick: function () {
|
|
20896
|
-
setUserMenuAnchor(null);
|
|
20897
|
-
i.action && i.action();
|
|
20898
|
-
} }, i.isAnchor ? (React.createElement("a", { style: {
|
|
20899
|
-
textDecoration: 'inherit',
|
|
20900
|
-
color: 'inherit',
|
|
20901
|
-
}, tabIndex: -1, rel: "noreferrer", href: i.href, onClick: i.onClick }, i.label)) : (i.label)));
|
|
20902
|
-
});
|
|
20903
|
-
};
|
|
20904
20887
|
return (React.createElement(Toolbar, null,
|
|
20905
20888
|
React.createElement(ToolbarFixer, null,
|
|
20906
20889
|
React.createElement(ToolbarInner, { colors: colors, role: "banner" },
|
|
@@ -20909,7 +20892,7 @@ var AppBar = function (_a) {
|
|
|
20909
20892
|
appTitle,
|
|
20910
20893
|
!isProd && (React.createElement(EnvironmentTitle, null, process.env.REACT_APP_HOST)))),
|
|
20911
20894
|
React.createElement(ToolbarRight, null,
|
|
20912
|
-
React.createElement(Button$1, {
|
|
20895
|
+
React.createElement(Button$1, { onClick: _handleIconButtonClick },
|
|
20913
20896
|
React.createElement(AccountCircle, { color: "primary", fontSize: "large" }),
|
|
20914
20897
|
React.createElement(UserContainer, null,
|
|
20915
20898
|
React.createElement(AccountName, null, username),
|
|
@@ -20921,7 +20904,17 @@ var AppBar = function (_a) {
|
|
|
20921
20904
|
}, transformOrigin: {
|
|
20922
20905
|
vertical: 'top',
|
|
20923
20906
|
horizontal: 'center',
|
|
20924
|
-
} },
|
|
20907
|
+
} }, userMenuItems.map(function (i, index) {
|
|
20908
|
+
return (React.createElement(Box, { key: i.id },
|
|
20909
|
+
React.createElement(MenuItem$1, { key: i.id, onClick: function () {
|
|
20910
|
+
setUserMenuAnchor(null);
|
|
20911
|
+
i.action && i.action();
|
|
20912
|
+
} }, i.isAnchor ? (React.createElement("a", { style: {
|
|
20913
|
+
textDecoration: 'inherit',
|
|
20914
|
+
color: 'inherit',
|
|
20915
|
+
}, rel: "noreferrer", href: i.href, onClick: i.onClick }, i.label)) : (i.label)),
|
|
20916
|
+
userMenuItems.length > index + 1 && React.createElement(Divider$1, null)));
|
|
20917
|
+
})))),
|
|
20925
20918
|
React.createElement(ToolbarMenu, { role: "navigation" },
|
|
20926
20919
|
React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),
|
|
20927
20920
|
React.createElement(MobileAppBar, { menuItems: menuItems, userMenuItems: userMenuItems, colors: colors }))));
|