@datarailsshared/datarailsshared 1.4.295 → 1.4.296

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.
@@ -425,18 +425,18 @@
425
425
  _this.forecastValue = undefined;
426
426
  _this.isDateEventHappened = false;
427
427
  _this.forecastTags = [
428
- { value: 0, label: '0+12' },
429
- { value: 1, label: '1+11' },
430
- { value: 2, label: '2+10' },
431
- { value: 3, label: '3+9' },
432
- { value: 4, label: '4+8' },
433
- { value: 5, label: '5+7' },
434
- { value: 6, label: '6+6' },
435
- { value: 7, label: '7+5' },
436
- { value: 8, label: '8+4' },
437
- { value: 9, label: '9+3' },
438
- { value: 10, label: '10+2' },
439
- { value: 11, label: '11+1' }
428
+ { value: 0, label: '0+12', disabled: false },
429
+ { value: 1, label: '1+11', disabled: false },
430
+ { value: 2, label: '2+10', disabled: false },
431
+ { value: 3, label: '3+9', disabled: false },
432
+ { value: 4, label: '4+8', disabled: false },
433
+ { value: 5, label: '5+7', disabled: false },
434
+ { value: 6, label: '6+6', disabled: false },
435
+ { value: 7, label: '7+5', disabled: false },
436
+ { value: 8, label: '8+4', disabled: false },
437
+ { value: 9, label: '9+3', disabled: false },
438
+ { value: 10, label: '10+2', disabled: false },
439
+ { value: 11, label: '11+1', disabled: false }
440
440
  ];
441
441
  _this.initDateValue = null;
442
442
  return _this;
@@ -465,28 +465,15 @@
465
465
  : moment$8.utc().unix();
466
466
  };
467
467
  ForecastTagComponent.prototype.updateLockedDate = function () {
468
- var e_1, _b;
468
+ var _this = this;
469
469
  var year = moment$8.unix(this.dateObj.date).year();
470
- var _loop_1 = function (forecastTag) {
471
- forecastTag.disabled = this_1.lockedDate.some(function (timestamp) {
470
+ this.forecastTags = this.forecastTags.map(function (forecastTag) {
471
+ forecastTag.disabled = _this.lockedDate.some(function (timestamp) {
472
472
  var locked = moment$8.unix(timestamp);
473
473
  return locked.month() === forecastTag.value && +locked.year() === +year;
474
474
  });
475
- };
476
- var this_1 = this;
477
- try {
478
- for (var _c = __values(this.forecastTags), _d = _c.next(); !_d.done; _d = _c.next()) {
479
- var forecastTag = _d.value;
480
- _loop_1(forecastTag);
481
- }
482
- }
483
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
484
- finally {
485
- try {
486
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
487
- }
488
- finally { if (e_1) throw e_1.error; }
489
- }
475
+ return forecastTag;
476
+ });
490
477
  };
491
478
  ForecastTagComponent.prototype.initName = function () {
492
479
  if (!this.name) {
@@ -696,14 +683,24 @@
696
683
  enumerable: false,
697
684
  configurable: true
698
685
  });
686
+ QuarterTagComponent.prototype.ngOnChanges = function () {
687
+ this.initTags();
688
+ };
699
689
  QuarterTagComponent.prototype.ngOnInit = function () {
700
- var e_1, _a;
701
690
  this.initName();
691
+ this.initTags();
692
+ };
693
+ QuarterTagComponent.prototype.initName = function () {
694
+ if (!this.name) {
695
+ this.name = 'Quarter';
696
+ }
697
+ };
698
+ QuarterTagComponent.prototype.initTags = function () {
699
+ var e_1, _a;
702
700
  this.quarters = this.getQuarterOptions();
703
701
  try {
704
702
  for (var _b = __values(this.quarters), _c = _b.next(); !_c.done; _c = _b.next()) {
705
703
  var quarter = _c.value;
706
- quarter.disabled = false;
707
704
  if (quarter.isSelected) {
708
705
  this.selectedValue = quarter;
709
706
  this.chosenTagHandler(quarter);
@@ -719,11 +716,6 @@
719
716
  finally { if (e_1) throw e_1.error; }
720
717
  }
721
718
  };
722
- QuarterTagComponent.prototype.initName = function () {
723
- if (!this.name) {
724
- this.name = 'Quarter';
725
- }
726
- };
727
719
  QuarterTagComponent.prototype.chosenTagHandler = function (quarter) {
728
720
  var resultDate = moment$6.unix(quarter.value);
729
721
  var resultTag = {
@@ -758,6 +750,7 @@
758
750
  value: tempValue / 1000,
759
751
  label: this.getQuarterLabel(tempValue),
760
752
  isSelected: (i === 0),
753
+ disabled: false,
761
754
  });
762
755
  }
763
756
  return to_return;
@@ -774,7 +767,7 @@
774
767
  var quarterDate = moment$6.unix(quarter.value);
775
768
  return !this.lockedDate.some(function (timestamp) {
776
769
  var lockDate = moment$6.unix(timestamp);
777
- if (lockDate.year() === quarterDate.year() && lockDate.month() === quarterDate.month()) {
770
+ if (lockDate.year() === quarterDate.year() && lockDate.quarter() === quarterDate.quarter()) {
778
771
  quarter.disabled = true;
779
772
  return true;
780
773
  }