@datarailsshared/datarailsshared 1.4.179 → 1.4.181

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.
@@ -45,7 +45,7 @@ $dr-color-background-status-regular: #F0F1F4;
45
45
  $dr-color-status-error: #BF1D30;
46
46
  $dr-color-status-info: #0B5AF9;
47
47
  $dr-color-status-warning: #FFB800;
48
- $dr-color-status-success: #03A678;
48
+ $dr-color-status-success: #037C5A;
49
49
  $dr-color-status-progress: #4646CE;
50
50
  $dr-color-status-regular: #7E828E;
51
51
 
@@ -441,17 +441,17 @@
441
441
  return _this;
442
442
  }
443
443
  ForecastTagComponent.prototype.initDate = function () {
444
- var dateVal = new Date();
445
- if (this.defaultValue) {
446
- dateVal = new Date(this.defaultValue * 1000);
447
- }
444
+ var dateVal = this.defaultValue ? moment$8.unix(this.defaultValue) : moment$8();
448
445
  var fiscal_year_starts_from = this.fiscalYearStartsFrom || 1;
449
446
  var fiscal_year_back = this.fiscalYearBack || false;
450
447
  this.forecastValue = this.getFiscalMonthFromDate(dateVal, fiscal_year_starts_from) - 1;
451
448
  var fiscal_year = this.getFiscalYearFromDate(dateVal, fiscal_year_starts_from, fiscal_year_back);
452
- this.dateObj.date = moment$8(new Date(fiscal_year, 0, 1)).unix();
449
+ this.updateYear(fiscal_year, this.forecastValue);
453
450
  this.updateLockedDate();
454
451
  };
452
+ ForecastTagComponent.prototype.updateYear = function (fiscalYear, month) {
453
+ this.dateObj.date = fiscalYear ? moment$8((month || '01') + "/01/" + fiscalYear + " 12:00:00", 'MM/DD/YYYY hh:mm:ss').utc().unix() : moment$8.utc().unix();
454
+ };
455
455
  ForecastTagComponent.prototype.updateLockedDate = function () {
456
456
  var e_1, _a;
457
457
  var year = moment$8.unix(this.dateObj.date).year();
@@ -489,31 +489,29 @@
489
489
  for (var i = 1; i < fiscal_year_starts_from; i++) {
490
490
  all_months.push(i);
491
491
  }
492
- return all_months.indexOf(dateObj.getMonth() + 1) + 1;
492
+ return all_months.indexOf(dateObj.month() + 1) + 1;
493
493
  };
494
494
  ForecastTagComponent.prototype.getFiscalYearFromDate = function (dateObj, fiscal_year_starts_from, fiscal_year_back) {
495
- var fiscal_year = dateObj.getFullYear();
495
+ var fiscal_year = dateObj.year();
496
496
  if (!fiscal_year_back) {
497
- if (dateObj.getMonth() + 1 >= fiscal_year_starts_from && fiscal_year_starts_from !== 1) {
497
+ if (dateObj.month() + 1 >= fiscal_year_starts_from && fiscal_year_starts_from !== 1) {
498
498
  fiscal_year += 1;
499
499
  }
500
500
  }
501
501
  else {
502
- if (dateObj.getMonth() + 1 < fiscal_year_starts_from && fiscal_year_starts_from !== 1) {
502
+ if (dateObj.month() + 1 < fiscal_year_starts_from && fiscal_year_starts_from !== 1) {
503
503
  fiscal_year -= 1;
504
504
  }
505
505
  }
506
506
  return fiscal_year;
507
507
  };
508
508
  ForecastTagComponent.prototype.getForecastLabelFromValue = function (value, fiscal_year_starts_from, fiscal_year_back) {
509
- var label = '';
510
- if (value) {
511
- var dateObj = new Date(value * 1000);
512
- var fiscal_month = this.getFiscalMonthFromDate(dateObj, fiscal_year_starts_from);
513
- var fiscal_year = this.getFiscalYearFromDate(dateObj, fiscal_year_starts_from, fiscal_year_back);
514
- label = (fiscal_month - 1) + '+' + (13 - fiscal_month) + ' (' + fiscal_year + ')';
515
- }
516
- return label;
509
+ if (!value)
510
+ return '';
511
+ var dateObj = moment$8.unix(value);
512
+ var fiscal_month = this.getFiscalMonthFromDate(dateObj, fiscal_year_starts_from);
513
+ var fiscal_year = this.getFiscalYearFromDate(dateObj, fiscal_year_starts_from, fiscal_year_back);
514
+ return fiscal_month + "+" + (12 - fiscal_month) + " (" + fiscal_year + ")";
517
515
  };
518
516
  ForecastTagComponent.prototype.changeTagInputHandler = function (event) {
519
517
  this.chosenTagHandler();
@@ -528,23 +526,22 @@
528
526
  return;
529
527
  var month = this.forecastValue;
530
528
  var year = moment$8.unix(this.dateObj.date).year();
531
- var timeStampVal = 0;
532
529
  var label = '';
533
530
  if (!Number.isNaN(month) && !Number.isNaN(year)) {
534
- var date = new Date(year, month, 1, 12, 0, 0, 0);
531
+ var date = moment$8(month + "/01/" + year + " 12:00:00", 'MM/DD/YYYY hh:mm:ss');
535
532
  var fiscal_year_starts_from = this.fiscalYearStartsFrom || 1;
536
533
  var fiscal_year_back = this.fiscalYearBack || false;
537
534
  if (fiscal_year_starts_from !== 1) {
538
535
  if (!fiscal_year_back) {
539
- date.setMonth(date.getMonth() - 13 + fiscal_year_starts_from);
536
+ date.set('month', date.month() - 13 + fiscal_year_starts_from);
540
537
  }
541
538
  else {
542
- date.setMonth(date.getMonth() - 1 + fiscal_year_starts_from);
539
+ date.set('month', date.month() - 1 + fiscal_year_starts_from);
543
540
  }
544
541
  }
545
- timeStampVal = date.getTime() / 1000;
546
- label = this.getForecastLabelFromValue(timeStampVal, fiscal_year_starts_from, fiscal_year_back);
547
- this.dateObj.date = timeStampVal;
542
+ label = this.getForecastLabelFromValue(date.unix(), fiscal_year_starts_from, fiscal_year_back);
543
+ var fiscal_year = this.getFiscalYearFromDate(date, fiscal_year_starts_from, fiscal_year_back);
544
+ this.updateYear(fiscal_year, month);
548
545
  this.isDateEventHappened = true;
549
546
  setTimeout(function () {
550
547
  _this.isDateEventHappened = false;
@@ -552,9 +549,9 @@
552
549
  }
553
550
  var resultTag = {
554
551
  name: this.name,
555
- value: timeStampVal,
552
+ value: this.dateObj.date,
556
553
  label: label,
557
- locked: !this.dateFilter(moment$8.unix(timeStampVal))
554
+ locked: !this.dateFilter(moment$8.unix(this.dateObj.date))
558
555
  };
559
556
  this.dateChange.emit(resultTag);
560
557
  };
@@ -7076,7 +7073,7 @@
7076
7073
  template: "<div class=\"badge-status\" [drTooltip]=\"tooltip\"\n [ngClass]=\"'badge-status--' + theme\">\n <i *ngIf=\"icon\" class=\"{{ icon }}\"></i>\n <span *ngIf=\"label\">{{ label }}</span>\n</div>\n",
7077
7074
  selector: 'dr-badge-status',
7078
7075
  encapsulation: i0.ViewEncapsulation.None,
7079
- styles: [".badge-status{display:flex;align-items:center;font-family:\"Poppins\",sans-serif;font-style:normal;font-size:\"Poppins\",sans-serif;font-weight:12px;line-height:20px;font-weight:600;height:24px;padding:2px 8px 2px 4px;border-radius:4px;cursor:pointer}.badge-status i{font-size:20px;margin-right:4px}.badge-status--info{color:#0b5af9;background:#E6EFFF}.badge-status--error{color:#bf1d30;background:#F7D9DC}.badge-status--warning{color:#ffb800;background:#FFEDBF}.badge-status--success{color:#03a678;background:#DBF5E6}.badge-status--regular{color:#7e828e;background:#F0F1F4}.badge-status--progress{color:#4646ce;background:#F2F2FB}.badge-status--dotted{color:#7e828e;background:transparent}.badge-status--dotted i{display:none}\n"]
7076
+ styles: [".badge-status{display:flex;align-items:center;font-family:\"Poppins\",sans-serif;font-style:normal;font-size:\"Poppins\",sans-serif;font-weight:12px;line-height:20px;font-weight:600;height:24px;padding:2px 8px 2px 4px;border-radius:4px;cursor:pointer}.badge-status i{font-size:20px;margin-right:4px}.badge-status--info{color:#0b5af9;background:#E6EFFF}.badge-status--error{color:#bf1d30;background:#F7D9DC}.badge-status--warning{color:#ffb800;background:#FFEDBF}.badge-status--success{color:#037c5a;background:#DBF5E6}.badge-status--regular{color:#7e828e;background:#F0F1F4}.badge-status--progress{color:#4646ce;background:#F2F2FB}.badge-status--dotted{color:#7e828e;background:transparent}.badge-status--dotted i{display:none}\n"]
7080
7077
  },] }
7081
7078
  ];
7082
7079
  DrBadgeStatusComponent.ctorParameters = function () { return []; };