@gpa-gemstone/react-table 1.2.64 → 1.2.66
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.
|
@@ -17,10 +17,6 @@ interface ITableProps<T> extends ReactTableProps.ITable<T> {
|
|
|
17
17
|
* The key used to store columns in local storage
|
|
18
18
|
*/
|
|
19
19
|
LocalStorageKey?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Optional flag to show helper alert for configuring table columns
|
|
22
|
-
*/
|
|
23
|
-
ShowColumnHelper?: boolean;
|
|
24
20
|
}
|
|
25
21
|
/**
|
|
26
22
|
* Table with modal to show and hide columns
|
|
@@ -35,7 +35,6 @@ const ConfigurableColumn_1 = require("./ConfigurableColumn");
|
|
|
35
35
|
* Table with modal to show and hide columns
|
|
36
36
|
*/
|
|
37
37
|
function ConfigurableTable(props) {
|
|
38
|
-
var _a;
|
|
39
38
|
const getKeyMappings = () => {
|
|
40
39
|
const u = new Map();
|
|
41
40
|
React.Children.forEach(props.children, (element) => {
|
|
@@ -60,7 +59,6 @@ function ConfigurableTable(props) {
|
|
|
60
59
|
const [hover, setHover] = React.useState(false);
|
|
61
60
|
const [guid] = React.useState((0, helper_functions_1.CreateGuid)());
|
|
62
61
|
const [widthDisabledAdd, setWidthDisabledAdd] = React.useState(false);
|
|
63
|
-
const [showHelperAlert, setShowHelperAlert] = React.useState(true);
|
|
64
62
|
const handleReduceWidthCallback = React.useCallback((hiddenKeys) => {
|
|
65
63
|
if (hiddenKeys.length !== 0) {
|
|
66
64
|
setWidthDisabledAdd(true);
|
|
@@ -127,8 +125,7 @@ function ConfigurableTable(props) {
|
|
|
127
125
|
return ((_a = c === null || c === void 0 ? void 0 : c.Default) !== null && _a !== void 0 ? _a : false) || isSort || isLocal;
|
|
128
126
|
}
|
|
129
127
|
return (React.createElement(React.Fragment, null,
|
|
130
|
-
((
|
|
131
|
-
React.createElement(Table_1.Table, Object.assign({}, props, { LastColumn: React.createElement("div", { style: { marginLeft: -5, marginBottom: 12 }, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), id: guid + '-tooltip', onClick: () => setShowSettings(true) },
|
|
128
|
+
React.createElement(Table_1.Table, Object.assign({}, props, { LastColumn: React.createElement("div", { style: { marginLeft: -5, marginBottom: 12, cursor: 'pointer' }, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), id: guid + '-tooltip', onClick: () => setShowSettings(true) },
|
|
132
129
|
React.createElement(gpa_symbols_1.ReactIcons.Settings, null)), ReduceWidthCallback: handleReduceWidthCallback }), React.Children.map(props.children, (element) => {
|
|
133
130
|
var _a, _b;
|
|
134
131
|
if (!React.isValidElement(element))
|
|
@@ -137,7 +134,7 @@ function ConfigurableTable(props) {
|
|
|
137
134
|
return ((_b = (_a = columns.get(element.props.Key)) === null || _a === void 0 ? void 0 : _a.Enabled) !== null && _b !== void 0 ? _b : false) ? element.props.children : null;
|
|
138
135
|
return element;
|
|
139
136
|
})),
|
|
140
|
-
React.createElement(
|
|
137
|
+
React.createElement(react_forms_1.ToolTip, { Show: hover, Position: 'bottom', Target: guid + '-tooltip', Zindex: 99999 },
|
|
141
138
|
React.createElement("p", null, "Change Columns")),
|
|
142
139
|
props.SettingsPortal === undefined ? (React.createElement(react_interactive_1.Modal, { Title: 'Table Columns', Show: showSettings, ShowX: true, ShowCancel: false, ZIndex: props.ModalZIndex, CallBack: (conf) => {
|
|
143
140
|
setShowSettings(false);
|
|
@@ -188,5 +185,7 @@ function ColumnSelection(props) {
|
|
|
188
185
|
React.createElement("div", { className: "col-4" }, props.columns.map((c, i) => i % 3 == 2 ? (React.createElement(react_forms_1.CheckBox, { Label: c.Label, Field: 'Enabled', Record: c, Setter: () => props.onChange(c.Key), key: c.Key, Disabled: c.Key == props.sortKey || (props.disableAdd && !c.Enabled), Help: c.Key == props.sortKey
|
|
189
186
|
? 'The Table is currently sorted by this column so it cannot be hidden.'
|
|
190
187
|
: undefined })) : null))),
|
|
191
|
-
props.disableAdd ?
|
|
188
|
+
props.disableAdd ?
|
|
189
|
+
React.createElement(react_interactive_1.Alert, { Color: 'alert-primary', Style: { marginBottom: 0, marginTop: '0.5em' } }, "Additional columns disabled due to table size.")
|
|
190
|
+
: null));
|
|
192
191
|
}
|
package/lib/Table/Table.js
CHANGED
|
@@ -260,7 +260,7 @@ function Table(props) {
|
|
|
260
260
|
props.OnSort(data, event);
|
|
261
261
|
}, [props.OnSort]);
|
|
262
262
|
return (React.createElement("table", { className: props.TableClass !== undefined ? props.TableClass : 'table table-hover', style: tableStyle },
|
|
263
|
-
React.createElement(Header, { Class: props.TheadClass, Style: headStyle, SortKey: props.SortKey, Ascending: props.Ascending, LastColumn: props.LastColumn, OnSort: handleSort, ColWidths: colWidthsRef, Trigger: trigger, TriggerRerender: () => setTrigger(c => c + 1) }, props.children),
|
|
263
|
+
React.createElement(Header, { Class: props.TheadClass, Style: headStyle, SortKey: props.SortKey, Ascending: props.Ascending, LastColumn: props.LastColumn, OnSort: handleSort, ColWidths: colWidthsRef, SetFilters: props.SetFilters, Filters: props.Filters, Trigger: trigger, TriggerRerender: () => setTrigger(c => c + 1) }, props.children),
|
|
264
264
|
React.createElement(Rows, { DragStart: props.OnDragStart, Data: props.Data, RowStyle: rowStyle, BodyStyle: bodyStyle, BodyClass: props.TbodyClass, OnClick: props.OnClick, Selected: props.Selected, KeySelector: props.KeySelector, BodyRef: bodyRef, BodyScrolled: scrolled, ColWidths: colWidthsRef, Trigger: trigger }, props.children),
|
|
265
265
|
props.LastRow !== undefined ? (React.createElement("tfoot", { style: props.TfootStyle, className: props.TfootClass },
|
|
266
266
|
React.createElement("tr", { style: props.RowStyle !== undefined ? Object.assign({}, props.RowStyle) : {} }, props.LastRow))) : null));
|
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.66",
|
|
4
4
|
"description": "Table for GPA web applications",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"typescript": "5.5.3"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@gpa-gemstone/gpa-symbols": "0.0.
|
|
46
|
+
"@gpa-gemstone/gpa-symbols": "0.0.48",
|
|
47
47
|
"@gpa-gemstone/helper-functions": "0.0.37",
|
|
48
|
-
"@gpa-gemstone/react-interactive": "1.0.
|
|
48
|
+
"@gpa-gemstone/react-interactive": "1.0.144",
|
|
49
49
|
"@types/lodash": "^4.14.171",
|
|
50
50
|
"@types/react": "^17.0.14",
|
|
51
51
|
"lodash": "^4.17.21",
|