@singularsystems/neo-react 1.1.3 → 1.1.4
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 { DataViewContext } from '../../React/DataView';
|
|
|
4
4
|
import { IButtonOptions } from '@singularsystems/neo-core/dist/Components/ButtonOptions';
|
|
5
5
|
import { ItemCallback } from '../PropTypes';
|
|
6
6
|
export type GridSection = "header" | "body" | "footer";
|
|
7
|
+
export type BorderType = "standard" | "borderless" | "bordered";
|
|
7
8
|
export declare class GridContextParams<T> {
|
|
8
9
|
currentItem: T;
|
|
9
10
|
section: GridSection;
|
|
@@ -53,18 +54,22 @@ export interface IGridProps<T> extends Omit<React.HTMLProps<HTMLTableElement>, "
|
|
|
53
54
|
initialSort?: keyof T | (keyof T)[];
|
|
54
55
|
initialSortAscending?: boolean | boolean[];
|
|
55
56
|
children: ItemCallback<T>;
|
|
57
|
+
/** @deprecated Use `borderType` instead. */
|
|
58
|
+
isBordered?: boolean;
|
|
59
|
+
/** @deprecated Use `borderType` instead. */
|
|
60
|
+
isBorderless?: boolean;
|
|
56
61
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
62
|
+
* Specifies the bootstrap border type. This can also be specified globally in Misc.Settings.grid.borderType.
|
|
63
|
+
* - Standard = Only horizontal borders.
|
|
64
|
+
* - Bordered = All borders.
|
|
65
|
+
* - Borderless = No borders.
|
|
59
66
|
*/
|
|
60
|
-
|
|
67
|
+
borderType?: BorderType;
|
|
61
68
|
/**
|
|
62
69
|
* When specified, every alternating row will receive a slightly darker background color.
|
|
63
70
|
* Note, this will not work correctly if your grid has child rows. See the neo react demo pages for a solution.
|
|
64
71
|
*/
|
|
65
72
|
isStriped?: boolean;
|
|
66
|
-
/** When specified, the table will have no cell borders, and the table will have no main border. */
|
|
67
|
-
isBorderless?: boolean;
|
|
68
73
|
/** When specified, a background color will be applied on a row if it is being hovered over. */
|
|
69
74
|
showHover?: boolean;
|
|
70
75
|
/** When specified, the table size will be reduced (by reducing the padding sizes in each cell by half). */
|
|
@@ -45,7 +45,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
45
45
|
};
|
|
46
46
|
Grid.prototype.render = function () {
|
|
47
47
|
var _this = this;
|
|
48
|
-
var _a = this.props, items = _a.items, showAddButton = _a.showAddButton, addButton = _a.addButton, filterPredicate = _a.filterPredicate, keyProperty = _a.keyProperty, allowSort = _a.allowSort, expandAll = _a.expandAll, collapseAll = _a.collapseAll, initialSort = _a.initialSort, initialSortAscending = _a.initialSortAscending, isBordered = _a.isBordered, isStriped = _a.isStriped,
|
|
48
|
+
var _a = this.props, items = _a.items, showAddButton = _a.showAddButton, addButton = _a.addButton, filterPredicate = _a.filterPredicate, keyProperty = _a.keyProperty, allowSort = _a.allowSort, expandAll = _a.expandAll, collapseAll = _a.collapseAll, initialSort = _a.initialSort, initialSortAscending = _a.initialSortAscending, isBordered = _a.isBordered, isBorderless = _a.isBorderless, isStriped = _a.isStriped, borderType = _a.borderType, showHover = _a.showHover, isSmallTable = _a.isSmallTable, footerContent = _a.footerContent, footerButtons = _a.footerButtons, stickyHeader = _a.stickyHeader, enableRowIndexes = _a.enableRowIndexes, children = _a.children, domProps = __rest(_a, ["items", "showAddButton", "addButton", "filterPredicate", "keyProperty", "allowSort", "expandAll", "collapseAll", "initialSort", "initialSortAscending", "isBordered", "isBorderless", "isStriped", "borderType", "showHover", "isSmallTable", "footerContent", "footerButtons", "stickyHeader", "enableRowIndexes", "children"]);
|
|
49
49
|
if (expandAll === true) {
|
|
50
50
|
this.gridContext.expandAll = true;
|
|
51
51
|
}
|
|
@@ -56,17 +56,28 @@ var Grid = /** @class */ (function (_super) {
|
|
|
56
56
|
this.gridContext.expandAll = undefined;
|
|
57
57
|
}
|
|
58
58
|
var className = Utils.joinWithSpaces(domProps.className, "table neo-grid");
|
|
59
|
-
|
|
60
|
-
if (
|
|
59
|
+
borderType !== null && borderType !== void 0 ? borderType : (borderType = Misc.Settings.grid.borderType);
|
|
60
|
+
if (borderType === undefined) {
|
|
61
|
+
var noBorders = isBorderless !== null && isBorderless !== void 0 ? isBorderless : Misc.Settings.grid.isBorderless;
|
|
62
|
+
if (noBorders) {
|
|
63
|
+
borderType = "borderless";
|
|
64
|
+
}
|
|
65
|
+
else if (isBordered !== null && isBordered !== void 0 ? isBordered : Misc.Settings.grid.isBordered) {
|
|
66
|
+
borderType = "bordered";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (borderType === "bordered") {
|
|
61
70
|
className += " table-bordered";
|
|
62
71
|
}
|
|
72
|
+
else if (borderType === "borderless") {
|
|
73
|
+
className += " table-borderless";
|
|
74
|
+
}
|
|
63
75
|
// apply striped styling
|
|
64
76
|
if (isStriped !== null && isStriped !== void 0 ? isStriped : Misc.Settings.grid.isStriped) {
|
|
65
77
|
className += " table-striped";
|
|
66
78
|
}
|
|
67
79
|
// apply borderless styling
|
|
68
80
|
if (isBorderless !== null && isBorderless !== void 0 ? isBorderless : Misc.Settings.grid.isBorderless) {
|
|
69
|
-
className += " table-borderless";
|
|
70
81
|
}
|
|
71
82
|
// apply hover styling
|
|
72
83
|
if (showHover !== null && showHover !== void 0 ? showHover : Misc.Settings.grid.showHover) {
|
|
@@ -17,7 +17,6 @@ export default abstract class RouteView extends React.Component<unknown> {
|
|
|
17
17
|
/**
|
|
18
18
|
* Creates the routes component after authentication and authorisation checks have been done.
|
|
19
19
|
* This can be used to override all routes to display pages like terms and conditions.
|
|
20
|
-
* To redirect to a route, return a react router <Redirect to= /> component.
|
|
21
20
|
*/
|
|
22
21
|
protected getAuthorisedComponent(route: Routing.IRoute, path: string): JSX.Element;
|
|
23
22
|
/**
|
|
@@ -52,7 +52,6 @@ var RouteView = /** @class */ (function (_super) {
|
|
|
52
52
|
/**
|
|
53
53
|
* Creates the routes component after authentication and authorisation checks have been done.
|
|
54
54
|
* This can be used to override all routes to display pages like terms and conditions.
|
|
55
|
-
* To redirect to a route, return a react router <Redirect to= /> component.
|
|
56
55
|
*/
|
|
57
56
|
RouteView.prototype.getAuthorisedComponent = function (route, path) {
|
|
58
57
|
return React.createElement(route.component, null);
|