@gpa-gemstone/react-table 1.2.44 → 1.2.46
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/AdjustableTable/AdjustableColumn.d.ts +20 -20
- package/lib/AdjustableTable/AdjustableColumn.js +99 -100
- package/lib/AdjustableTable/AdjustableTable.d.ts +102 -102
- package/lib/AdjustableTable/AdjustableTable.js +273 -273
- package/lib/AdjustableTable/Column.d.ts +67 -67
- package/lib/AdjustableTable/Column.js +124 -125
- package/lib/DynamicTable.d.ts +37 -37
- package/lib/DynamicTable.js +45 -46
- package/lib/Paging.d.ts +6 -7
- package/lib/Paging.js +66 -66
- package/lib/SearchableTable.d.ts +15 -16
- package/lib/SearchableTable.js +51 -52
- package/lib/SelectTable.d.ts +19 -19
- package/lib/SelectTable.js +121 -122
- package/lib/Table.d.ts +99 -99
- package/lib/Table.js +105 -106
- package/lib/index.d.ts +15 -15
- package/lib/index.js +47 -47
- package/package.json +6 -6
package/lib/Table.d.ts
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface Column<T> {
|
|
3
|
-
key: string;
|
|
4
|
-
label: string | React.ReactNode;
|
|
5
|
-
field?: keyof T;
|
|
6
|
-
headerStyle?: React.CSSProperties;
|
|
7
|
-
rowStyle?: React.CSSProperties;
|
|
8
|
-
content?(item: T, key: string, field: keyof T | undefined, style: React.CSSProperties, index: number): React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export interface TableProps<T> {
|
|
11
|
-
/**
|
|
12
|
-
* List of Collumns in this Table
|
|
13
|
-
*/
|
|
14
|
-
cols: Column<T>[];
|
|
15
|
-
/**
|
|
16
|
-
* List of T objects used to generate rows
|
|
17
|
-
*/
|
|
18
|
-
data: T[];
|
|
19
|
-
onClick?: (data: {
|
|
20
|
-
colKey: string;
|
|
21
|
-
colField?: keyof T;
|
|
22
|
-
row: T;
|
|
23
|
-
data: T[keyof T] | null;
|
|
24
|
-
index: number;
|
|
25
|
-
}, event: any) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Key of the collumn to sort by
|
|
28
|
-
*/
|
|
29
|
-
sortKey: string;
|
|
30
|
-
/**
|
|
31
|
-
* Boolen to indicate whether the sort is ascending or descending
|
|
32
|
-
*/
|
|
33
|
-
ascending: boolean;
|
|
34
|
-
onSort(data: {
|
|
35
|
-
colKey: string;
|
|
36
|
-
colField?: keyof T;
|
|
37
|
-
ascending: boolean;
|
|
38
|
-
}, event: any): void;
|
|
39
|
-
tableClass?: string;
|
|
40
|
-
tableStyle?: React.CSSProperties;
|
|
41
|
-
theadStyle?: React.CSSProperties;
|
|
42
|
-
theadClass?: string;
|
|
43
|
-
tbodyStyle?: React.CSSProperties;
|
|
44
|
-
tbodyClass?: string;
|
|
45
|
-
selected?(data: T): boolean;
|
|
46
|
-
onDragStart?: ((data: {
|
|
47
|
-
colKey: string;
|
|
48
|
-
colField?: keyof T;
|
|
49
|
-
row: T;
|
|
50
|
-
data: T[keyof T] | null;
|
|
51
|
-
index: number;
|
|
52
|
-
}, e: any) => void);
|
|
53
|
-
rowStyle?: React.CSSProperties;
|
|
54
|
-
keySelector?: (data: T) => string;
|
|
55
|
-
/**
|
|
56
|
-
* Optional Element to display in the last row of the Table
|
|
57
|
-
* use this for displaying warnings when the Table content gets cut off
|
|
58
|
-
*/
|
|
59
|
-
lastRow?: string | React.ReactNode;
|
|
60
|
-
}
|
|
61
|
-
export default function Table<T>(props: TableProps<T>): JSX.Element;
|
|
62
|
-
interface IRowProps<T> {
|
|
63
|
-
Data: T[];
|
|
64
|
-
Cols: Column<T>[];
|
|
65
|
-
RowStyle?: React.CSSProperties;
|
|
66
|
-
BodyStyle?: React.CSSProperties;
|
|
67
|
-
BodyClass?: string;
|
|
68
|
-
Click: (data: {
|
|
69
|
-
colKey: string;
|
|
70
|
-
colField?: keyof T;
|
|
71
|
-
row: T;
|
|
72
|
-
data: T[keyof T] | null;
|
|
73
|
-
index: number;
|
|
74
|
-
}, e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
75
|
-
DragStart?: ((data: {
|
|
76
|
-
colKey: string;
|
|
77
|
-
colField?: keyof T;
|
|
78
|
-
row: T;
|
|
79
|
-
data: T[keyof T] | null;
|
|
80
|
-
index: number;
|
|
81
|
-
}, e: any) => void);
|
|
82
|
-
Selected?: ((data: T) => boolean);
|
|
83
|
-
KeySelector?: (data: T) => string;
|
|
84
|
-
}
|
|
85
|
-
export declare function Rows<T>(props: IRowProps<T>): JSX.Element | null;
|
|
86
|
-
interface IHeaderProps<T> {
|
|
87
|
-
Class?: string;
|
|
88
|
-
Style?: React.CSSProperties;
|
|
89
|
-
Cols: Column<T>[];
|
|
90
|
-
SortKey: string;
|
|
91
|
-
Ascending: boolean;
|
|
92
|
-
Click: (data: {
|
|
93
|
-
colKey: string;
|
|
94
|
-
colField?: keyof T;
|
|
95
|
-
ascending: boolean;
|
|
96
|
-
}, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
97
|
-
}
|
|
98
|
-
export declare function Header<T>(props: IHeaderProps<T>): JSX.Element;
|
|
99
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface Column<T> {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string | React.ReactNode;
|
|
5
|
+
field?: keyof T;
|
|
6
|
+
headerStyle?: React.CSSProperties;
|
|
7
|
+
rowStyle?: React.CSSProperties;
|
|
8
|
+
content?(item: T, key: string, field: keyof T | undefined, style: React.CSSProperties, index: number): React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface TableProps<T> {
|
|
11
|
+
/**
|
|
12
|
+
* List of Collumns in this Table
|
|
13
|
+
*/
|
|
14
|
+
cols: Column<T>[];
|
|
15
|
+
/**
|
|
16
|
+
* List of T objects used to generate rows
|
|
17
|
+
*/
|
|
18
|
+
data: T[];
|
|
19
|
+
onClick?: (data: {
|
|
20
|
+
colKey: string;
|
|
21
|
+
colField?: keyof T;
|
|
22
|
+
row: T;
|
|
23
|
+
data: T[keyof T] | null;
|
|
24
|
+
index: number;
|
|
25
|
+
}, event: any) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Key of the collumn to sort by
|
|
28
|
+
*/
|
|
29
|
+
sortKey: string;
|
|
30
|
+
/**
|
|
31
|
+
* Boolen to indicate whether the sort is ascending or descending
|
|
32
|
+
*/
|
|
33
|
+
ascending: boolean;
|
|
34
|
+
onSort(data: {
|
|
35
|
+
colKey: string;
|
|
36
|
+
colField?: keyof T;
|
|
37
|
+
ascending: boolean;
|
|
38
|
+
}, event: any): void;
|
|
39
|
+
tableClass?: string;
|
|
40
|
+
tableStyle?: React.CSSProperties;
|
|
41
|
+
theadStyle?: React.CSSProperties;
|
|
42
|
+
theadClass?: string;
|
|
43
|
+
tbodyStyle?: React.CSSProperties;
|
|
44
|
+
tbodyClass?: string;
|
|
45
|
+
selected?(data: T): boolean;
|
|
46
|
+
onDragStart?: ((data: {
|
|
47
|
+
colKey: string;
|
|
48
|
+
colField?: keyof T;
|
|
49
|
+
row: T;
|
|
50
|
+
data: T[keyof T] | null;
|
|
51
|
+
index: number;
|
|
52
|
+
}, e: any) => void);
|
|
53
|
+
rowStyle?: React.CSSProperties;
|
|
54
|
+
keySelector?: (data: T) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Optional Element to display in the last row of the Table
|
|
57
|
+
* use this for displaying warnings when the Table content gets cut off
|
|
58
|
+
*/
|
|
59
|
+
lastRow?: string | React.ReactNode;
|
|
60
|
+
}
|
|
61
|
+
export default function Table<T>(props: TableProps<T>): JSX.Element;
|
|
62
|
+
interface IRowProps<T> {
|
|
63
|
+
Data: T[];
|
|
64
|
+
Cols: Column<T>[];
|
|
65
|
+
RowStyle?: React.CSSProperties;
|
|
66
|
+
BodyStyle?: React.CSSProperties;
|
|
67
|
+
BodyClass?: string;
|
|
68
|
+
Click: (data: {
|
|
69
|
+
colKey: string;
|
|
70
|
+
colField?: keyof T;
|
|
71
|
+
row: T;
|
|
72
|
+
data: T[keyof T] | null;
|
|
73
|
+
index: number;
|
|
74
|
+
}, e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
75
|
+
DragStart?: ((data: {
|
|
76
|
+
colKey: string;
|
|
77
|
+
colField?: keyof T;
|
|
78
|
+
row: T;
|
|
79
|
+
data: T[keyof T] | null;
|
|
80
|
+
index: number;
|
|
81
|
+
}, e: any) => void);
|
|
82
|
+
Selected?: ((data: T) => boolean);
|
|
83
|
+
KeySelector?: (data: T) => string;
|
|
84
|
+
}
|
|
85
|
+
export declare function Rows<T>(props: IRowProps<T>): JSX.Element | null;
|
|
86
|
+
interface IHeaderProps<T> {
|
|
87
|
+
Class?: string;
|
|
88
|
+
Style?: React.CSSProperties;
|
|
89
|
+
Cols: Column<T>[];
|
|
90
|
+
SortKey: string;
|
|
91
|
+
Ascending: boolean;
|
|
92
|
+
Click: (data: {
|
|
93
|
+
colKey: string;
|
|
94
|
+
colField?: keyof T;
|
|
95
|
+
ascending: boolean;
|
|
96
|
+
}, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
97
|
+
}
|
|
98
|
+
export declare function Header<T>(props: IHeaderProps<T>): JSX.Element;
|
|
99
|
+
export {};
|
package/lib/Table.js
CHANGED
|
@@ -1,106 +1,105 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ******************************************************************************************************
|
|
3
|
-
// Table.tsx - Gbtc
|
|
4
|
-
//
|
|
5
|
-
// Copyright © 2018, Grid Protection Alliance. All Rights Reserved.
|
|
6
|
-
//
|
|
7
|
-
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
8
|
-
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
9
|
-
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
10
|
-
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
11
|
-
//
|
|
12
|
-
// http://opensource.org/licenses/MIT
|
|
13
|
-
//
|
|
14
|
-
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
15
|
-
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
16
|
-
// License for the specific language governing permissions and limitations.
|
|
17
|
-
//
|
|
18
|
-
// Code Modification History:
|
|
19
|
-
// ----------------------------------------------------------------------------------------------------
|
|
20
|
-
// 08/02/2018 - Billy Ernest
|
|
21
|
-
// Generated original version of source code.
|
|
22
|
-
//
|
|
23
|
-
// ******************************************************************************************************
|
|
24
|
-
var __assign = (this && this.__assign) || function () {
|
|
25
|
-
__assign = Object.assign || function(t) {
|
|
26
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
27
|
-
s = arguments[i];
|
|
28
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
29
|
-
t[p] = s[p];
|
|
30
|
-
}
|
|
31
|
-
return t;
|
|
32
|
-
};
|
|
33
|
-
return __assign.apply(this, arguments);
|
|
34
|
-
};
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function Cell(props) {
|
|
73
|
-
var css = (props.Style !== undefined) ? __assign({}, props.Style) : {};
|
|
74
|
-
if (props.DragStart !== undefined)
|
|
75
|
-
css.cursor = "grab";
|
|
76
|
-
var getFieldValue = function () { return props.DataField !== undefined ? props.Object[props.DataField] : null; };
|
|
77
|
-
var getFieldContent = function () { return props.Content !== undefined ? props.Content(props.Object, props.DataKey, props.DataField, css, props.RowIndex) : getFieldValue(); };
|
|
78
|
-
return (React.createElement("td", { style: css, onClick: function (e) { return props.Click({ colKey: props.DataKey, colField: props.DataField, row: props.Object, data: getFieldValue(), index: props.RowIndex }, e); }, draggable: props.DragStart !== undefined, onDragStart: function (e) { if (props.DragStart !== undefined)
|
|
79
|
-
props.DragStart({ colKey: props.DataKey, colField: props.DataField, row: props.Object, data: getFieldValue(), index: props.RowIndex }, e); } }, getFieldContent()));
|
|
80
|
-
}
|
|
81
|
-
function Header(props) {
|
|
82
|
-
return (React.createElement("thead", { className: props.Class, style: props.Style },
|
|
83
|
-
React.createElement("tr", null, props.Cols.map(function (col) { return React.createElement(HeaderCell, { key: col.key, HeaderStyle: col.headerStyle, DataKey: col.key, Click: function (e) { return props.Click({ colKey: col.key, colField: col.field, ascending: props.Ascending }, e); }, Label: col.label, SortKey: props.SortKey, Ascending: props.Ascending }); }))));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
React.createElement(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
// ******************************************************************************************************
|
|
3
|
+
// Table.tsx - Gbtc
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2018, Grid Protection Alliance. All Rights Reserved.
|
|
6
|
+
//
|
|
7
|
+
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
8
|
+
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
9
|
+
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
10
|
+
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
11
|
+
//
|
|
12
|
+
// http://opensource.org/licenses/MIT
|
|
13
|
+
//
|
|
14
|
+
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
15
|
+
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
16
|
+
// License for the specific language governing permissions and limitations.
|
|
17
|
+
//
|
|
18
|
+
// Code Modification History:
|
|
19
|
+
// ----------------------------------------------------------------------------------------------------
|
|
20
|
+
// 08/02/2018 - Billy Ernest
|
|
21
|
+
// Generated original version of source code.
|
|
22
|
+
//
|
|
23
|
+
// ******************************************************************************************************
|
|
24
|
+
var __assign = (this && this.__assign) || function () {
|
|
25
|
+
__assign = Object.assign || function(t) {
|
|
26
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
27
|
+
s = arguments[i];
|
|
28
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
29
|
+
t[p] = s[p];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
};
|
|
33
|
+
return __assign.apply(this, arguments);
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.default = Table;
|
|
37
|
+
exports.Rows = Rows;
|
|
38
|
+
exports.Header = Header;
|
|
39
|
+
var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
|
|
40
|
+
var React = require("react");
|
|
41
|
+
function Table(props) {
|
|
42
|
+
return (React.createElement("table", { className: props.tableClass !== undefined ? props.tableClass : '', style: props.tableStyle },
|
|
43
|
+
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); } }),
|
|
44
|
+
React.createElement(Rows, { DragStart: props.onDragStart, 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 }),
|
|
45
|
+
props.lastRow !== undefined ? React.createElement("tr", { style: (props.rowStyle !== undefined) ? __assign({}, props.rowStyle) : {}, key: -1 }, props.lastRow) : null));
|
|
46
|
+
function handleSort(data, event) {
|
|
47
|
+
if (data.colKey !== null)
|
|
48
|
+
props.onSort(data, event);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function Rows(props) {
|
|
52
|
+
if (props.Data.length === 0)
|
|
53
|
+
return null;
|
|
54
|
+
var rows = props.Data.map(function (item, rowIndex) {
|
|
55
|
+
var cells = props.Cols.map(function (colData) {
|
|
56
|
+
return React.createElement(Cell, { key: colData.key, Style: colData.rowStyle, DataKey: colData.key, DataField: colData.field, Object: item, RowIndex: rowIndex, Content: colData.content, Click: function (data, e) { return props.Click(data, e); }, DragStart: props.DragStart });
|
|
57
|
+
});
|
|
58
|
+
var style = (props.RowStyle !== undefined) ? __assign({}, props.RowStyle) : {};
|
|
59
|
+
if (style.cursor === undefined)
|
|
60
|
+
style.cursor = 'pointer';
|
|
61
|
+
if (props.Selected !== undefined && props.Selected(item))
|
|
62
|
+
style.backgroundColor = 'yellow';
|
|
63
|
+
function ToKey(index, data) {
|
|
64
|
+
if (props.KeySelector === undefined)
|
|
65
|
+
return index.toString();
|
|
66
|
+
return props.KeySelector(data);
|
|
67
|
+
}
|
|
68
|
+
return (React.createElement("tr", { style: style, key: ToKey(rowIndex, item) }, cells));
|
|
69
|
+
});
|
|
70
|
+
return (React.createElement("tbody", { style: props.BodyStyle, className: props.BodyClass }, rows));
|
|
71
|
+
}
|
|
72
|
+
function Cell(props) {
|
|
73
|
+
var css = (props.Style !== undefined) ? __assign({}, props.Style) : {};
|
|
74
|
+
if (props.DragStart !== undefined)
|
|
75
|
+
css.cursor = "grab";
|
|
76
|
+
var getFieldValue = function () { return props.DataField !== undefined ? props.Object[props.DataField] : null; };
|
|
77
|
+
var getFieldContent = function () { return props.Content !== undefined ? props.Content(props.Object, props.DataKey, props.DataField, css, props.RowIndex) : getFieldValue(); };
|
|
78
|
+
return (React.createElement("td", { style: css, onClick: function (e) { return props.Click({ colKey: props.DataKey, colField: props.DataField, row: props.Object, data: getFieldValue(), index: props.RowIndex }, e); }, draggable: props.DragStart !== undefined, onDragStart: function (e) { if (props.DragStart !== undefined)
|
|
79
|
+
props.DragStart({ colKey: props.DataKey, colField: props.DataField, row: props.Object, data: getFieldValue(), index: props.RowIndex }, e); } }, getFieldContent()));
|
|
80
|
+
}
|
|
81
|
+
function Header(props) {
|
|
82
|
+
return (React.createElement("thead", { className: props.Class, style: props.Style },
|
|
83
|
+
React.createElement("tr", null, props.Cols.map(function (col) { return React.createElement(HeaderCell, { key: col.key, HeaderStyle: col.headerStyle, DataKey: col.key, Click: function (e) { return props.Click({ colKey: col.key, colField: col.field, ascending: props.Ascending }, e); }, Label: col.label, SortKey: props.SortKey, Ascending: props.Ascending }); }))));
|
|
84
|
+
}
|
|
85
|
+
function HeaderCell(props) {
|
|
86
|
+
var style = (props.HeaderStyle !== undefined) ? props.HeaderStyle : {};
|
|
87
|
+
if (style.cursor === undefined && props.DataKey !== null) {
|
|
88
|
+
style.cursor = 'pointer';
|
|
89
|
+
}
|
|
90
|
+
if (style.position === undefined) {
|
|
91
|
+
style.position = 'relative';
|
|
92
|
+
}
|
|
93
|
+
return (React.createElement("th", { style: style, onClick: function (e) { return props.Click(e); } },
|
|
94
|
+
React.createElement(RenderAngleIcon, { SortKey: props.SortKey, Key: props.DataKey, Ascending: props.Ascending }),
|
|
95
|
+
React.createElement("div", { style: { marginLeft: (props.SortKey === props.DataKey ? 25 : 0) } }, props.Label)));
|
|
96
|
+
}
|
|
97
|
+
function RenderAngleIcon(props) {
|
|
98
|
+
var AngleIcon = function (a) { return a.ascending ? gpa_symbols_1.SVGIcons.ArrowDropUp : gpa_symbols_1.SVGIcons.ArrowDropDown; };
|
|
99
|
+
if (props.SortKey === null)
|
|
100
|
+
return null;
|
|
101
|
+
if (props.SortKey !== props.Key)
|
|
102
|
+
return null;
|
|
103
|
+
return React.createElement("div", { style: { position: 'absolute', width: 25 } },
|
|
104
|
+
React.createElement(AngleIcon, { ascending: props.Ascending }));
|
|
105
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import Table, { TableProps, Rows, Column } from './Table';
|
|
2
|
-
import { SelectTable, ISelectTableProps } from './SelectTable';
|
|
3
|
-
import { SearchableTable } from './SearchableTable';
|
|
4
|
-
import { DynamicTableProps, DynamicTable } from './DynamicTable';
|
|
5
|
-
import Paging from './Paging';
|
|
6
|
-
import AdjustableTable from './AdjustableTable/AdjustableTable';
|
|
7
|
-
import UpdatedColumn from './AdjustableTable/Column';
|
|
8
|
-
import AdjustableCol from './AdjustableTable/AdjustableColumn';
|
|
9
|
-
declare const ReactTable: {
|
|
10
|
-
Table: typeof AdjustableTable;
|
|
11
|
-
Column: typeof UpdatedColumn;
|
|
12
|
-
AdjustableCol: typeof AdjustableCol;
|
|
13
|
-
};
|
|
14
|
-
export { ReactTable, TableProps, SelectTable, ISelectTableProps, SearchableTable, DynamicTable, DynamicTableProps, Rows, Column, Paging };
|
|
15
|
-
export default Table;
|
|
1
|
+
import Table, { TableProps, Rows, Column } from './Table';
|
|
2
|
+
import { SelectTable, ISelectTableProps } from './SelectTable';
|
|
3
|
+
import { SearchableTable } from './SearchableTable';
|
|
4
|
+
import { DynamicTableProps, DynamicTable } from './DynamicTable';
|
|
5
|
+
import Paging from './Paging';
|
|
6
|
+
import AdjustableTable from './AdjustableTable/AdjustableTable';
|
|
7
|
+
import UpdatedColumn from './AdjustableTable/Column';
|
|
8
|
+
import AdjustableCol from './AdjustableTable/AdjustableColumn';
|
|
9
|
+
declare const ReactTable: {
|
|
10
|
+
Table: typeof AdjustableTable;
|
|
11
|
+
Column: typeof UpdatedColumn;
|
|
12
|
+
AdjustableCol: typeof AdjustableCol;
|
|
13
|
+
};
|
|
14
|
+
export { ReactTable, TableProps, SelectTable, ISelectTableProps, SearchableTable, DynamicTable, DynamicTableProps, Rows, Column, Paging };
|
|
15
|
+
export default Table;
|
package/lib/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ******************************************************************************************************
|
|
3
|
-
// index.tsx - Gbtc
|
|
4
|
-
//
|
|
5
|
-
// Copyright © 2018, Grid Protection Alliance. All Rights Reserved.
|
|
6
|
-
//
|
|
7
|
-
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
8
|
-
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
9
|
-
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
10
|
-
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
11
|
-
//
|
|
12
|
-
// http://opensource.org/licenses/MIT
|
|
13
|
-
//
|
|
14
|
-
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
15
|
-
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
16
|
-
// License for the specific language governing permissions and limitations.
|
|
17
|
-
//
|
|
18
|
-
// Code Modification History:
|
|
19
|
-
// ----------------------------------------------------------------------------------------------------
|
|
20
|
-
// 08/02/2018 - Billy Ernest
|
|
21
|
-
// Generated original version of source code.
|
|
22
|
-
// 02/12/2021 - C. lackner
|
|
23
|
-
// Moved table to seperate File.
|
|
24
|
-
//
|
|
25
|
-
// ******************************************************************************************************
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.Paging = exports.Rows = exports.DynamicTable = exports.SearchableTable = exports.SelectTable = exports.ReactTable = void 0;
|
|
28
|
-
var Table_1 = require("./Table");
|
|
29
|
-
Object.defineProperty(exports, "Rows", { enumerable: true, get: function () { return Table_1.Rows; } });
|
|
30
|
-
var SelectTable_1 = require("./SelectTable");
|
|
31
|
-
Object.defineProperty(exports, "SelectTable", { enumerable: true, get: function () { return SelectTable_1.SelectTable; } });
|
|
32
|
-
var SearchableTable_1 = require("./SearchableTable");
|
|
33
|
-
Object.defineProperty(exports, "SearchableTable", { enumerable: true, get: function () { return SearchableTable_1.SearchableTable; } });
|
|
34
|
-
var DynamicTable_1 = require("./DynamicTable");
|
|
35
|
-
Object.defineProperty(exports, "DynamicTable", { enumerable: true, get: function () { return DynamicTable_1.DynamicTable; } });
|
|
36
|
-
var Paging_1 = require("./Paging");
|
|
37
|
-
exports.Paging = Paging_1.default;
|
|
38
|
-
var AdjustableTable_1 = require("./AdjustableTable/AdjustableTable");
|
|
39
|
-
var Column_1 = require("./AdjustableTable/Column");
|
|
40
|
-
var AdjustableColumn_1 = require("./AdjustableTable/AdjustableColumn");
|
|
41
|
-
var ReactTable = {
|
|
42
|
-
Table: AdjustableTable_1.default,
|
|
43
|
-
Column: Column_1.default,
|
|
44
|
-
AdjustableCol: AdjustableColumn_1.default,
|
|
45
|
-
};
|
|
46
|
-
exports.ReactTable = ReactTable;
|
|
47
|
-
exports.default = Table_1.default;
|
|
1
|
+
"use strict";
|
|
2
|
+
// ******************************************************************************************************
|
|
3
|
+
// index.tsx - Gbtc
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2018, Grid Protection Alliance. All Rights Reserved.
|
|
6
|
+
//
|
|
7
|
+
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
|
|
8
|
+
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
|
|
9
|
+
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
|
|
10
|
+
// file except in compliance with the License. You may obtain a copy of the License at:
|
|
11
|
+
//
|
|
12
|
+
// http://opensource.org/licenses/MIT
|
|
13
|
+
//
|
|
14
|
+
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
|
|
15
|
+
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
|
|
16
|
+
// License for the specific language governing permissions and limitations.
|
|
17
|
+
//
|
|
18
|
+
// Code Modification History:
|
|
19
|
+
// ----------------------------------------------------------------------------------------------------
|
|
20
|
+
// 08/02/2018 - Billy Ernest
|
|
21
|
+
// Generated original version of source code.
|
|
22
|
+
// 02/12/2021 - C. lackner
|
|
23
|
+
// Moved table to seperate File.
|
|
24
|
+
//
|
|
25
|
+
// ******************************************************************************************************
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.Paging = exports.Rows = exports.DynamicTable = exports.SearchableTable = exports.SelectTable = exports.ReactTable = void 0;
|
|
28
|
+
var Table_1 = require("./Table");
|
|
29
|
+
Object.defineProperty(exports, "Rows", { enumerable: true, get: function () { return Table_1.Rows; } });
|
|
30
|
+
var SelectTable_1 = require("./SelectTable");
|
|
31
|
+
Object.defineProperty(exports, "SelectTable", { enumerable: true, get: function () { return SelectTable_1.SelectTable; } });
|
|
32
|
+
var SearchableTable_1 = require("./SearchableTable");
|
|
33
|
+
Object.defineProperty(exports, "SearchableTable", { enumerable: true, get: function () { return SearchableTable_1.SearchableTable; } });
|
|
34
|
+
var DynamicTable_1 = require("./DynamicTable");
|
|
35
|
+
Object.defineProperty(exports, "DynamicTable", { enumerable: true, get: function () { return DynamicTable_1.DynamicTable; } });
|
|
36
|
+
var Paging_1 = require("./Paging");
|
|
37
|
+
exports.Paging = Paging_1.default;
|
|
38
|
+
var AdjustableTable_1 = require("./AdjustableTable/AdjustableTable");
|
|
39
|
+
var Column_1 = require("./AdjustableTable/Column");
|
|
40
|
+
var AdjustableColumn_1 = require("./AdjustableTable/AdjustableColumn");
|
|
41
|
+
var ReactTable = {
|
|
42
|
+
Table: AdjustableTable_1.default,
|
|
43
|
+
Column: Column_1.default,
|
|
44
|
+
AdjustableCol: AdjustableColumn_1.default,
|
|
45
|
+
};
|
|
46
|
+
exports.ReactTable = ReactTable;
|
|
47
|
+
exports.default = Table_1.default;
|
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.46",
|
|
4
4
|
"description": "Table for GPA web applications",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^5.60.0",
|
|
37
37
|
"@typescript-eslint/parser": "^5.60.0",
|
|
38
38
|
"eslint": "^8.43.0",
|
|
39
|
-
"jest": "^
|
|
39
|
+
"jest": "^29.0.0",
|
|
40
40
|
"prettier": "^2.3.2",
|
|
41
|
-
"ts-jest": "^
|
|
42
|
-
"typescript": "
|
|
41
|
+
"ts-jest": "^29.0.0",
|
|
42
|
+
"typescript": "5.5.3"
|
|
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.36",
|
|
46
|
+
"@gpa-gemstone/helper-functions": "0.0.32",
|
|
47
47
|
"@types/lodash": "^4.14.171",
|
|
48
48
|
"@types/react": "^17.0.14",
|
|
49
49
|
"lodash": "^4.17.21",
|