@gpa-gemstone/react-table 1.2.37 → 1.2.39
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.
|
@@ -64,7 +64,7 @@ interface TableProps<T> {
|
|
|
64
64
|
* @param data the item to be checked
|
|
65
65
|
* @returns true if the row should be styled as selected
|
|
66
66
|
*/
|
|
67
|
-
Selected?: (data: T) => boolean;
|
|
67
|
+
Selected?: (data: T, index: number) => boolean;
|
|
68
68
|
/**
|
|
69
69
|
*
|
|
70
70
|
* @param data he information of the row including the item of the row
|
|
@@ -61,7 +61,7 @@ function AdjustableTable(props) {
|
|
|
61
61
|
var setTableWidth = React.useCallback(_.debounce(function () { var _a, _b; setCurrentTableWidth((_b = (_a = tblref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0); }, 500), []);
|
|
62
62
|
React.useEffect(function () {
|
|
63
63
|
var element = tblref === null || tblref === void 0 ? void 0 : tblref.current;
|
|
64
|
-
if (
|
|
64
|
+
if (element == null)
|
|
65
65
|
return;
|
|
66
66
|
var observer = new ResizeObserver(function () {
|
|
67
67
|
setTableWidth();
|
|
@@ -175,7 +175,7 @@ function Rows(props) {
|
|
|
175
175
|
var style = (props.RowStyle !== undefined) ? __assign({}, props.RowStyle) : {};
|
|
176
176
|
if (style.cursor === undefined && (props.OnClick !== undefined || props.DragStart !== undefined))
|
|
177
177
|
style.cursor = 'pointer';
|
|
178
|
-
if (props.Selected !== undefined && props.Selected(d))
|
|
178
|
+
if (props.Selected !== undefined && props.Selected(d, i))
|
|
179
179
|
style.backgroundColor = 'yellow';
|
|
180
180
|
var key = props.KeySelector(d, i);
|
|
181
181
|
return React.createElement("tr", { key: key, style: __assign({ display: (props.FixedLayout ? 'block' : undefined) }, style) },
|
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.39",
|
|
4
4
|
"description": "Table for GPA web applications",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"typescript": "4.4.4"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@gpa-gemstone/gpa-symbols": "0.0.
|
|
46
|
-
"@gpa-gemstone/helper-functions": "0.0.
|
|
45
|
+
"@gpa-gemstone/gpa-symbols": "0.0.30",
|
|
46
|
+
"@gpa-gemstone/helper-functions": "0.0.29",
|
|
47
47
|
"@types/lodash": "^4.14.171",
|
|
48
48
|
"@types/react": "^17.0.14",
|
|
49
49
|
"lodash": "^4.17.21",
|