@gpa-gemstone/common-pages 0.0.104 → 0.0.105

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/lib/ErrorBoundary.d.ts +17 -17
  2. package/lib/ErrorBoundary.js +91 -68
  3. package/lib/Note.d.ts +22 -22
  4. package/lib/Note.js +256 -230
  5. package/lib/SearchBar.d.ts +37 -37
  6. package/lib/SearchBar.js +203 -180
  7. package/lib/SelectionPopup.d.ts +42 -42
  8. package/lib/SelectionPopup.js +93 -90
  9. package/lib/Setting.d.ts +8 -8
  10. package/lib/Setting.js +151 -125
  11. package/lib/SliceInterfaces.d.ts +76 -76
  12. package/lib/SliceInterfaces.js +2 -2
  13. package/lib/StandardSelectPopup.d.ts +20 -20
  14. package/lib/StandardSelectPopup.js +135 -109
  15. package/lib/TimeFilter/QuickSelects.d.ts +7 -0
  16. package/lib/TimeFilter/QuickSelects.js +240 -0
  17. package/lib/TimeFilter.d.ts +26 -0
  18. package/lib/TimeFilter.js +270 -0
  19. package/lib/TimeWindowUtils.d.ts +33 -0
  20. package/lib/TimeWindowUtils.js +121 -0
  21. package/lib/ValueList/ByValueList.d.ts +10 -10
  22. package/lib/ValueList/ByValueList.js +141 -115
  23. package/lib/ValueList/Group.d.ts +11 -11
  24. package/lib/ValueList/Group.js +97 -71
  25. package/lib/ValueList/GroupForm.d.ts +9 -9
  26. package/lib/ValueList/GroupForm.js +74 -51
  27. package/lib/ValueList/GroupInfo.d.ts +8 -8
  28. package/lib/ValueList/GroupInfo.js +95 -69
  29. package/lib/ValueList/GroupItem.d.ts +9 -9
  30. package/lib/ValueList/GroupItem.js +142 -116
  31. package/lib/ValueList/ItemForm.d.ts +9 -9
  32. package/lib/ValueList/ItemForm.js +82 -59
  33. package/lib/index.d.ts +12 -11
  34. package/lib/index.js +50 -45
  35. package/lib/user/AdditionalField.d.ts +26 -26
  36. package/lib/user/AdditionalField.js +290 -264
  37. package/lib/user/ByUser.d.ts +12 -12
  38. package/lib/user/ByUser.js +174 -148
  39. package/lib/user/User.d.ts +14 -14
  40. package/lib/user/User.js +97 -71
  41. package/lib/user/UserForm.d.ts +12 -12
  42. package/lib/user/UserForm.js +166 -143
  43. package/lib/user/UserInfo.d.ts +7 -7
  44. package/lib/user/UserInfo.js +123 -97
  45. package/lib/user/UserPermissions.d.ts +8 -8
  46. package/lib/user/UserPermissions.js +106 -83
  47. package/package.json +9 -8
@@ -1,9 +1,9 @@
1
- /// <reference types="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): 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.defineProperty(exports, "__esModule", { value: true });
24
- var React = require("react");
25
- var react_forms_1 = require("@gpa-gemstone/react-forms");
26
- function GroupForm(props) {
27
- var _a = React.useState([]), errors = _a[0], setErrors = _a[1];
28
- React.useEffect(function () {
29
- var e = [];
30
- if (props.Record.Name == null || props.Record.Name.length === 0)
31
- e.push('A Name is required.');
32
- if (props.Record.Name != null && props.Record.Name.length > 200)
33
- e.push('Name has to be less than 200 characters.');
34
- setErrors(e);
35
- }, [props.Record]);
36
- React.useEffect(function () {
37
- if (props.ErrorSetter !== undefined)
38
- props.ErrorSetter(errors);
39
- }, [errors, props.ErrorSetter]);
40
- function Valid(field) {
41
- if (field === 'Name')
42
- return props.Record.Name != null && props.Record.Name.length > 0 && props.Record.Name.length <= 200;
43
- else if (field === 'Description')
44
- return true;
45
- return false;
46
- }
47
- return (React.createElement("form", null,
48
- React.createElement(react_forms_1.Input, { Record: props.Record, Field: 'Name', Feedback: 'Name must be less than 200 characters.', Valid: Valid, Setter: props.Setter }),
49
- React.createElement(react_forms_1.TextArea, { Rows: 3, Record: props.Record, Field: 'Description', Valid: Valid, Setter: props.Setter })));
50
- }
51
- exports.default = GroupForm;
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
- /// <reference types="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) => 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.defineProperty(exports, "__esModule", { value: true });
24
- var React = require("react");
25
- var GroupForm_1 = require("./GroupForm");
26
- var react_interactive_1 = require("@gpa-gemstone/react-interactive");
27
- var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
28
- var InfoWindow = function (props) {
29
- var _a = React.useState(props.Record), record = _a[0], setRecord = _a[1];
30
- var _b = React.useState([]), errors = _b[0], setErrors = _b[1];
31
- var _c = React.useState([]), warnings = _c[0], setWarnings = _c[1];
32
- var _d = React.useState('None'), hover = _d[0], setHover = _d[1];
33
- React.useEffect(function () {
34
- var w = [];
35
- if (record == null)
36
- return;
37
- if (record.Name !== props.Record.Name)
38
- w.push('Changes to Name will be lost.');
39
- if (record.Description !== props.Record.Description)
40
- w.push('Changes to Description will be lost.');
41
- setWarnings(w);
42
- }, [props.Record, record]);
43
- if (record == null)
44
- return null;
45
- return (React.createElement("div", { className: "card", style: { marginBottom: 10 } },
46
- React.createElement("div", { className: "card-header" },
47
- React.createElement("div", { className: "row" },
48
- React.createElement("div", { className: "col" },
49
- React.createElement("h4", null, "Value List Group Information:")))),
50
- React.createElement("div", { className: "card-body" },
51
- React.createElement(GroupForm_1.default, { Record: record, Setter: function (r) { return setRecord(r); }, ErrorSetter: setErrors })),
52
- React.createElement("div", { className: "card-footer" },
53
- React.createElement("div", { className: "btn-group mr-2" },
54
- React.createElement("button", { className: "btn btn-primary" + (errors.length > 0 || warnings.length === 0 ? ' disabled' : ''), onClick: function () {
55
- if (errors.length === 0 && warnings.length > 0)
56
- props.Setter(record);
57
- }, hidden: record.ID === 0, "data-tooltip": 'Update', onMouseEnter: function () { return setHover('Update'); }, onMouseLeave: function () { return setHover('None'); } }, "Update")),
58
- 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 },
59
- gpa_symbols_1.CrossMark,
60
- " ",
61
- t); })),
62
- React.createElement("div", { className: "btn-group mr-2" },
63
- 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")),
64
- 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 },
65
- gpa_symbols_1.Warning,
66
- " ",
67
- t); })))));
68
- };
69
- exports.default = InfoWindow;
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
- /// <reference types="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): 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 {};