@gpa-gemstone/common-pages 0.0.183 → 0.0.184
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/TimeFilter/QuickSelects.d.ts +1 -2
- package/lib/TimeFilter/QuickSelects.js +3 -15
- package/lib/TimeFilter/StartEndFilter/DateFilter.js +2 -3
- package/lib/TimeFilter/StartEndFilter/DateTimeLocalFilter.js +5 -4
- package/lib/TimeFilter/StartEndFilter/TimeFilter.js +2 -2
- package/lib/TimeFilter/WindowFilter/WindowFilter.js +3 -4
- package/lib/TimeFilter/WindowFilter/WindowForm.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITimeFilter } from './TimeFilter';
|
|
2
2
|
import { Gemstone } from '@gpa-gemstone/application-typings';
|
|
3
3
|
import { TimeUnit } from './TimeWindowUtils';
|
|
4
4
|
interface IQuickSelect {
|
|
@@ -7,7 +7,6 @@ interface IQuickSelect {
|
|
|
7
7
|
createFilter: (timeZone: string, format?: Gemstone.TSX.Types.DateUnit) => ITimeFilter;
|
|
8
8
|
}
|
|
9
9
|
interface IProps {
|
|
10
|
-
DateTimeSetting: DateTimeSetting;
|
|
11
10
|
Format?: "YYYY-MM-DD" | "HH:mm:ss.SSS" | "MM/DD/YYYY HH:mm:ss.SSS";
|
|
12
11
|
DateUnit?: Gemstone.TSX.Types.DateUnit;
|
|
13
12
|
QuickSelectRange?: Gemstone.TSX.Types.QuickSelectRange;
|
|
@@ -63,9 +63,9 @@ var QuickSelects = function (props) {
|
|
|
63
63
|
var _a;
|
|
64
64
|
if (i % 3 !== 0)
|
|
65
65
|
return null;
|
|
66
|
-
return (React.createElement("div", { key: i, className:
|
|
67
|
-
paddingLeft:
|
|
68
|
-
paddingRight:
|
|
66
|
+
return (React.createElement("div", { key: i, className: ((_a = props.SplitSelects) !== null && _a !== void 0 ? _a : false) ? 'col-4' : 'col-2', style: {
|
|
67
|
+
paddingLeft: 0,
|
|
68
|
+
paddingRight: 2,
|
|
69
69
|
marginTop: 10
|
|
70
70
|
} },
|
|
71
71
|
React.createElement("ul", { className: "list-group", key: i },
|
|
@@ -107,18 +107,6 @@ function getQuickSelectRange(dateUnit) {
|
|
|
107
107
|
if (dateUnit === 'date')
|
|
108
108
|
return 'long';
|
|
109
109
|
}
|
|
110
|
-
var getColSize = function (dateTimeSetting, splitSelects) {
|
|
111
|
-
if (dateTimeSetting === 'startEnd') {
|
|
112
|
-
if (splitSelects)
|
|
113
|
-
return 'col-4';
|
|
114
|
-
else
|
|
115
|
-
return 'col-2';
|
|
116
|
-
}
|
|
117
|
-
if (splitSelects)
|
|
118
|
-
return 'col-8';
|
|
119
|
-
else
|
|
120
|
-
return 'col-4';
|
|
121
|
-
};
|
|
122
110
|
//update all quick selects to use new timefilters
|
|
123
111
|
exports.AvailableQuickSelects = [
|
|
124
112
|
{
|
|
@@ -51,7 +51,6 @@ var QuickSelects_1 = __importStar(require("../QuickSelects"));
|
|
|
51
51
|
var DateFilter = function (props) {
|
|
52
52
|
var _a, _b;
|
|
53
53
|
var FirstFallbackBreakpoint = 1050;
|
|
54
|
-
var SecondFallbackBreakpoint = 541;
|
|
55
54
|
var FirstFallbackBreakpointNoQS = 375;
|
|
56
55
|
var handleSetTimeWindowFilter = React.useCallback(function (record) {
|
|
57
56
|
var flt = (0, TimeFilter_1.getTimeWindowFromFilter)({ start: record.start, end: record.end }, props.Format);
|
|
@@ -80,7 +79,7 @@ var DateFilter = function (props) {
|
|
|
80
79
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "end", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'End', Type: props.DateUnit, Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy })),
|
|
81
80
|
props.ShowQuickSelects ?
|
|
82
81
|
React.createElement("div", { className: quickSelectClass },
|
|
83
|
-
React.createElement(QuickSelects_1.default, {
|
|
82
|
+
React.createElement(QuickSelects_1.default, { Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_a = props.QuickSelectRange) !== null && _a !== void 0 ? _a : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })) : null));
|
|
84
83
|
else
|
|
85
84
|
return (React.createElement(React.Fragment, null,
|
|
86
85
|
React.createElement("div", { className: 'row m-0' },
|
|
@@ -90,6 +89,6 @@ var DateFilter = function (props) {
|
|
|
90
89
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "end", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'End', Type: props.DateUnit, Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy }))),
|
|
91
90
|
props.ShowQuickSelects ?
|
|
92
91
|
React.createElement("div", { className: quickSelectClass },
|
|
93
|
-
React.createElement(QuickSelects_1.default, {
|
|
92
|
+
React.createElement(QuickSelects_1.default, { Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, SplitSelects: true, QuickSelectRange: (_b = props.QuickSelectRange) !== null && _b !== void 0 ? _b : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })) : null));
|
|
94
93
|
};
|
|
95
94
|
exports.default = DateFilter;
|
|
@@ -53,6 +53,7 @@ var DateTimeLocalFilter = function (props) {
|
|
|
53
53
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
54
54
|
var FirstFallbackBreakpointQS = 1768;
|
|
55
55
|
var SecondFallbackBreakpointQS = 612, FirstFallbacKBreakpointNoQS = 612;
|
|
56
|
+
var ModalBreakpointQS = 450;
|
|
56
57
|
var _k = React.useState(false), showQuickPickModal = _k[0], setShowQuickPickModal = _k[1];
|
|
57
58
|
var handleSetTimeWindowFilter = React.useCallback(function (record) {
|
|
58
59
|
var flt = (0, TimeFilter_1.getTimeWindowFromFilter)({ start: record.start, end: record.end }, props.Format);
|
|
@@ -86,9 +87,9 @@ var DateTimeLocalFilter = function (props) {
|
|
|
86
87
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "end", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'End', Type: (_b = props.DateUnit) !== null && _b !== void 0 ? _b : 'datetime-local', Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy })),
|
|
87
88
|
props.ShowQuickSelects ?
|
|
88
89
|
React.createElement("div", { className: quickSelectCol },
|
|
89
|
-
React.createElement(QuickSelects_1.default, {
|
|
90
|
+
React.createElement(QuickSelects_1.default, { Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_c = props.QuickSelectRange) !== null && _c !== void 0 ? _c : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })) : null));
|
|
90
91
|
}
|
|
91
|
-
else if (props.ContainerWidth >
|
|
92
|
+
else if (props.ContainerWidth > ModalBreakpointQS) {
|
|
92
93
|
return (React.createElement("div", { className: 'row m-0' },
|
|
93
94
|
React.createElement("div", { className: startEndCol },
|
|
94
95
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "start", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'Start', Type: (_d = props.DateUnit) !== null && _d !== void 0 ? _d : 'datetime-local', Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy })),
|
|
@@ -96,7 +97,7 @@ var DateTimeLocalFilter = function (props) {
|
|
|
96
97
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "end", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'End', Type: (_e = props.DateUnit) !== null && _e !== void 0 ? _e : 'datetime-local', Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy })),
|
|
97
98
|
React.createElement("div", { className: 'row m-0 w-100' }, props.ShowQuickSelects ?
|
|
98
99
|
React.createElement("div", { className: quickSelectCol },
|
|
99
|
-
React.createElement(QuickSelects_1.default, {
|
|
100
|
+
React.createElement(QuickSelects_1.default, { SplitSelects: true, Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_f = props.QuickSelectRange) !== null && _f !== void 0 ? _f : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) }))
|
|
100
101
|
: null)));
|
|
101
102
|
}
|
|
102
103
|
else {
|
|
@@ -111,7 +112,7 @@ var DateTimeLocalFilter = function (props) {
|
|
|
111
112
|
React.createElement("button", { className: 'btn btn-primary w-100', onClick: function () { return setShowQuickPickModal(true); } }, "Quick Selects")),
|
|
112
113
|
React.createElement(react_interactive_1.Modal, { Show: showQuickPickModal, Title: 'Quick Selects', CallBack: function () { return setShowQuickPickModal(false); }, ShowX: true, ShowCancel: false, ShowConfirm: false, Size: 'xlg' },
|
|
113
114
|
React.createElement("div", { className: quickSelectCol },
|
|
114
|
-
React.createElement(QuickSelects_1.default, {
|
|
115
|
+
React.createElement(QuickSelects_1.default, { SplitSelects: true, Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_j = props.QuickSelectRange) !== null && _j !== void 0 ? _j : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) }))))
|
|
115
116
|
: null));
|
|
116
117
|
}
|
|
117
118
|
};
|
|
@@ -75,7 +75,7 @@ var TimeFilter = function (props) {
|
|
|
75
75
|
React.createElement("div", { className: startEndCol },
|
|
76
76
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "end", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'End', Type: props.DateUnit, Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy })),
|
|
77
77
|
props.ShowQuickSelects ?
|
|
78
|
-
React.createElement(QuickSelects_1.default, {
|
|
78
|
+
React.createElement(QuickSelects_1.default, { Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, AddRowContainer: false, QuickSelectRange: (_a = props.QuickSelectRange) !== null && _a !== void 0 ? _a : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })
|
|
79
79
|
: null));
|
|
80
80
|
else
|
|
81
81
|
return (React.createElement(React.Fragment, null,
|
|
@@ -85,7 +85,7 @@ var TimeFilter = function (props) {
|
|
|
85
85
|
React.createElement("div", { className: startEndCol },
|
|
86
86
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: "end", Help: props.HelpMessage, Setter: handleSetTimeWindowFilter, Label: 'End', Type: props.DateUnit, Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy }))),
|
|
87
87
|
props.ShowQuickSelects ?
|
|
88
|
-
React.createElement(QuickSelects_1.default, {
|
|
88
|
+
React.createElement(QuickSelects_1.default, { Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, SplitSelects: true, QuickSelectRange: (_b = props.QuickSelectRange) !== null && _b !== void 0 ? _b : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })
|
|
89
89
|
: null));
|
|
90
90
|
};
|
|
91
91
|
exports.default = TimeFilter;
|
|
@@ -58,7 +58,6 @@ var WindowFilter = function (props) {
|
|
|
58
58
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
59
59
|
var DatePickerField = props.Window;
|
|
60
60
|
var DatePickerLabel = props.Window.charAt(0).toUpperCase() + props.Window.slice(1);
|
|
61
|
-
var filterType = props.Window === 'start' ? 'startWindow' : 'endWindow';
|
|
62
61
|
var setter = React.useCallback(function (record) {
|
|
63
62
|
if (props.Window === 'start') {
|
|
64
63
|
var flt = (0, TimeFilter_1.getTimeWindowFromFilter)({ start: record.start, duration: record.duration, unit: record.unit }, props.Format);
|
|
@@ -83,7 +82,7 @@ var WindowFilter = function (props) {
|
|
|
83
82
|
React.createElement(react_forms_1.DatePicker, { Record: props.TimeWindowFilter, Field: DatePickerField, Help: props.HelpMessage, Setter: setter, Label: DatePickerLabel, Type: (_b = props.DateUnit) !== null && _b !== void 0 ? _b : 'datetime-local', Valid: function () { return true; }, Format: props.Format, Accuracy: props.Accuracy }),
|
|
84
83
|
React.createElement(WindowForm_1.default, { Filter: props.TimeWindowFilter, SetFilter: props.SetTimeWindowFilter, SetActiveQP: props.SetActiveQP, Format: props.Format, ShowQuickSelect: props.ShowQuickSelects, Window: props.Window })),
|
|
85
84
|
React.createElement("div", { className: 'col-8 pt-3' },
|
|
86
|
-
React.createElement(QuickSelects_1.default, {
|
|
85
|
+
React.createElement(QuickSelects_1.default, { SplitSelects: true, Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_c = props.QuickSelectRange) !== null && _c !== void 0 ? _c : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) }))));
|
|
87
86
|
else if (props.ContainerWidth > WINDOW_SecondFallbackBreakpoint) {
|
|
88
87
|
return (React.createElement(React.Fragment, null,
|
|
89
88
|
React.createElement("div", { className: 'row m-0' },
|
|
@@ -93,7 +92,7 @@ var WindowFilter = function (props) {
|
|
|
93
92
|
React.createElement(WindowForm_1.default, { Filter: props.TimeWindowFilter, SetFilter: props.SetTimeWindowFilter, SetActiveQP: props.SetActiveQP, Format: props.Format, ShowQuickSelect: props.ShowQuickSelects, Window: props.Window }))),
|
|
94
93
|
React.createElement("div", { className: 'row m-0' },
|
|
95
94
|
React.createElement("div", { className: 'col-12' },
|
|
96
|
-
React.createElement(QuickSelects_1.default, {
|
|
95
|
+
React.createElement(QuickSelects_1.default, { SplitSelects: true, Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_e = props.QuickSelectRange) !== null && _e !== void 0 ? _e : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })))));
|
|
97
96
|
}
|
|
98
97
|
else {
|
|
99
98
|
return (React.createElement(React.Fragment, null,
|
|
@@ -105,7 +104,7 @@ var WindowFilter = function (props) {
|
|
|
105
104
|
React.createElement(WindowForm_1.default, { Filter: props.TimeWindowFilter, SetFilter: props.SetTimeWindowFilter, SetActiveQP: props.SetActiveQP, Format: props.Format, ShowQuickSelect: props.ShowQuickSelects, Window: props.Window }))),
|
|
106
105
|
React.createElement("div", { className: 'row m-0' },
|
|
107
106
|
React.createElement("div", { className: 'col-12' },
|
|
108
|
-
React.createElement(QuickSelects_1.default, {
|
|
107
|
+
React.createElement(QuickSelects_1.default, { SplitSelects: true, Timezone: props.Timezone, ActiveQP: props.ActiveQP, SetActiveQP: props.SetActiveQP, SetFilter: props.SetFilter, Format: props.Format, DateUnit: props.DateUnit, QuickSelectRange: (_g = props.QuickSelectRange) !== null && _g !== void 0 ? _g : (0, QuickSelects_1.getQuickSelectRange)(props.DateUnit) })))));
|
|
109
108
|
}
|
|
110
109
|
};
|
|
111
110
|
exports.default = WindowFilter;
|
|
@@ -59,7 +59,7 @@ var WindowForm = function (props) {
|
|
|
59
59
|
props.SetActiveQP(-1);
|
|
60
60
|
}
|
|
61
61
|
}, [props.Window, props.Format, props.SetActiveQP, props.SetActiveQP]);
|
|
62
|
-
return (React.createElement("div", { className: 'form-group' },
|
|
62
|
+
return (React.createElement("div", { className: 'form-group', style: { marginBottom: 0 } },
|
|
63
63
|
React.createElement("label", { style: { width: '100%', position: 'relative', float: "left" } },
|
|
64
64
|
"Span(",
|
|
65
65
|
props.Window === 'start' ? '+' : '-',
|
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.184",
|
|
4
4
|
"description": "Common UI pages for GPA products",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"@gpa-gemstone/gpa-symbols": "0.0.64",
|
|
52
52
|
"@gpa-gemstone/helper-functions": "0.0.61",
|
|
53
53
|
"@gpa-gemstone/react-forms": "1.1.125",
|
|
54
|
-
"@gpa-gemstone/react-interactive": "1.0.
|
|
55
|
-
"@gpa-gemstone/react-table": "1.2.
|
|
54
|
+
"@gpa-gemstone/react-interactive": "1.0.193",
|
|
55
|
+
"@gpa-gemstone/react-table": "1.2.117",
|
|
56
56
|
"@reduxjs/toolkit": "1.8.3",
|
|
57
57
|
"crypto-js": "^4.2.0",
|
|
58
58
|
"moment": "^2.29.4",
|