@gpa-gemstone/common-pages 0.0.103 → 0.0.105
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/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 +9 -8
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
import { SystemCenter } from '@gpa-gemstone/application-typings';
|
3
|
-
interface IProps {
|
4
|
-
Record: SystemCenter.Types.ValueListGroup;
|
5
|
-
Setter: (record: SystemCenter.Types.ValueListGroup) => void;
|
6
|
-
ErrorSetter?: (errors: string[]) => void;
|
7
|
-
}
|
8
|
-
export default function GroupForm(props: IProps): JSX.Element;
|
9
|
-
export {};
|
1
|
+
import * as React from 'react';
|
2
|
+
import { SystemCenter } from '@gpa-gemstone/application-typings';
|
3
|
+
interface IProps {
|
4
|
+
Record: SystemCenter.Types.ValueListGroup;
|
5
|
+
Setter: (record: SystemCenter.Types.ValueListGroup) => void;
|
6
|
+
ErrorSetter?: (errors: string[]) => void;
|
7
|
+
}
|
8
|
+
export default function GroupForm(props: IProps): React.JSX.Element;
|
9
|
+
export {};
|
@@ -1,51 +1,74 @@
|
|
1
|
-
"use strict";
|
2
|
-
// ******************************************************************************************************
|
3
|
-
// GroupForm.tsx - Gbtc
|
4
|
-
//
|
5
|
-
// Copyright © 2020, 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
|
-
// 07/04/2021 - C. Lackner
|
21
|
-
// Generated original version of source code.
|
22
|
-
// ******************************************************************************************************
|
23
|
-
Object.
|
24
|
-
|
25
|
-
var
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
"use strict";
|
2
|
+
// ******************************************************************************************************
|
3
|
+
// GroupForm.tsx - Gbtc
|
4
|
+
//
|
5
|
+
// Copyright © 2020, 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
|
+
// 07/04/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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
47
|
+
exports.default = GroupForm;
|
48
|
+
var React = __importStar(require("react"));
|
49
|
+
var react_forms_1 = require("@gpa-gemstone/react-forms");
|
50
|
+
function GroupForm(props) {
|
51
|
+
var _a = React.useState([]), errors = _a[0], setErrors = _a[1];
|
52
|
+
React.useEffect(function () {
|
53
|
+
var e = [];
|
54
|
+
if (props.Record.Name == null || props.Record.Name.length === 0)
|
55
|
+
e.push('A Name is required.');
|
56
|
+
if (props.Record.Name != null && props.Record.Name.length > 200)
|
57
|
+
e.push('Name has to be less than 200 characters.');
|
58
|
+
setErrors(e);
|
59
|
+
}, [props.Record]);
|
60
|
+
React.useEffect(function () {
|
61
|
+
if (props.ErrorSetter !== undefined)
|
62
|
+
props.ErrorSetter(errors);
|
63
|
+
}, [errors, props.ErrorSetter]);
|
64
|
+
function Valid(field) {
|
65
|
+
if (field === 'Name')
|
66
|
+
return props.Record.Name != null && props.Record.Name.length > 0 && props.Record.Name.length <= 200;
|
67
|
+
else if (field === 'Description')
|
68
|
+
return true;
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
return (React.createElement("form", null,
|
72
|
+
React.createElement(react_forms_1.Input, { Record: props.Record, Field: 'Name', Feedback: 'Name must be less than 200 characters.', Valid: Valid, Setter: props.Setter }),
|
73
|
+
React.createElement(react_forms_1.TextArea, { Rows: 3, Record: props.Record, Field: 'Description', Valid: Valid, Setter: props.Setter })));
|
74
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
import { SystemCenter } from '@gpa-gemstone/application-typings';
|
3
|
-
interface IProps {
|
4
|
-
Record: SystemCenter.Types.ValueListGroup;
|
5
|
-
Setter: (record: SystemCenter.Types.ValueListGroup) => void;
|
6
|
-
}
|
7
|
-
declare const InfoWindow: (props: IProps) => JSX.Element | null;
|
8
|
-
export default InfoWindow;
|
1
|
+
import * as React from 'react';
|
2
|
+
import { SystemCenter } from '@gpa-gemstone/application-typings';
|
3
|
+
interface IProps {
|
4
|
+
Record: SystemCenter.Types.ValueListGroup;
|
5
|
+
Setter: (record: SystemCenter.Types.ValueListGroup) => void;
|
6
|
+
}
|
7
|
+
declare const InfoWindow: (props: IProps) => React.JSX.Element | null;
|
8
|
+
export default InfoWindow;
|
@@ -1,69 +1,95 @@
|
|
1
|
-
"use strict";
|
2
|
-
// ******************************************************************************************************
|
3
|
-
// GroupInfo.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
|
-
// 07/04/2021 - C. Lackner
|
21
|
-
// Generated original version of source code.
|
22
|
-
// ******************************************************************************************************
|
23
|
-
Object.
|
24
|
-
|
25
|
-
var
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
1
|
+
"use strict";
|
2
|
+
// ******************************************************************************************************
|
3
|
+
// GroupInfo.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
|
+
// 07/04/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 __importDefault = (this && this.__importDefault) || function (mod) {
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
48
|
+
};
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
50
|
+
var React = __importStar(require("react"));
|
51
|
+
var GroupForm_1 = __importDefault(require("./GroupForm"));
|
52
|
+
var react_interactive_1 = require("@gpa-gemstone/react-interactive");
|
53
|
+
var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
|
54
|
+
var InfoWindow = function (props) {
|
55
|
+
var _a = React.useState(props.Record), record = _a[0], setRecord = _a[1];
|
56
|
+
var _b = React.useState([]), errors = _b[0], setErrors = _b[1];
|
57
|
+
var _c = React.useState([]), warnings = _c[0], setWarnings = _c[1];
|
58
|
+
var _d = React.useState('None'), hover = _d[0], setHover = _d[1];
|
59
|
+
React.useEffect(function () {
|
60
|
+
var w = [];
|
61
|
+
if (record == null)
|
62
|
+
return;
|
63
|
+
if (record.Name !== props.Record.Name)
|
64
|
+
w.push('Changes to Name will be lost.');
|
65
|
+
if (record.Description !== props.Record.Description)
|
66
|
+
w.push('Changes to Description will be lost.');
|
67
|
+
setWarnings(w);
|
68
|
+
}, [props.Record, record]);
|
69
|
+
if (record == null)
|
70
|
+
return null;
|
71
|
+
return (React.createElement("div", { className: "card", style: { marginBottom: 10 } },
|
72
|
+
React.createElement("div", { className: "card-header" },
|
73
|
+
React.createElement("div", { className: "row" },
|
74
|
+
React.createElement("div", { className: "col" },
|
75
|
+
React.createElement("h4", null, "Value List Group Information:")))),
|
76
|
+
React.createElement("div", { className: "card-body" },
|
77
|
+
React.createElement(GroupForm_1.default, { Record: record, Setter: function (r) { return setRecord(r); }, ErrorSetter: setErrors })),
|
78
|
+
React.createElement("div", { className: "card-footer" },
|
79
|
+
React.createElement("div", { className: "btn-group mr-2" },
|
80
|
+
React.createElement("button", { className: "btn btn-primary" + (errors.length > 0 || warnings.length === 0 ? ' disabled' : ''), onClick: function () {
|
81
|
+
if (errors.length === 0 && warnings.length > 0)
|
82
|
+
props.Setter(record);
|
83
|
+
}, hidden: record.ID === 0, "data-tooltip": 'Update', onMouseEnter: function () { return setHover('Update'); }, onMouseLeave: function () { return setHover('None'); } }, "Update")),
|
84
|
+
React.createElement(react_interactive_1.ToolTip, { Show: hover === 'Clear' && (errors.length > 0), Position: 'top', Theme: 'dark', Target: "Update" }, errors.map(function (t, i) { return React.createElement("p", { key: i },
|
85
|
+
gpa_symbols_1.CrossMark,
|
86
|
+
" ",
|
87
|
+
t); })),
|
88
|
+
React.createElement("div", { className: "btn-group mr-2" },
|
89
|
+
React.createElement("button", { className: "btn btn-default", onClick: function () { return setRecord(props.Record); }, disabled: warnings.length === 0, "data-tooltip": 'Clr', onMouseEnter: function () { return setHover('Clear'); }, onMouseLeave: function () { return setHover('None'); } }, "Reset")),
|
90
|
+
React.createElement(react_interactive_1.ToolTip, { Show: hover === 'Clear' && (warnings.length > 0), Position: 'top', Theme: 'dark', Target: "Clr" }, warnings.map(function (t, i) { return React.createElement("p", { key: i },
|
91
|
+
gpa_symbols_1.Warning,
|
92
|
+
" ",
|
93
|
+
t); })))));
|
94
|
+
};
|
95
|
+
exports.default = InfoWindow;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
import { SystemCenter } from '@gpa-gemstone/application-typings';
|
3
|
-
import { IGenericSlice } from '../SliceInterfaces';
|
4
|
-
interface IProps {
|
5
|
-
Record: SystemCenter.Types.ValueListGroup;
|
6
|
-
ValueListItemSlice: IGenericSlice<SystemCenter.Types.ValueListItem>;
|
7
|
-
}
|
8
|
-
export default function GroupItemsWindow(props: IProps): JSX.Element;
|
9
|
-
export {};
|
1
|
+
import * as React from 'react';
|
2
|
+
import { SystemCenter } from '@gpa-gemstone/application-typings';
|
3
|
+
import { IGenericSlice } from '../SliceInterfaces';
|
4
|
+
interface IProps {
|
5
|
+
Record: SystemCenter.Types.ValueListGroup;
|
6
|
+
ValueListItemSlice: IGenericSlice<SystemCenter.Types.ValueListItem>;
|
7
|
+
}
|
8
|
+
export default function GroupItemsWindow(props: IProps): React.JSX.Element;
|
9
|
+
export {};
|