@dexteel/mesf-core 4.7.11 → 4.8.0
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/CHANGELOG.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -39,6 +39,7 @@ import CreateIcon from '@material-ui/icons/Create';
|
|
|
39
39
|
import DeleteIcon from '@material-ui/icons/Delete';
|
|
40
40
|
import LockIcon from '@material-ui/icons/Lock';
|
|
41
41
|
import { ArrowRight, ChevronLeft, ChevronRight } from '@material-ui/icons';
|
|
42
|
+
import SkipNextIcon from '@material-ui/icons/SkipNext';
|
|
42
43
|
import { Line } from 'react-chartjs-2';
|
|
43
44
|
import PersonPinCircleIcon from '@material-ui/icons/PersonPinCircle';
|
|
44
45
|
import PropTypes from 'prop-types';
|
|
@@ -11323,19 +11324,33 @@ var CustomOptionsComponent = function (_a) {
|
|
|
11323
11324
|
"Stepped"))));
|
|
11324
11325
|
};
|
|
11325
11326
|
|
|
11326
|
-
var dateNavigator = function (startDate, endDate, scope, operator) {
|
|
11327
|
-
if (
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11327
|
+
var dateNavigator = function (startDate, endDate, scope, operator, current) {
|
|
11328
|
+
if (current === void 0) { current = false; }
|
|
11329
|
+
var newStartDate;
|
|
11330
|
+
var newEndDate = endDate;
|
|
11331
|
+
if (current) {
|
|
11332
|
+
newEndDate = new Date();
|
|
11333
|
+
if (scope === "custom") {
|
|
11334
|
+
// If scope is custom, keep the same startDate
|
|
11335
|
+
newStartDate = startDate;
|
|
11336
|
+
}
|
|
11337
|
+
else {
|
|
11338
|
+
var _a = scope.split(" "), quantity = _a[0], duration = _a[1];
|
|
11339
|
+
newStartDate = moment(newEndDate).subtract(quantity, duration[0]).toDate();
|
|
11340
|
+
}
|
|
11332
11341
|
}
|
|
11333
11342
|
else {
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11343
|
+
if (scope === "custom") {
|
|
11344
|
+
var durationInMs = moment(endDate).diff(moment(startDate));
|
|
11345
|
+
newStartDate = moment(startDate)[operator](durationInMs).toDate();
|
|
11346
|
+
}
|
|
11347
|
+
else {
|
|
11348
|
+
var _b = scope.split(" "), quantity = _b[0], duration = _b[1];
|
|
11349
|
+
newStartDate = moment(startDate)[operator](quantity, duration[0]).toDate();
|
|
11350
|
+
newEndDate = moment(endDate)[operator](quantity, duration[0]).toDate();
|
|
11351
|
+
}
|
|
11338
11352
|
}
|
|
11353
|
+
return { newStartDate: newStartDate, newEndDate: newEndDate };
|
|
11339
11354
|
};
|
|
11340
11355
|
|
|
11341
11356
|
var Header = function (_a) {
|
|
@@ -11346,8 +11361,9 @@ var Header = function (_a) {
|
|
|
11346
11361
|
showGrid: true,
|
|
11347
11362
|
stepped: false
|
|
11348
11363
|
}), customOptions = _c[0], setCustomOptions = _c[1];
|
|
11349
|
-
var handleDateNavigator = function (operator) {
|
|
11350
|
-
|
|
11364
|
+
var handleDateNavigator = function (operator, current) {
|
|
11365
|
+
if (current === void 0) { current = false; }
|
|
11366
|
+
var newDates = dateNavigator(state.timeScopeStart, state.timeScopeEnd, state.scope, operator, current);
|
|
11351
11367
|
if (newDates) {
|
|
11352
11368
|
actions.setTotalScope({ start: newDates.newStartDate, end: newDates.newEndDate, scope: state.scope });
|
|
11353
11369
|
}
|
|
@@ -11414,7 +11430,10 @@ var Header = function (_a) {
|
|
|
11414
11430
|
} })),
|
|
11415
11431
|
React__default.createElement(Grid$1, { item: true },
|
|
11416
11432
|
React__default.createElement(IconButton$1, { onClick: function () { return handleDateNavigator("add"); }, className: "".concat(classes.navigatorButton) },
|
|
11417
|
-
React__default.createElement(ChevronRight, { fontSize: "large" })))
|
|
11433
|
+
React__default.createElement(ChevronRight, { fontSize: "large" }))),
|
|
11434
|
+
React__default.createElement(Grid$1, { item: true },
|
|
11435
|
+
React__default.createElement(IconButton$1, { onClick: function () { return handleDateNavigator("subtract", true); }, className: "".concat(classes.navigatorButton) },
|
|
11436
|
+
React__default.createElement(SkipNextIcon, { fontSize: "large" })))),
|
|
11418
11437
|
React__default.createElement(Grid$1, { md: 6, item: true, container: true, justifyContent: "space-between" },
|
|
11419
11438
|
React__default.createElement(Grid$1, { item: true, container: true, wrap: "nowrap", spacing: 1 },
|
|
11420
11439
|
React__default.createElement(Grid$1, { item: true, container: true },
|