@gpa-gemstone/common-pages 0.0.52 → 0.0.54
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/SearchBar.d.ts +1 -0
- package/lib/SearchBar.js +6 -6
- package/lib/SelectionPopup.d.ts +1 -0
- package/lib/SelectionPopup.js +6 -6
- package/package.json +3 -3
package/lib/SearchBar.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ interface IProps<T extends U> {
|
|
|
12
12
|
/** Function that Grabs any additional Filters that shoudl be available (such as Addl Fields) */
|
|
13
13
|
GetAddlFields: (setAddlFields: (cols: Search.IField<T>[]) => void) => () => void;
|
|
14
14
|
children: React.ReactNode;
|
|
15
|
+
AddlFilters?: Search.IFilter<T>[];
|
|
15
16
|
}
|
|
16
17
|
interface IOptions {
|
|
17
18
|
Value: string;
|
package/lib/SearchBar.js
CHANGED
|
@@ -59,7 +59,7 @@ var DefaultSearch;
|
|
|
59
59
|
return props.GetAddlFields(setAddlFieldCols);
|
|
60
60
|
}, []);
|
|
61
61
|
var standardSearch = { label: 'Name', key: 'Name', type: 'string', isPivotField: false };
|
|
62
|
-
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Meter(s)', GetEnum: props.GetEnum }, props.children);
|
|
62
|
+
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: (props.AddlFilters === undefined ? flds : __spreadArray(__spreadArray([], flds, true), props.AddlFilters, true)), sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Meter(s)', GetEnum: props.GetEnum }, props.children);
|
|
63
63
|
}
|
|
64
64
|
DefaultSearch.Meter = Meter;
|
|
65
65
|
/** This Implements a standard Substation Search */
|
|
@@ -83,7 +83,7 @@ var DefaultSearch;
|
|
|
83
83
|
React.useEffect(function () {
|
|
84
84
|
return props.GetAddlFields(setAddlFieldCols);
|
|
85
85
|
}, []);
|
|
86
|
-
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Substation(s)', GetEnum: props.GetEnum }, props.children);
|
|
86
|
+
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: (props.AddlFilters === undefined ? flds : __spreadArray(__spreadArray([], flds, true), props.AddlFilters, true)), sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Substation(s)', GetEnum: props.GetEnum }, props.children);
|
|
87
87
|
}
|
|
88
88
|
DefaultSearch.Location = Location;
|
|
89
89
|
/** This Implements a standard Transmission Asset Search */
|
|
@@ -108,7 +108,7 @@ var DefaultSearch;
|
|
|
108
108
|
React.useEffect(function () {
|
|
109
109
|
return props.GetAddlFields(setAddlFieldCols);
|
|
110
110
|
}, []);
|
|
111
|
-
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Transmission Asset(s)', GetEnum: props.GetEnum }, props.children);
|
|
111
|
+
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: (props.AddlFilters === undefined ? flds : __spreadArray(__spreadArray([], flds, true), props.AddlFilters, true)), sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Transmission Asset(s)', GetEnum: props.GetEnum }, props.children);
|
|
112
112
|
}
|
|
113
113
|
DefaultSearch.Asset = Asset;
|
|
114
114
|
/** This Implements a standard AssetGroup Search */
|
|
@@ -130,7 +130,7 @@ var DefaultSearch;
|
|
|
130
130
|
React.useEffect(function () {
|
|
131
131
|
return props.GetAddlFields(setAddlFieldCols);
|
|
132
132
|
}, []);
|
|
133
|
-
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Asset Group(s)', GetEnum: props.GetEnum }, props.children);
|
|
133
|
+
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: (props.AddlFilters === undefined ? flds : __spreadArray(__spreadArray([], flds, true), props.AddlFilters, true)), sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Asset Group(s)', GetEnum: props.GetEnum }, props.children);
|
|
134
134
|
}
|
|
135
135
|
DefaultSearch.AssetGroup = AssetGroup;
|
|
136
136
|
/** This Implements a standard User Search */
|
|
@@ -150,7 +150,7 @@ var DefaultSearch;
|
|
|
150
150
|
React.useEffect(function () {
|
|
151
151
|
return props.GetAddlFields(setAddlFieldCols);
|
|
152
152
|
}, []);
|
|
153
|
-
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Asset Group(s)', GetEnum: props.GetEnum }, props.children);
|
|
153
|
+
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: (props.AddlFilters === undefined ? flds : __spreadArray(__spreadArray([], flds, true), props.AddlFilters, true)), sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Asset Group(s)', GetEnum: props.GetEnum }, props.children);
|
|
154
154
|
}
|
|
155
155
|
DefaultSearch.User = User;
|
|
156
156
|
/** This Implements a standard Customer Search */
|
|
@@ -171,7 +171,7 @@ var DefaultSearch;
|
|
|
171
171
|
React.useEffect(function () {
|
|
172
172
|
return props.GetAddlFields(setAddlFieldCols);
|
|
173
173
|
}, []);
|
|
174
|
-
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Customer(s)', GetEnum: props.GetEnum }, props.children);
|
|
174
|
+
return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: (props.AddlFilters === undefined ? flds : __spreadArray(__spreadArray([], flds, true), props.AddlFilters, true)), sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Customer(s)', GetEnum: props.GetEnum }, props.children);
|
|
175
175
|
}
|
|
176
176
|
DefaultSearch.Customer = Customer;
|
|
177
177
|
})(DefaultSearch = exports.DefaultSearch || (exports.DefaultSearch = {}));
|
package/lib/SelectionPopup.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ interface IProps<T extends U> {
|
|
|
15
15
|
Title: string;
|
|
16
16
|
GetEnum: (setOptions: (options: IOptions[]) => void, field: Search.IField<T>) => () => void;
|
|
17
17
|
GetAddlFields: (setAddlFields: (cols: Search.IField<T>[]) => void) => () => void;
|
|
18
|
+
AddlFilters?: Search.IFilter<T>[];
|
|
18
19
|
MinSelection?: number;
|
|
19
20
|
}
|
|
20
21
|
interface IOptions {
|
package/lib/SelectionPopup.js
CHANGED
|
@@ -41,32 +41,32 @@ var DefaultSelects;
|
|
|
41
41
|
(function (DefaultSelects) {
|
|
42
42
|
/** This Implements a standard Meter Selection Modal */
|
|
43
43
|
function Meter(props) {
|
|
44
|
-
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Meter, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
|
|
44
|
+
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Meter, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum, AddlFilters: props.AddlFilters }, children); } }));
|
|
45
45
|
}
|
|
46
46
|
DefaultSelects.Meter = Meter;
|
|
47
47
|
/** This Implements a standard Substation Selection Modal */
|
|
48
48
|
function Location(props) {
|
|
49
|
-
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Location, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
|
|
49
|
+
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Location, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum, AddlFilters: props.AddlFilters }, children); } }));
|
|
50
50
|
}
|
|
51
51
|
DefaultSelects.Location = Location;
|
|
52
52
|
/** This Implements a standard Transmission Asset Selection Modal */
|
|
53
53
|
function Asset(props) {
|
|
54
|
-
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Asset, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
|
|
54
|
+
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Asset, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum, AddlFilters: props.AddlFilters }, children); } }));
|
|
55
55
|
}
|
|
56
56
|
DefaultSelects.Asset = Asset;
|
|
57
57
|
/** This Implements a standard Asset Group Selection Modal */
|
|
58
58
|
function AssetGroup(props) {
|
|
59
|
-
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.AssetGroup, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
|
|
59
|
+
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.AssetGroup, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum, AddlFilters: props.AddlFilters }, children); } }));
|
|
60
60
|
}
|
|
61
61
|
DefaultSelects.AssetGroup = AssetGroup;
|
|
62
62
|
/** This Implements a standard User Selection Modal */
|
|
63
63
|
function User(props) {
|
|
64
|
-
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.User, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
|
|
64
|
+
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.User, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum, AddlFilters: props.AddlFilters }, children); } }));
|
|
65
65
|
}
|
|
66
66
|
DefaultSelects.User = User;
|
|
67
67
|
/** This Implements a standard Customer Selection Modal */
|
|
68
68
|
function Customer(props) {
|
|
69
|
-
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Customer, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
|
|
69
|
+
return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Customer, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum, AddlFilters: props.AddlFilters }, children); } }));
|
|
70
70
|
}
|
|
71
71
|
DefaultSelects.Customer = Customer;
|
|
72
72
|
})(DefaultSelects = exports.DefaultSelects || (exports.DefaultSelects = {}));
|
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.54",
|
|
4
4
|
"description": "Common UI pages for GPA products",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@gpa-gemstone/application-typings": "0.0.49",
|
|
51
51
|
"@gpa-gemstone/gpa-symbols": "0.0.23",
|
|
52
52
|
"@gpa-gemstone/helper-functions": "0.0.17",
|
|
53
|
-
"@gpa-gemstone/react-forms": "1.1.
|
|
54
|
-
"@gpa-gemstone/react-interactive": "1.0.
|
|
53
|
+
"@gpa-gemstone/react-forms": "1.1.31",
|
|
54
|
+
"@gpa-gemstone/react-interactive": "1.0.68",
|
|
55
55
|
"@gpa-gemstone/react-table": "1.2.19",
|
|
56
56
|
"@reduxjs/toolkit": "1.8.3",
|
|
57
57
|
"crypto-js": "4.0.0",
|