@gpa-gemstone/common-pages 0.0.104 → 0.0.106
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/ErrorBoundary.d.ts +17 -17
- package/lib/ErrorBoundary.js +91 -68
- package/lib/Note.d.ts +22 -22
- package/lib/Note.js +256 -230
- package/lib/SearchBar.d.ts +37 -37
- package/lib/SearchBar.js +203 -180
- package/lib/SelectionPopup.d.ts +42 -42
- package/lib/SelectionPopup.js +93 -90
- package/lib/Setting.d.ts +8 -8
- package/lib/Setting.js +151 -125
- package/lib/SliceInterfaces.d.ts +76 -76
- package/lib/SliceInterfaces.js +2 -2
- package/lib/StandardSelectPopup.d.ts +20 -20
- package/lib/StandardSelectPopup.js +135 -109
- package/lib/TimeFilter/QuickSelects.d.ts +7 -0
- package/lib/TimeFilter/QuickSelects.js +240 -0
- package/lib/TimeFilter.d.ts +26 -0
- package/lib/TimeFilter.js +270 -0
- package/lib/TimeWindowUtils.d.ts +33 -0
- package/lib/TimeWindowUtils.js +121 -0
- package/lib/ValueList/ByValueList.d.ts +10 -10
- package/lib/ValueList/ByValueList.js +141 -115
- package/lib/ValueList/Group.d.ts +11 -11
- package/lib/ValueList/Group.js +97 -71
- package/lib/ValueList/GroupForm.d.ts +9 -9
- package/lib/ValueList/GroupForm.js +74 -51
- package/lib/ValueList/GroupInfo.d.ts +8 -8
- package/lib/ValueList/GroupInfo.js +95 -69
- package/lib/ValueList/GroupItem.d.ts +9 -9
- package/lib/ValueList/GroupItem.js +142 -116
- package/lib/ValueList/ItemForm.d.ts +9 -9
- package/lib/ValueList/ItemForm.js +82 -59
- package/lib/index.d.ts +12 -11
- package/lib/index.js +50 -45
- package/lib/user/AdditionalField.d.ts +26 -26
- package/lib/user/AdditionalField.js +290 -264
- package/lib/user/ByUser.d.ts +12 -12
- package/lib/user/ByUser.js +174 -148
- package/lib/user/User.d.ts +14 -14
- package/lib/user/User.js +97 -71
- package/lib/user/UserForm.d.ts +12 -12
- package/lib/user/UserForm.js +166 -143
- package/lib/user/UserInfo.d.ts +7 -7
- package/lib/user/UserInfo.js +123 -97
- package/lib/user/UserPermissions.d.ts +8 -8
- package/lib/user/UserPermissions.js +106 -83
- package/package.json +11 -10
package/lib/SliceInterfaces.d.ts
CHANGED
@@ -1,76 +1,76 @@
|
|
1
|
-
import { Application } from '@gpa-gemstone/application-typings';
|
2
|
-
import { Search } from '@gpa-gemstone/react-interactive';
|
3
|
-
import { ActionCreatorWithPayload, AsyncThunk, ActionCreatorWithoutPayload } from '@reduxjs/toolkit';
|
4
|
-
|
5
|
-
export
|
6
|
-
export interface IGenericSlice<T> {
|
7
|
-
Fetch: (AsyncThunk<any, void | number | string, {}>);
|
8
|
-
DBAction: (AsyncThunk<any, {
|
9
|
-
verb: DBAction;
|
10
|
-
record: T;
|
11
|
-
}, {}>);
|
12
|
-
Sort: AsyncThunk<any, {
|
13
|
-
SortField: keyof T;
|
14
|
-
Ascending: boolean;
|
15
|
-
}, {}>;
|
16
|
-
Data: (state: any) => T[];
|
17
|
-
Status: (state: any) => Application.Types.Status;
|
18
|
-
SortField: (state: any) => keyof T;
|
19
|
-
Ascending: (state: any) => boolean;
|
20
|
-
ParentID?: (state: any) => number | string;
|
21
|
-
}
|
22
|
-
export interface ISearchableSlice<T> extends IGenericSlice<T> {
|
23
|
-
DBSearch: (AsyncThunk<any, {
|
24
|
-
filter: Search.IFilter<T>[];
|
25
|
-
sortField?: keyof T;
|
26
|
-
ascending?: boolean;
|
27
|
-
}, {}>);
|
28
|
-
SearchFilters: (state: any) => Search.IFilter<T>[];
|
29
|
-
SearchResults: (state: any) => T[];
|
30
|
-
SearchStatus: (state: any) => Application.Types.Status;
|
31
|
-
}
|
32
|
-
export interface IAdditionalFieldSlice<F, V> {
|
33
|
-
FetchField: AsyncThunk<any, void, {}>;
|
34
|
-
FieldAction: AsyncThunk<any, {
|
35
|
-
Verb: DBAction;
|
36
|
-
Record: F;
|
37
|
-
}, {}>;
|
38
|
-
FetchValues: AsyncThunk<any, number | string, {}>;
|
39
|
-
UpdateValues: AsyncThunk<any, {
|
40
|
-
ParentID: number | string;
|
41
|
-
Values: V[];
|
42
|
-
}, {}>;
|
43
|
-
Sort: ActionCreatorWithPayload<{
|
44
|
-
SortField: keyof F;
|
45
|
-
Ascending: boolean;
|
46
|
-
}, string>;
|
47
|
-
Fields: (state: any) => F[];
|
48
|
-
Values: (state: any) => V[];
|
49
|
-
FieldStatus: (state: any) => Application.Types.Status;
|
50
|
-
ValueStatus: (state: any) => Application.Types.Status;
|
51
|
-
ValueParentId: (state: any) => number | string;
|
52
|
-
SortField: (state: any) => keyof F;
|
53
|
-
Ascending: (state: any) => boolean;
|
54
|
-
}
|
55
|
-
export interface IUserAccountSlice extends ISearchableSlice<Application.Types.iUserAccount> {
|
56
|
-
ADUpdate: (AsyncThunk<any, void, {}>);
|
57
|
-
SetCurrentUser: (AsyncThunk<any, Application.Types.iUserAccount, {}>);
|
58
|
-
LoadExistingUser: (AsyncThunk<any, string, {}>);
|
59
|
-
SetNewUser: ActionCreatorWithoutPayload;
|
60
|
-
CurrentID: (state: any) => string | undefined;
|
61
|
-
CurrentUser: (state: any) => Application.Types.iUserAccount;
|
62
|
-
ADValidation: (state: any) => UserValidation;
|
63
|
-
}
|
64
|
-
export interface ISecurityRoleSlice {
|
65
|
-
FetchRoles: (AsyncThunk<any, void, {}>);
|
66
|
-
FetchUserRoles: (AsyncThunk<any, string, {}>);
|
67
|
-
SetUserRoles: (AsyncThunk<any, {
|
68
|
-
UserId: string;
|
69
|
-
Roles: Application.Types.iApplicationRoleUserAccount[];
|
70
|
-
}, {}>);
|
71
|
-
Status: (state: any) => Application.Types.Status;
|
72
|
-
CurrentRoleStatus: (state: any) => Application.Types.Status;
|
73
|
-
Roles: (state: any) => Application.Types.iApplicationRoleUserAccount[];
|
74
|
-
AvailableRoles: (state: any) => Application.Types.iApplicationRole<Application.Types.SecurityRoleName>[];
|
75
|
-
}
|
76
|
-
export {};
|
1
|
+
import { Application } from '@gpa-gemstone/application-typings';
|
2
|
+
import { Search } from '@gpa-gemstone/react-interactive';
|
3
|
+
import { ActionCreatorWithPayload, AsyncThunk, ActionCreatorWithoutPayload } from '@reduxjs/toolkit';
|
4
|
+
type DBAction = 'POST' | 'DELETE' | 'PATCH';
|
5
|
+
export type UserValidation = 'Resolving' | 'Valid' | 'Invalid' | 'Unknown';
|
6
|
+
export interface IGenericSlice<T> {
|
7
|
+
Fetch: (AsyncThunk<any, void | number | string, {}>);
|
8
|
+
DBAction: (AsyncThunk<any, {
|
9
|
+
verb: DBAction;
|
10
|
+
record: T;
|
11
|
+
}, {}>);
|
12
|
+
Sort: AsyncThunk<any, {
|
13
|
+
SortField: keyof T;
|
14
|
+
Ascending: boolean;
|
15
|
+
}, {}>;
|
16
|
+
Data: (state: any) => T[];
|
17
|
+
Status: (state: any) => Application.Types.Status;
|
18
|
+
SortField: (state: any) => keyof T;
|
19
|
+
Ascending: (state: any) => boolean;
|
20
|
+
ParentID?: (state: any) => number | string;
|
21
|
+
}
|
22
|
+
export interface ISearchableSlice<T> extends IGenericSlice<T> {
|
23
|
+
DBSearch: (AsyncThunk<any, {
|
24
|
+
filter: Search.IFilter<T>[];
|
25
|
+
sortField?: keyof T;
|
26
|
+
ascending?: boolean;
|
27
|
+
}, {}>);
|
28
|
+
SearchFilters: (state: any) => Search.IFilter<T>[];
|
29
|
+
SearchResults: (state: any) => T[];
|
30
|
+
SearchStatus: (state: any) => Application.Types.Status;
|
31
|
+
}
|
32
|
+
export interface IAdditionalFieldSlice<F, V> {
|
33
|
+
FetchField: AsyncThunk<any, void, {}>;
|
34
|
+
FieldAction: AsyncThunk<any, {
|
35
|
+
Verb: DBAction;
|
36
|
+
Record: F;
|
37
|
+
}, {}>;
|
38
|
+
FetchValues: AsyncThunk<any, number | string, {}>;
|
39
|
+
UpdateValues: AsyncThunk<any, {
|
40
|
+
ParentID: number | string;
|
41
|
+
Values: V[];
|
42
|
+
}, {}>;
|
43
|
+
Sort: ActionCreatorWithPayload<{
|
44
|
+
SortField: keyof F;
|
45
|
+
Ascending: boolean;
|
46
|
+
}, string>;
|
47
|
+
Fields: (state: any) => F[];
|
48
|
+
Values: (state: any) => V[];
|
49
|
+
FieldStatus: (state: any) => Application.Types.Status;
|
50
|
+
ValueStatus: (state: any) => Application.Types.Status;
|
51
|
+
ValueParentId: (state: any) => number | string;
|
52
|
+
SortField: (state: any) => keyof F;
|
53
|
+
Ascending: (state: any) => boolean;
|
54
|
+
}
|
55
|
+
export interface IUserAccountSlice extends ISearchableSlice<Application.Types.iUserAccount> {
|
56
|
+
ADUpdate: (AsyncThunk<any, void, {}>);
|
57
|
+
SetCurrentUser: (AsyncThunk<any, Application.Types.iUserAccount, {}>);
|
58
|
+
LoadExistingUser: (AsyncThunk<any, string, {}>);
|
59
|
+
SetNewUser: ActionCreatorWithoutPayload;
|
60
|
+
CurrentID: (state: any) => string | undefined;
|
61
|
+
CurrentUser: (state: any) => Application.Types.iUserAccount;
|
62
|
+
ADValidation: (state: any) => UserValidation;
|
63
|
+
}
|
64
|
+
export interface ISecurityRoleSlice {
|
65
|
+
FetchRoles: (AsyncThunk<any, void, {}>);
|
66
|
+
FetchUserRoles: (AsyncThunk<any, string, {}>);
|
67
|
+
SetUserRoles: (AsyncThunk<any, {
|
68
|
+
UserId: string;
|
69
|
+
Roles: Application.Types.iApplicationRoleUserAccount[];
|
70
|
+
}, {}>);
|
71
|
+
Status: (state: any) => Application.Types.Status;
|
72
|
+
CurrentRoleStatus: (state: any) => Application.Types.Status;
|
73
|
+
Roles: (state: any) => Application.Types.iApplicationRoleUserAccount[];
|
74
|
+
AvailableRoles: (state: any) => Application.Types.iApplicationRole<Application.Types.SecurityRoleName>[];
|
75
|
+
}
|
76
|
+
export {};
|
package/lib/SliceInterfaces.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import { Column } from "@gpa-gemstone/react-table";
|
2
|
-
import * as React from 'react';
|
3
|
-
import { GenericSlice } from "@gpa-gemstone/react-interactive";
|
4
|
-
interface U {
|
5
|
-
ID: number | string;
|
6
|
-
}
|
7
|
-
interface IProps<T extends U> {
|
8
|
-
Slice: GenericSlice<T>;
|
9
|
-
Selection: T[];
|
10
|
-
OnClose: (selected: T[], conf: boolean) => void;
|
11
|
-
Show: boolean;
|
12
|
-
Searchbar: (children: React.ReactNode) => React.ReactNode;
|
13
|
-
Type?: 'single' | 'multiple';
|
14
|
-
Columns: Column<T>[];
|
15
|
-
Title: string;
|
16
|
-
MinSelection?: number;
|
17
|
-
children?: React.ReactNode;
|
18
|
-
}
|
19
|
-
export default function SelectPopup<T extends U>(props: IProps<T>): JSX.Element;
|
20
|
-
export {};
|
1
|
+
import { Column } from "@gpa-gemstone/react-table";
|
2
|
+
import * as React from 'react';
|
3
|
+
import { GenericSlice } from "@gpa-gemstone/react-interactive";
|
4
|
+
interface U {
|
5
|
+
ID: number | string;
|
6
|
+
}
|
7
|
+
interface IProps<T extends U> {
|
8
|
+
Slice: GenericSlice<T>;
|
9
|
+
Selection: T[];
|
10
|
+
OnClose: (selected: T[], conf: boolean) => void;
|
11
|
+
Show: boolean;
|
12
|
+
Searchbar: (children: React.ReactNode) => React.ReactNode;
|
13
|
+
Type?: 'single' | 'multiple';
|
14
|
+
Columns: Column<T>[];
|
15
|
+
Title: string;
|
16
|
+
MinSelection?: number;
|
17
|
+
children?: React.ReactNode;
|
18
|
+
}
|
19
|
+
export default function SelectPopup<T extends U>(props: IProps<T>): React.JSX.Element;
|
20
|
+
export {};
|
@@ -1,109 +1,135 @@
|
|
1
|
-
"use strict";
|
2
|
-
// ******************************************************************************************************
|
3
|
-
// StandardSelectPopup.tsx - Gbtc
|
4
|
-
//
|
5
|
-
// Copyright © 2021, 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
|
-
// 12/19/2021 - C. Lackner
|
21
|
-
// Generated original version of source code.
|
22
|
-
// ******************************************************************************************************
|
23
|
-
var
|
24
|
-
if (
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
var
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
function
|
40
|
-
|
41
|
-
var
|
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
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
1
|
+
"use strict";
|
2
|
+
// ******************************************************************************************************
|
3
|
+
// StandardSelectPopup.tsx - Gbtc
|
4
|
+
//
|
5
|
+
// Copyright © 2021, 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
|
+
// 12/19/2021 - C. Lackner
|
21
|
+
// Generated original version of source code.
|
22
|
+
// ******************************************************************************************************
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
24
|
+
if (k2 === undefined) k2 = k;
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
28
|
+
}
|
29
|
+
Object.defineProperty(o, k2, desc);
|
30
|
+
}) : (function(o, m, k, k2) {
|
31
|
+
if (k2 === undefined) k2 = k;
|
32
|
+
o[k2] = m[k];
|
33
|
+
}));
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
36
|
+
}) : function(o, v) {
|
37
|
+
o["default"] = v;
|
38
|
+
});
|
39
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
40
|
+
if (mod && mod.__esModule) return mod;
|
41
|
+
var result = {};
|
42
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
43
|
+
__setModuleDefault(result, mod);
|
44
|
+
return result;
|
45
|
+
};
|
46
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
47
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
48
|
+
if (ar || !(i in from)) {
|
49
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
50
|
+
ar[i] = from[i];
|
51
|
+
}
|
52
|
+
}
|
53
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
54
|
+
};
|
55
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
56
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
57
|
+
};
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
59
|
+
exports.default = SelectPopup;
|
60
|
+
var react_table_1 = __importDefault(require("@gpa-gemstone/react-table"));
|
61
|
+
var React = __importStar(require("react"));
|
62
|
+
var react_redux_1 = require("react-redux");
|
63
|
+
var react_interactive_1 = require("@gpa-gemstone/react-interactive");
|
64
|
+
var _ = require("lodash");
|
65
|
+
var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
|
66
|
+
function SelectPopup(props) {
|
67
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
68
|
+
var sortField = (0, react_redux_1.useSelector)(props.Slice.SortField);
|
69
|
+
var ascending = (0, react_redux_1.useSelector)(props.Slice.Ascending);
|
70
|
+
var data = (0, react_redux_1.useSelector)(props.Slice.SearchResults);
|
71
|
+
var _a = React.useState(props.Selection), selectedData = _a[0], setSelectedData = _a[1];
|
72
|
+
var _b = React.useState(''), sortKeySelected = _b[0], setSortKeySelected = _b[1];
|
73
|
+
var _c = React.useState(false), ascendingSelected = _c[0], setAscendingSelected = _c[1];
|
74
|
+
React.useEffect(function () {
|
75
|
+
setSelectedData(props.Selection);
|
76
|
+
}, [props.Selection]);
|
77
|
+
function AddCurrentList() {
|
78
|
+
var updatedData;
|
79
|
+
updatedData = selectedData.concat(data);
|
80
|
+
setSelectedData(_.uniqBy(updatedData, function (d) { return d.ID; }));
|
81
|
+
}
|
82
|
+
return (React.createElement(React.Fragment, null,
|
83
|
+
React.createElement(react_interactive_1.Modal, { Show: props.Show, Title: props.Title, ShowX: true, Size: 'xlg', CallBack: function (conf) { return props.OnClose(selectedData, conf); }, DisableConfirm: props.MinSelection !== undefined && selectedData.length < props.MinSelection, ConfirmShowToolTip: props.MinSelection !== undefined && selectedData.length < props.MinSelection, ConfirmToolTipContent: React.createElement("p", null,
|
84
|
+
gpa_symbols_1.CrossMark,
|
85
|
+
" At least ",
|
86
|
+
props.MinSelection,
|
87
|
+
" items must be selected. ") },
|
88
|
+
React.createElement("div", { className: "row" },
|
89
|
+
React.createElement("div", { className: "col" }, props.Searchbar(React.createElement(React.Fragment, null,
|
90
|
+
props.Type === 'multiple' ? React.createElement("li", { className: "nav-item", style: { width: '20%', paddingRight: 10 } },
|
91
|
+
React.createElement("fieldset", { className: "border", style: { padding: '10px', height: '100%' } },
|
92
|
+
React.createElement("legend", { className: "w-auto", style: { fontSize: 'large' } }, "Quick Selects:"),
|
93
|
+
React.createElement("form", null,
|
94
|
+
React.createElement("div", { className: "form-group" },
|
95
|
+
React.createElement("div", { className: "btn btn-primary", onClick: function (event) { event.preventDefault(); AddCurrentList(); } }, "Add Current List to Selection")),
|
96
|
+
React.createElement("div", { className: "form-group" },
|
97
|
+
React.createElement("div", { className: "btn btn-danger", onClick: function (event) { event.preventDefault(); setSelectedData([]); } }, "Remove All"))))) : null,
|
98
|
+
React.Children.map(props.children, function (e) {
|
99
|
+
if (React.isValidElement(e))
|
100
|
+
return e;
|
101
|
+
return null;
|
102
|
+
}))))),
|
103
|
+
React.createElement("div", { className: "row" },
|
104
|
+
React.createElement("div", { className: "col", style: { width: (props.Type === undefined || props.Type === 'single' ? '100%' : '60%') } },
|
105
|
+
React.createElement(react_table_1.default, { cols: props.Columns, tableClass: "table table-hover", data: data, sortKey: sortField, ascending: ascending, onSort: function (d) {
|
106
|
+
if (d.colKey === "Scroll")
|
107
|
+
return;
|
108
|
+
if (d.colKey === sortField)
|
109
|
+
dispatch(props.Slice.Sort({ SortField: sortField, Ascending: ascending }));
|
110
|
+
else {
|
111
|
+
dispatch(props.Slice.Sort({ SortField: d.colField, Ascending: true }));
|
112
|
+
}
|
113
|
+
}, onClick: function (d) {
|
114
|
+
if (props.Type === undefined || props.Type === 'single')
|
115
|
+
setSelectedData([d.row]);
|
116
|
+
else
|
117
|
+
setSelectedData(function (s) { return __spreadArray(__spreadArray([], s.filter(function (item) { return item.ID !== d.row.ID; }), true), [d.row], false); });
|
118
|
+
}, theadStyle: { fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }, tbodyStyle: { display: 'block', overflowY: 'scroll', maxHeight: '400px', width: '100%' }, rowStyle: { fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }, selected: function (item) { return selectedData.findIndex(function (d) { return d.ID === item.ID; }) > -1; } })),
|
119
|
+
props.Type === 'multiple' ? React.createElement("div", { className: "col", style: { width: '40%' } },
|
120
|
+
React.createElement("div", { style: { width: '100%' } },
|
121
|
+
React.createElement("h3", null, " Current Selection ")),
|
122
|
+
React.createElement(react_table_1.default, { cols: props.Columns, tableClass: "table table-hover", data: selectedData, sortKey: sortKeySelected, ascending: ascendingSelected, onSort: function (d) {
|
123
|
+
if (d.colKey === sortKeySelected) {
|
124
|
+
var ordered = _.orderBy(selectedData, [d.colKey], [(!ascendingSelected ? "asc" : "desc")]);
|
125
|
+
setAscendingSelected(!ascendingSelected);
|
126
|
+
setSelectedData(ordered);
|
127
|
+
}
|
128
|
+
else {
|
129
|
+
var ordered = _.orderBy(selectedData, [d.colKey], ["asc"]);
|
130
|
+
setAscendingSelected(!ascendingSelected);
|
131
|
+
setSelectedData(ordered);
|
132
|
+
setSortKeySelected(d.colKey);
|
133
|
+
}
|
134
|
+
}, onClick: function (d) { return setSelectedData(__spreadArray([], selectedData.filter(function (item) { return item.ID !== d.row.ID; }), true)); }, theadStyle: { fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }, tbodyStyle: { display: 'block', overflowY: 'scroll', maxHeight: '400px', width: '100%' }, rowStyle: { fontSize: 'smaller', display: 'table', tableLayout: 'fixed', width: '100%' }, selected: function (item) { return false; } })) : null))));
|
135
|
+
}
|