@gpa-gemstone/react-table 1.2.11 → 1.2.14
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.
- package/lib/Table.d.ts +6 -1
- package/lib/Table.js +3 -2
- package/package.json +2 -2
package/lib/Table.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface TableProps<T> {
|
|
|
35
35
|
colKey: string;
|
|
36
36
|
colField?: keyof T;
|
|
37
37
|
ascending: boolean;
|
|
38
|
-
}): void;
|
|
38
|
+
}, event: any): void;
|
|
39
39
|
tableClass?: string;
|
|
40
40
|
tableStyle?: React.CSSProperties;
|
|
41
41
|
theadStyle?: React.CSSProperties;
|
|
@@ -45,6 +45,11 @@ export interface TableProps<T> {
|
|
|
45
45
|
selected?(data: T): boolean;
|
|
46
46
|
rowStyle?: React.CSSProperties;
|
|
47
47
|
keySelector?: (data: T) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Optional Element to display in the last row of the Table
|
|
50
|
+
* use this for displaying warnings when the Table content gets cut off
|
|
51
|
+
*/
|
|
52
|
+
lastRow?: string | React.ReactNode;
|
|
48
53
|
}
|
|
49
54
|
export default function Table<T>(props: TableProps<T>): JSX.Element;
|
|
50
55
|
interface IRowProps<T> {
|
package/lib/Table.js
CHANGED
|
@@ -39,10 +39,11 @@ var React = require("react");
|
|
|
39
39
|
function Table(props) {
|
|
40
40
|
return (React.createElement("table", { className: props.tableClass !== undefined ? props.tableClass : '', style: props.tableStyle },
|
|
41
41
|
React.createElement(Header, { Class: props.theadClass, Style: props.theadStyle, Cols: props.cols, SortKey: props.sortKey, Ascending: props.ascending, Click: function (d, e) { return handleSort(d, e); } }),
|
|
42
|
-
React.createElement(Rows, { Data: props.data, Cols: props.cols, RowStyle: props.rowStyle, BodyStyle: props.tbodyStyle, BodyClass: props.tbodyClass, Click: function (data, e) { return (props.onClick === undefined ? null : props.onClick(data, e)); }, Selected: props.selected, KeySelector: props.keySelector })
|
|
42
|
+
React.createElement(Rows, { Data: props.data, Cols: props.cols, RowStyle: props.rowStyle, BodyStyle: props.tbodyStyle, BodyClass: props.tbodyClass, Click: function (data, e) { return (props.onClick === undefined ? null : props.onClick(data, e)); }, Selected: props.selected, KeySelector: props.keySelector }),
|
|
43
|
+
props.lastRow !== undefined ? React.createElement("tr", { style: (props.rowStyle !== undefined) ? __assign({}, props.rowStyle) : {}, key: -1 }, props.lastRow) : null));
|
|
43
44
|
function handleSort(data, event) {
|
|
44
45
|
if (data.colKey !== null)
|
|
45
|
-
props.onSort(data);
|
|
46
|
+
props.onSort(data, event);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
exports.default = Table;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gpa-gemstone/react-table",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.14",
|
|
4
4
|
"description": "Table for GPA web applications",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typescript": "4.4.4"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@gpa-gemstone/gpa-symbols": "0.0.
|
|
48
|
+
"@gpa-gemstone/gpa-symbols": "0.0.20",
|
|
49
49
|
"@gpa-gemstone/helper-functions": "0.0.14",
|
|
50
50
|
"@types/lodash": "^4.14.171",
|
|
51
51
|
"@types/react": "^17.0.14",
|