@gpa-gemstone/common-pages 0.0.151 → 0.0.153
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/BulkUpload.d.ts +1 -11
- package/lib/ErrorBoundary.d.ts +2 -2
- package/lib/EventCharacteristicFilter.d.ts +1 -2
- package/lib/EventTypeFilter.d.ts +1 -2
- package/lib/Gemstone/ControllerFunctions.d.ts +22 -0
- package/lib/Gemstone/ControllerFunctions.js +266 -0
- package/lib/Gemstone/Gemstone.d.ts +18 -0
- package/lib/Gemstone/Gemstone.js +41 -0
- package/lib/Gemstone/GenericSlices/ReadOnlyGenericSlice.d.ts +51 -0
- package/lib/Gemstone/GenericSlices/ReadOnlyGenericSlice.js +230 -0
- package/lib/Gemstone/GenericSlices/ReadWriteGenericSlice.d.ts +19 -0
- package/lib/Gemstone/GenericSlices/ReadWriteGenericSlice.js +241 -0
- package/lib/Gemstone/GenericSlices/useInitializeData.d.ts +10 -0
- package/lib/Gemstone/GenericSlices/useInitializeData.js +65 -0
- package/lib/NavBarFilterButton.d.ts +1 -2
- package/lib/Note.d.ts +1 -1
- package/lib/Note.js +1 -1
- package/lib/RoleAcessErrorPage.d.ts +1 -1
- package/lib/SearchBar.d.ts +6 -6
- package/lib/SelectionPopup.d.ts +6 -6
- package/lib/StandardSelectPopup.d.ts +1 -1
- package/lib/TimeFilter/QuickSelects.d.ts +1 -2
- package/lib/TimeFilter/StartEndFilter/DateFilter.d.ts +1 -2
- package/lib/TimeFilter/StartEndFilter/DateTimeLocalFilter.d.ts +1 -2
- package/lib/TimeFilter/StartEndFilter/StartEndFilter.d.ts +1 -1
- package/lib/TimeFilter/StartEndFilter/TimeFilter.d.ts +1 -2
- package/lib/TimeFilter/TimeFilter.d.ts +9 -2
- package/lib/TimeFilter/TimeFilter.js +30 -15
- package/lib/TimeFilter/WindowFilter/WindowFilter.d.ts +1 -2
- package/lib/TimeFilter/WindowFilter/WindowForm.d.ts +1 -2
- package/lib/index.d.ts +8 -1
- package/lib/index.js +12 -1
- package/package.json +13 -8
package/lib/SelectionPopup.d.ts
CHANGED
@@ -25,16 +25,16 @@ interface IOptions {
|
|
25
25
|
/** This Implements a few standardized Selection Popups */
|
26
26
|
export declare namespace DefaultSelects {
|
27
27
|
/** This Implements a standard Meter Selection Modal */
|
28
|
-
function Meter(props: IProps<SystemCenter.Types.DetailedMeter>):
|
28
|
+
function Meter(props: IProps<SystemCenter.Types.DetailedMeter>): JSX.Element;
|
29
29
|
/** This Implements a standard Substation Selection Modal */
|
30
|
-
function Location(props: IProps<SystemCenter.Types.DetailedLocation>):
|
30
|
+
function Location(props: IProps<SystemCenter.Types.DetailedLocation>): JSX.Element;
|
31
31
|
/** This Implements a standard Transmission Asset Selection Modal */
|
32
|
-
function Asset(props: IProps<SystemCenter.Types.DetailedAsset>):
|
32
|
+
function Asset(props: IProps<SystemCenter.Types.DetailedAsset>): JSX.Element;
|
33
33
|
/** This Implements a standard Asset Group Selection Modal */
|
34
|
-
function AssetGroup(props: IProps<OpenXDA.Types.AssetGroup>):
|
34
|
+
function AssetGroup(props: IProps<OpenXDA.Types.AssetGroup>): JSX.Element;
|
35
35
|
/** This Implements a standard User Selection Modal */
|
36
|
-
function User(props: IProps<Application.Types.iUserAccount>):
|
36
|
+
function User(props: IProps<Application.Types.iUserAccount>): JSX.Element;
|
37
37
|
/** This Implements a standard Customer Selection Modal */
|
38
|
-
function Customer(props: IProps<OpenXDA.Types.Customer>):
|
38
|
+
function Customer(props: IProps<OpenXDA.Types.Customer>): JSX.Element;
|
39
39
|
}
|
40
40
|
export {};
|
@@ -14,5 +14,5 @@ interface IProps<T extends U> {
|
|
14
14
|
MinSelection?: number;
|
15
15
|
children?: React.ReactNode;
|
16
16
|
}
|
17
|
-
export default function SelectPopup<T extends U>(props: IProps<T>):
|
17
|
+
export default function SelectPopup<T extends U>(props: IProps<T>): JSX.Element;
|
18
18
|
export {};
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
1
|
import { DateTimeSetting, ITimeFilter } from './TimeFilter';
|
3
2
|
import { TimeUnit } from './TimeWindowUtils';
|
4
3
|
export type DateUnit = ('datetime-local' | 'date' | 'time');
|
@@ -18,7 +17,7 @@ interface IProps {
|
|
18
17
|
AddRowContainer?: boolean;
|
19
18
|
SplitSelects?: boolean;
|
20
19
|
}
|
21
|
-
declare const QuickSelects: (props: IProps) =>
|
20
|
+
declare const QuickSelects: (props: IProps) => JSX.Element;
|
22
21
|
export default QuickSelects;
|
23
22
|
export declare function getFormat(format?: DateUnit): "MM/DD/YYYY HH:mm:ss.SSS" | "YYYY-MM-DD" | "HH:mm:ss.SSS";
|
24
23
|
export declare const AvailableQuickSelects: IQuickSelect[];
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
1
|
import { IFilterProps } from './StartEndFilter';
|
3
|
-
declare const DateTimeLocalFilter: (props: IFilterProps) =>
|
2
|
+
declare const DateTimeLocalFilter: (props: IFilterProps) => JSX.Element;
|
4
3
|
export default DateTimeLocalFilter;
|
@@ -17,5 +17,5 @@ export interface IFilterProps {
|
|
17
17
|
ShowQuickSelects: boolean;
|
18
18
|
ContainerWidth: number;
|
19
19
|
}
|
20
|
-
declare const StartEndFilter: (props: IFilterProps) =>
|
20
|
+
declare const StartEndFilter: (props: IFilterProps) => JSX.Element;
|
21
21
|
export default StartEndFilter;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
1
|
import { IStartEnd, IStartDuration, IEndDuration, TimeUnit } from './TimeWindowUtils';
|
3
2
|
import { DateUnit } from './QuickSelects';
|
4
3
|
import { Gemstone } from '@gpa-gemstone/application-typings';
|
@@ -48,7 +47,15 @@ interface IProps {
|
|
48
47
|
* Flag to toggle usage of helper message
|
49
48
|
*/
|
50
49
|
showHelpMessage?: boolean;
|
50
|
+
/**
|
51
|
+
* Optional Flag to enable collapsing of TimeFilter
|
52
|
+
*/
|
53
|
+
enableCollapse?: boolean;
|
54
|
+
/**
|
55
|
+
* Optional setter to push collapse state to parent
|
56
|
+
*/
|
57
|
+
setCollapsed?: (collapsed: boolean) => void;
|
51
58
|
}
|
52
|
-
declare const TimeFilter: (props: IProps) =>
|
59
|
+
declare const TimeFilter: (props: IProps) => JSX.Element;
|
53
60
|
export declare function getTimeWindowFromFilter(flt: ITimeFilter, format?: string): ITimeWindow;
|
54
61
|
export default TimeFilter;
|
@@ -58,38 +58,53 @@ var lodash_1 = __importDefault(require("lodash"));
|
|
58
58
|
var StartEndFilter_1 = __importDefault(require("./StartEndFilter/StartEndFilter"));
|
59
59
|
var helper_functions_1 = require("@gpa-gemstone/helper-functions");
|
60
60
|
var WindowFilter_1 = __importDefault(require("./WindowFilter/WindowFilter"));
|
61
|
+
var gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
|
61
62
|
var TimeFilter = function (props) {
|
62
|
-
var _a, _b, _c, _d;
|
63
|
+
var _a, _b, _c, _d, _e;
|
63
64
|
var containerRef = React.useRef(null);
|
64
65
|
var width = (0, helper_functions_1.useGetContainerPosition)(containerRef).width;
|
65
66
|
var format = (0, QuickSelects_1.getFormat)(props.format);
|
66
|
-
var
|
67
|
-
var
|
68
|
-
|
69
|
-
|
70
|
-
var flt = getTimeWindowFromFilter(timeFilter, format);
|
71
|
-
return lodash_1.default.isEqual(timeWindow, flt);
|
72
|
-
}
|
67
|
+
var _f = React.useState(-1), activeQuickSelect = _f[0], setActiveQuickSelect = _f[1];
|
68
|
+
var _g = React.useState(getTimeWindowFromFilter(props.filter, format)), filter = _g[0], setFilter = _g[1];
|
69
|
+
var _h = React.useState(false), collapsed = _h[0], setCollapsed = _h[1];
|
70
|
+
//Effect to set parent filter when internal filter changes
|
73
71
|
React.useEffect(function () {
|
74
72
|
if (!isEqual(filter, props.filter)) {
|
75
73
|
props.setFilter(filter.start, filter.end, filter.unit, filter.duration);
|
76
74
|
}
|
77
75
|
}, [filter]);
|
76
|
+
//Effect to sync filter if external filter changes
|
78
77
|
React.useEffect(function () {
|
79
78
|
if (!isEqual(filter, props.filter)) {
|
80
79
|
var flt = getTimeWindowFromFilter(props.filter, format);
|
81
80
|
setFilter(flt);
|
82
81
|
}
|
83
82
|
}, [props.filter]);
|
83
|
+
//Effect to push collapse state to parent
|
84
|
+
React.useEffect(function () {
|
85
|
+
if (props.setCollapsed == null)
|
86
|
+
return;
|
87
|
+
props.setCollapsed(collapsed);
|
88
|
+
}, [collapsed]);
|
89
|
+
// Checks typing of ITimeFilter and then compares to ITimeWindow
|
90
|
+
var isEqual = function (timeWindow, timeFilter) {
|
91
|
+
var flt = getTimeWindowFromFilter(timeFilter, format);
|
92
|
+
return lodash_1.default.isEqual(timeWindow, flt);
|
93
|
+
};
|
84
94
|
var helpMessaage = ((_a = props.showHelpMessage) !== null && _a !== void 0 ? _a : true) ? "All times shown are in system time (".concat(props.timeZone, ").") : undefined;
|
85
95
|
return (React.createElement("fieldset", { className: "border", style: { padding: '10px', height: '100%', overflow: 'hidden' }, ref: containerRef },
|
86
|
-
React.createElement("legend", { className: "w-auto", style: { fontSize: 'large' } },
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
96
|
+
React.createElement("legend", { className: "w-auto", style: { fontSize: 'large' } },
|
97
|
+
React.createElement("div", { className: "d-flex align-items-center" },
|
98
|
+
React.createElement("span", { className: "mr-2" }, "Date/Time Filter:"),
|
99
|
+
((_b = props.enableCollapse) !== null && _b !== void 0 ? _b : false) ?
|
100
|
+
React.createElement("button", { type: "button", className: "btn p-0 ml-auto", onClick: function () { return setCollapsed(function (x) { return !x; }); } }, collapsed ? React.createElement(gpa_symbols_1.ReactIcons.ArrowDropDown, null) : React.createElement(gpa_symbols_1.ReactIcons.ArrowDropUp, null)) : null)),
|
101
|
+
collapsed ? null :
|
102
|
+
props.dateTimeSetting === 'startEnd' ?
|
103
|
+
React.createElement(StartEndFilter_1.default, { TimeWindowFilter: filter, SetTimeWindowFilter: setFilter, Timezone: props.timeZone, ActiveQP: activeQuickSelect, SetActiveQP: setActiveQuickSelect, SetFilter: props.setFilter, Accuracy: props.accuracy, Format: format, DateUnit: (_c = props.format) !== null && _c !== void 0 ? _c : 'datetime-local', ShowQuickSelects: props.showQuickSelect, ContainerWidth: width, HelpMessage: helpMessaage })
|
104
|
+
: props.dateTimeSetting === 'startWindow' ?
|
105
|
+
React.createElement(WindowFilter_1.default, { TimeWindowFilter: filter, SetTimeWindowFilter: setFilter, Timezone: props.timeZone, ActiveQP: activeQuickSelect, SetActiveQP: setActiveQuickSelect, SetFilter: props.setFilter, Accuracy: props.accuracy, Format: format, DateUnit: (_d = props.format) !== null && _d !== void 0 ? _d : 'datetime-local', ShowQuickSelects: props.showQuickSelect, ContainerWidth: width, HelpMessage: helpMessaage, Window: 'start' })
|
106
|
+
:
|
107
|
+
React.createElement(WindowFilter_1.default, { TimeWindowFilter: filter, SetTimeWindowFilter: setFilter, Timezone: props.timeZone, ActiveQP: activeQuickSelect, SetActiveQP: setActiveQuickSelect, SetFilter: props.setFilter, Accuracy: props.accuracy, Format: format, DateUnit: (_e = props.format) !== null && _e !== void 0 ? _e : 'datetime-local', ShowQuickSelects: props.showQuickSelect, ContainerWidth: width, HelpMessage: helpMessaage, Window: 'end' })));
|
93
108
|
};
|
94
109
|
// Converts ITimeFilter to an ITimeWindow filter
|
95
110
|
function getTimeWindowFromFilter(flt, format) {
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import * as React from 'react';
|
2
1
|
import { IFilterProps } from '../StartEndFilter/StartEndFilter';
|
3
2
|
import { Window } from './WindowForm';
|
4
3
|
export interface IProps extends IFilterProps {
|
5
4
|
Window: Window;
|
6
5
|
}
|
7
|
-
declare const WindowFilter: (props: IProps) =>
|
6
|
+
declare const WindowFilter: (props: IProps) => JSX.Element;
|
8
7
|
export default WindowFilter;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import * as React from 'react';
|
2
1
|
import { ITimeWindow } from '../TimeFilter';
|
3
2
|
export type Window = "start" | "end";
|
4
3
|
export interface IProps {
|
@@ -9,5 +8,5 @@ export interface IProps {
|
|
9
8
|
ShowQuickSelect: boolean;
|
10
9
|
Window: Window;
|
11
10
|
}
|
12
|
-
declare const WindowForm: (props: IProps) =>
|
11
|
+
declare const WindowForm: (props: IProps) => JSX.Element;
|
13
12
|
export default WindowForm;
|
package/lib/index.d.ts
CHANGED
@@ -12,7 +12,14 @@ import * as TimeWindowUtils from './TimeFilter/TimeWindowUtils';
|
|
12
12
|
import BulkUpload from './BulkUpload';
|
13
13
|
import RoleAccessErrorPage from './RoleAcessErrorPage';
|
14
14
|
import { useCSVFieldEditContext, CSVFieldEditContext } from './Pipelines/CSVPipeline/CSVFieldContext';
|
15
|
+
import { ITimeFilter } from './TimeFilter/TimeFilter';
|
16
|
+
import { IStartDuration, IStartEnd, IEndDuration } from './TimeFilter/TimeWindowUtils';
|
17
|
+
import { Gemstone } from './Gemstone/Gemstone';
|
18
|
+
import ReadOnlyGenericSlice from './Gemstone/GenericSlices/ReadOnlyGenericSlice';
|
19
|
+
import ReadWriteGenericSlice from './Gemstone/GenericSlices/ReadWriteGenericSlice';
|
20
|
+
import { useInitializeWithFetch } from './Gemstone/GenericSlices/useInitializeData';
|
21
|
+
import { ReadOnlyControllerFunctions, ReadWriteControllerFunctions } from './Gemstone/ControllerFunctions';
|
15
22
|
declare const Pipelines: {
|
16
23
|
CSV: typeof useCSVPipeline;
|
17
24
|
};
|
18
|
-
export { TimeFilter, TimeWindowUtils, EventTypeFilter, EventCharacteristicFilter, NavBarFilterButton, Note, DefaultSearch, SelectPopup, DefaultSelects, ErrorBoundary, Pipelines, useCSVFieldEditContext, CSVFieldEditContext, BulkUpload, RoleAccessErrorPage };
|
25
|
+
export { TimeFilter, TimeWindowUtils, EventTypeFilter, EventCharacteristicFilter, NavBarFilterButton, Note, DefaultSearch, SelectPopup, DefaultSelects, ErrorBoundary, Pipelines, useCSVFieldEditContext, CSVFieldEditContext, BulkUpload, RoleAccessErrorPage, ITimeFilter, IStartEnd, IStartDuration, IEndDuration, Gemstone, ReadOnlyGenericSlice as ReadOnlyGenericSlice_Gemstone, ReadWriteGenericSlice as ReadWriteGenericSlice_Gemstone, useInitializeWithFetch as useInitializeWithFetch_Gemstone, ReadOnlyControllerFunctions as ReadOnlyControllerFunctions_Gemstone, ReadWriteControllerFunctions as ReadWriteControllerFunctions_Gemstone };
|
package/lib/index.js
CHANGED
@@ -48,7 +48,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
49
49
|
};
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
51
|
-
exports.RoleAccessErrorPage = exports.BulkUpload = exports.CSVFieldEditContext = exports.useCSVFieldEditContext = exports.Pipelines = exports.ErrorBoundary = exports.DefaultSelects = exports.SelectPopup = exports.DefaultSearch = exports.Note = exports.NavBarFilterButton = exports.EventCharacteristicFilter = exports.EventTypeFilter = exports.TimeWindowUtils = exports.TimeFilter = void 0;
|
51
|
+
exports.ReadWriteControllerFunctions_Gemstone = exports.ReadOnlyControllerFunctions_Gemstone = exports.useInitializeWithFetch_Gemstone = exports.ReadWriteGenericSlice_Gemstone = exports.ReadOnlyGenericSlice_Gemstone = exports.Gemstone = exports.RoleAccessErrorPage = exports.BulkUpload = exports.CSVFieldEditContext = exports.useCSVFieldEditContext = exports.Pipelines = exports.ErrorBoundary = exports.DefaultSelects = exports.SelectPopup = exports.DefaultSearch = exports.Note = exports.NavBarFilterButton = exports.EventCharacteristicFilter = exports.EventTypeFilter = exports.TimeWindowUtils = exports.TimeFilter = void 0;
|
52
52
|
var Note_1 = __importDefault(require("./Note"));
|
53
53
|
exports.Note = Note_1.default;
|
54
54
|
var SearchBar_1 = require("./SearchBar");
|
@@ -77,6 +77,17 @@ exports.RoleAccessErrorPage = RoleAcessErrorPage_1.default;
|
|
77
77
|
var CSVFieldContext_1 = require("./Pipelines/CSVPipeline/CSVFieldContext");
|
78
78
|
Object.defineProperty(exports, "useCSVFieldEditContext", { enumerable: true, get: function () { return CSVFieldContext_1.useCSVFieldEditContext; } });
|
79
79
|
Object.defineProperty(exports, "CSVFieldEditContext", { enumerable: true, get: function () { return CSVFieldContext_1.CSVFieldEditContext; } });
|
80
|
+
var Gemstone_1 = require("./Gemstone/Gemstone");
|
81
|
+
Object.defineProperty(exports, "Gemstone", { enumerable: true, get: function () { return Gemstone_1.Gemstone; } });
|
82
|
+
var ReadOnlyGenericSlice_1 = __importDefault(require("./Gemstone/GenericSlices/ReadOnlyGenericSlice"));
|
83
|
+
exports.ReadOnlyGenericSlice_Gemstone = ReadOnlyGenericSlice_1.default;
|
84
|
+
var ReadWriteGenericSlice_1 = __importDefault(require("./Gemstone/GenericSlices/ReadWriteGenericSlice"));
|
85
|
+
exports.ReadWriteGenericSlice_Gemstone = ReadWriteGenericSlice_1.default;
|
86
|
+
var useInitializeData_1 = require("./Gemstone/GenericSlices/useInitializeData");
|
87
|
+
Object.defineProperty(exports, "useInitializeWithFetch_Gemstone", { enumerable: true, get: function () { return useInitializeData_1.useInitializeWithFetch; } });
|
88
|
+
var ControllerFunctions_1 = require("./Gemstone/ControllerFunctions");
|
89
|
+
Object.defineProperty(exports, "ReadOnlyControllerFunctions_Gemstone", { enumerable: true, get: function () { return ControllerFunctions_1.ReadOnlyControllerFunctions; } });
|
90
|
+
Object.defineProperty(exports, "ReadWriteControllerFunctions_Gemstone", { enumerable: true, get: function () { return ControllerFunctions_1.ReadWriteControllerFunctions; } });
|
80
91
|
var Pipelines = {
|
81
92
|
CSV: CSVPipeline_1.useCSVPipeline
|
82
93
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gpa-gemstone/common-pages",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.153",
|
4
4
|
"description": "Common UI pages for GPA products",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "lib/index.d.ts",
|
@@ -35,6 +35,8 @@
|
|
35
35
|
"@types/crypto-js": "^4.2.0",
|
36
36
|
"@types/jest": "^27.0.0",
|
37
37
|
"@types/jquery": "3.5.6",
|
38
|
+
"@types/lodash": "^4.17.20",
|
39
|
+
"@types/react": "18.2.0",
|
38
40
|
"@typescript-eslint/eslint-plugin": "^5.60.0",
|
39
41
|
"@typescript-eslint/parser": "^5.60.0",
|
40
42
|
"eslint": "^8.43.0",
|
@@ -44,19 +46,22 @@
|
|
44
46
|
"typescript": "5.5.3"
|
45
47
|
},
|
46
48
|
"dependencies": {
|
47
|
-
"@gpa-gemstone/application-typings": "0.0.
|
48
|
-
"@gpa-gemstone/gpa-symbols": "0.0.
|
49
|
-
"@gpa-gemstone/helper-functions": "0.0.
|
50
|
-
"@gpa-gemstone/react-forms": "1.1.
|
51
|
-
"@gpa-gemstone/react-interactive": "1.0.
|
52
|
-
"@gpa-gemstone/react-table": "1.2.
|
49
|
+
"@gpa-gemstone/application-typings": "0.0.90",
|
50
|
+
"@gpa-gemstone/gpa-symbols": "0.0.57",
|
51
|
+
"@gpa-gemstone/helper-functions": "0.0.48",
|
52
|
+
"@gpa-gemstone/react-forms": "1.1.102",
|
53
|
+
"@gpa-gemstone/react-interactive": "1.0.164",
|
54
|
+
"@gpa-gemstone/react-table": "1.2.87",
|
53
55
|
"@reduxjs/toolkit": "1.8.3",
|
54
56
|
"crypto-js": "^4.2.0",
|
55
57
|
"moment": "^2.29.4",
|
56
58
|
"moment-timezone": "0.5.43",
|
57
|
-
"react": "^18.2.0",
|
58
59
|
"react-redux": "8.0.2",
|
59
60
|
"styled-components": "5.3.3"
|
60
61
|
},
|
62
|
+
"peerDependencies": {
|
63
|
+
"react": "18.2.0",
|
64
|
+
"react-dom": "18.2.0"
|
65
|
+
},
|
61
66
|
"publishConfig": {"access": "public"}
|
62
67
|
}
|