@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
@@ -1,4 +1,7 @@
1
1
  # CHANGELOG
2
+ ## 4.8.0
3
+ - Trending: Fix when removing view tag bug (#184)
4
+ - Trending: Add new button to navigate to current date (#189 and #207)
2
5
  ## 4.7.11
3
6
  - Trending: Fix Unit column title bug
4
7
  ## 4.7.10
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 (scope === "custom") {
11328
- var durationInMs = moment(endDate).diff(moment(startDate));
11329
- var newStartDate = moment(startDate)[operator](durationInMs).toDate();
11330
- var newEndDate = moment(endDate)[operator](durationInMs).toDate();
11331
- return { newStartDate: newStartDate, newEndDate: newEndDate };
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
- var _a = scope.split(" "), quantity = _a[0], duration = _a[1];
11335
- var newStartDate = moment(startDate)[operator](quantity, duration[0]).toDate();
11336
- var newEndDate = moment(endDate)[operator](quantity, duration[0]).toDate();
11337
- return { newStartDate: newStartDate, newEndDate: newEndDate };
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
- var newDates = dateNavigator(state.timeScopeStart, state.timeScopeEnd, state.scope, operator);
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 },