@datarailsshared/datarailsshared 1.4.117 → 1.4.118
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/bundles/datarailsshared-datarailsshared.umd.js +336 -166
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.118.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.js +8 -1
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +49 -4
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +28 -4
- package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +49 -2
- package/esm2015/lib/dr-inputs/dr-inputs.module.js +6 -2
- package/esm2015/lib/models/constants.js +8 -1
- package/esm2015/lib/models/datePicker.js +8 -1
- package/esm2015/lib/utils/dr-shared-utils.js +20 -2
- package/fesm2015/datarailsshared-datarailsshared.js +308 -155
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.d.ts +12 -0
- package/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.d.ts +7 -1
- package/lib/dr-inputs/date-pickers/services/dr-date-picker.service.d.ts +9 -0
- package/lib/models/constants.d.ts +4 -0
- package/lib/models/datePicker.d.ts +6 -0
- package/lib/utils/dr-shared-utils.d.ts +1 -0
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.117.tgz +0 -0
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
// @ts-ignore
|
|
418
|
-
var moment$
|
|
418
|
+
var moment$9 = require('moment');
|
|
419
419
|
var ForecastTagComponent = /** @class */ (function (_super) {
|
|
420
420
|
__extends(ForecastTagComponent, _super);
|
|
421
421
|
function ForecastTagComponent() {
|
|
@@ -437,10 +437,10 @@
|
|
|
437
437
|
{ value: 11, label: '11+1' }
|
|
438
438
|
];
|
|
439
439
|
_this.dateFilter = function (date) {
|
|
440
|
-
var forecastDate = moment$
|
|
440
|
+
var forecastDate = moment$9.unix(date);
|
|
441
441
|
var status = true;
|
|
442
442
|
_this.lockedDate.forEach(function (timestamp) {
|
|
443
|
-
var locked = moment$
|
|
443
|
+
var locked = moment$9.unix(timestamp);
|
|
444
444
|
return status = !(locked.month() === forecastDate.month() && locked.year() === forecastDate.year());
|
|
445
445
|
});
|
|
446
446
|
return status;
|
|
@@ -457,7 +457,7 @@
|
|
|
457
457
|
this.forecastValue = this.getFiscalMonthFromDate(dateVal, fiscal_year_starts_from) - 1;
|
|
458
458
|
var fiscal_year = this.getFiscalYearFromDate(dateVal, fiscal_year_starts_from, fiscal_year_back);
|
|
459
459
|
console.log('test', dateVal, fiscal_year_starts_from, this.forecastValue, fiscal_year);
|
|
460
|
-
this.dateObj.date = moment$
|
|
460
|
+
this.dateObj.date = moment$9(new Date(fiscal_year, 0, 1)).format('YYYY');
|
|
461
461
|
this.updateLockedDate();
|
|
462
462
|
};
|
|
463
463
|
ForecastTagComponent.prototype.updateLockedDate = function () {
|
|
@@ -466,7 +466,7 @@
|
|
|
466
466
|
var _loop_1 = function (forecastTag) {
|
|
467
467
|
forecastTag.disable = false;
|
|
468
468
|
this_1.lockedDate.forEach(function (timestamp) {
|
|
469
|
-
var locked = moment$
|
|
469
|
+
var locked = moment$9.unix(timestamp);
|
|
470
470
|
if (locked.month() - 1 === forecastTag.value && +locked.year() + 1 === +_this.dateObj.date) {
|
|
471
471
|
forecastTag.disable = true;
|
|
472
472
|
}
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
};
|
|
578
578
|
|
|
579
579
|
// @ts-ignore
|
|
580
|
-
var moment$
|
|
580
|
+
var moment$8 = require('moment');
|
|
581
581
|
var MONTH_FORMATS = {
|
|
582
582
|
parse: {
|
|
583
583
|
dateInput: 'DD-MM-YYYY',
|
|
@@ -595,12 +595,12 @@
|
|
|
595
595
|
function MonthTagComponent() {
|
|
596
596
|
var _this = _super.call(this) || this;
|
|
597
597
|
_this.lockedDate = [];
|
|
598
|
-
_this.date = new forms.FormControl(moment$
|
|
598
|
+
_this.date = new forms.FormControl(moment$8());
|
|
599
599
|
_this.dateFilter = function (date) {
|
|
600
|
-
var calendarDate = moment$
|
|
600
|
+
var calendarDate = moment$8(date);
|
|
601
601
|
var status = true;
|
|
602
602
|
_this.lockedDate.forEach(function (timestamp) {
|
|
603
|
-
var lockDate = moment$
|
|
603
|
+
var lockDate = moment$8.unix(timestamp);
|
|
604
604
|
return status = !(lockDate.year() === calendarDate.year() && lockDate.month() === calendarDate.month());
|
|
605
605
|
});
|
|
606
606
|
return status;
|
|
@@ -609,11 +609,11 @@
|
|
|
609
609
|
}
|
|
610
610
|
MonthTagComponent.prototype.initDate = function () {
|
|
611
611
|
if (this.defaultValue) {
|
|
612
|
-
this.dateObj.date = moment$
|
|
613
|
-
this.date = new forms.FormControl(moment$
|
|
612
|
+
this.dateObj.date = moment$8(this.defaultValue * 1000).utc().format('YYYY-MM');
|
|
613
|
+
this.date = new forms.FormControl(moment$8(this.defaultValue * 1000));
|
|
614
614
|
}
|
|
615
615
|
else {
|
|
616
|
-
this.dateObj.date = moment$
|
|
616
|
+
this.dateObj.date = moment$8(new Date()).format('YYYY-MM');
|
|
617
617
|
}
|
|
618
618
|
};
|
|
619
619
|
MonthTagComponent.prototype.initName = function () {
|
|
@@ -622,7 +622,7 @@
|
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
624
|
MonthTagComponent.prototype.chosenTagHandler = function (value) {
|
|
625
|
-
var resultDate = moment$
|
|
625
|
+
var resultDate = moment$8.utc(value);
|
|
626
626
|
resultDate.hour(12);
|
|
627
627
|
var resultTag = {
|
|
628
628
|
name: this.name,
|
|
@@ -661,7 +661,7 @@
|
|
|
661
661
|
};
|
|
662
662
|
|
|
663
663
|
// @ts-ignore
|
|
664
|
-
var moment$
|
|
664
|
+
var moment$7 = require('moment');
|
|
665
665
|
var QuarterTagComponent = /** @class */ (function (_super) {
|
|
666
666
|
__extends(QuarterTagComponent, _super);
|
|
667
667
|
function QuarterTagComponent() {
|
|
@@ -672,8 +672,8 @@
|
|
|
672
672
|
_this.dateFilter = function (date) {
|
|
673
673
|
var status = true;
|
|
674
674
|
_this.lockedDate.forEach(function (timestamp) {
|
|
675
|
-
var lockDate = moment$
|
|
676
|
-
var quarterDate = moment$
|
|
675
|
+
var lockDate = moment$7.unix(timestamp);
|
|
676
|
+
var quarterDate = moment$7.unix(date.value);
|
|
677
677
|
if (lockDate.year() === quarterDate.year() && lockDate.month() === quarterDate.month()) {
|
|
678
678
|
date.disable = true;
|
|
679
679
|
status = false;
|
|
@@ -716,7 +716,7 @@
|
|
|
716
716
|
};
|
|
717
717
|
QuarterTagComponent.prototype.chosenTagHandler = function (value) {
|
|
718
718
|
var date = new Date(value * 1000);
|
|
719
|
-
var resultDate = moment$
|
|
719
|
+
var resultDate = moment$7.utc(date);
|
|
720
720
|
var resultTag = {
|
|
721
721
|
name: this.name,
|
|
722
722
|
value: parseInt(resultDate.format('X'), 10),
|
|
@@ -775,7 +775,7 @@
|
|
|
775
775
|
};
|
|
776
776
|
|
|
777
777
|
// @ts-ignore
|
|
778
|
-
var moment$
|
|
778
|
+
var moment$6 = require('moment');
|
|
779
779
|
var WEEK_FORMATS = {
|
|
780
780
|
parse: {
|
|
781
781
|
dateInput: 'WW-YYYY',
|
|
@@ -793,13 +793,13 @@
|
|
|
793
793
|
function WeekTagComponent() {
|
|
794
794
|
var _this = _super.call(this) || this;
|
|
795
795
|
_this.lockedDate = [];
|
|
796
|
-
_this.date = new forms.FormControl(moment$
|
|
796
|
+
_this.date = new forms.FormControl(moment$6());
|
|
797
797
|
_this.selectedValue = '';
|
|
798
798
|
_this.dateFilter = function (date) {
|
|
799
|
-
var calendarDate = moment$
|
|
799
|
+
var calendarDate = moment$6(date);
|
|
800
800
|
var status = true;
|
|
801
801
|
_this.lockedDate.forEach(function (timestamp) {
|
|
802
|
-
var lockDate = moment$
|
|
802
|
+
var lockDate = moment$6.unix(timestamp);
|
|
803
803
|
return status = !(lockDate.week() === calendarDate.week() && lockDate.year() === calendarDate.year());
|
|
804
804
|
});
|
|
805
805
|
return status;
|
|
@@ -830,7 +830,7 @@
|
|
|
830
830
|
}
|
|
831
831
|
};
|
|
832
832
|
WeekTagComponent.prototype.chosenDateHandler = function (normalizedDay) {
|
|
833
|
-
var date = moment$
|
|
833
|
+
var date = moment$6(normalizedDay).unix();
|
|
834
834
|
this.chosenTagHandler(date);
|
|
835
835
|
};
|
|
836
836
|
WeekTagComponent.prototype.chosenTagHandler = function (value) {
|
|
@@ -842,7 +842,7 @@
|
|
|
842
842
|
else {
|
|
843
843
|
date = new Date(value * 1000);
|
|
844
844
|
}
|
|
845
|
-
var resultDate = moment$
|
|
845
|
+
var resultDate = moment$6(date);
|
|
846
846
|
var resultTag = {
|
|
847
847
|
name: this.name,
|
|
848
848
|
value: parseInt(resultDate.format('X'), 10),
|
|
@@ -853,8 +853,8 @@
|
|
|
853
853
|
this.dateChange.emit(resultTag);
|
|
854
854
|
};
|
|
855
855
|
WeekTagComponent.prototype.getWeekLabel = function (date) {
|
|
856
|
-
return 'W' + this.pad(moment$
|
|
857
|
-
' ' + moment$
|
|
856
|
+
return 'W' + this.pad(moment$6(date).isoWeek(), 2) +
|
|
857
|
+
' ' + moment$6(date).year();
|
|
858
858
|
};
|
|
859
859
|
WeekTagComponent.prototype.getUTCTimestamp = function (date) {
|
|
860
860
|
return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0, 0);
|
|
@@ -867,7 +867,7 @@
|
|
|
867
867
|
return date;
|
|
868
868
|
};
|
|
869
869
|
WeekTagComponent.prototype.getWeekNumberByDate = function (date) {
|
|
870
|
-
return this.pad(moment$
|
|
870
|
+
return this.pad(moment$6(date).isoWeek(), 2);
|
|
871
871
|
};
|
|
872
872
|
WeekTagComponent.prototype.pad = function (n, width, z) {
|
|
873
873
|
if (z === void 0) { z = '0'; }
|
|
@@ -897,7 +897,7 @@
|
|
|
897
897
|
};
|
|
898
898
|
|
|
899
899
|
// @ts-ignore
|
|
900
|
-
var moment$
|
|
900
|
+
var moment$5 = require('moment');
|
|
901
901
|
var YEAR_FORMATS = {
|
|
902
902
|
parse: {
|
|
903
903
|
dateInput: 'YYYY',
|
|
@@ -915,12 +915,12 @@
|
|
|
915
915
|
function YearTagComponent() {
|
|
916
916
|
var _this = _super.call(this) || this;
|
|
917
917
|
_this.lockedDate = [];
|
|
918
|
-
_this.date = new forms.FormControl(moment$
|
|
918
|
+
_this.date = new forms.FormControl(moment$5());
|
|
919
919
|
_this.dateFilter = function (date) {
|
|
920
|
-
var calendarDateYear = moment$
|
|
920
|
+
var calendarDateYear = moment$5(date).year();
|
|
921
921
|
var status = true;
|
|
922
922
|
_this.lockedDate.forEach(function (timestamp) {
|
|
923
|
-
var lockDate = moment$
|
|
923
|
+
var lockDate = moment$5.unix(timestamp);
|
|
924
924
|
return status = !(lockDate.year() === calendarDateYear);
|
|
925
925
|
});
|
|
926
926
|
return status;
|
|
@@ -929,11 +929,11 @@
|
|
|
929
929
|
}
|
|
930
930
|
YearTagComponent.prototype.initDate = function () {
|
|
931
931
|
if (this.defaultValue) {
|
|
932
|
-
this.dateObj.date = moment$
|
|
933
|
-
this.date = new forms.FormControl(moment$
|
|
932
|
+
this.dateObj.date = moment$5(new Date(this.defaultValue * 1000)).utc().format('YYYY');
|
|
933
|
+
this.date = new forms.FormControl(moment$5(this.defaultValue * 1000));
|
|
934
934
|
}
|
|
935
935
|
else {
|
|
936
|
-
this.dateObj.date = moment$
|
|
936
|
+
this.dateObj.date = moment$5(new Date()).format('YYYY');
|
|
937
937
|
}
|
|
938
938
|
};
|
|
939
939
|
YearTagComponent.prototype.initName = function () {
|
|
@@ -943,10 +943,10 @@
|
|
|
943
943
|
};
|
|
944
944
|
YearTagComponent.prototype.chosenTagHandler = function (value) {
|
|
945
945
|
var date = new Date();
|
|
946
|
-
var year = moment$
|
|
946
|
+
var year = moment$5(value).year();
|
|
947
947
|
date.setTime(0);
|
|
948
948
|
date.setFullYear(year, 0, 1);
|
|
949
|
-
var resultDate = moment$
|
|
949
|
+
var resultDate = moment$5.utc(date);
|
|
950
950
|
resultDate.hour(12);
|
|
951
951
|
var resultTag = {
|
|
952
952
|
name: this.name,
|
|
@@ -1040,7 +1040,7 @@
|
|
|
1040
1040
|
tagChange: [{ type: i0.Output }]
|
|
1041
1041
|
};
|
|
1042
1042
|
|
|
1043
|
-
var moment$
|
|
1043
|
+
var moment$4 = momentImported__namespace;
|
|
1044
1044
|
var ListTagComponent = /** @class */ (function () {
|
|
1045
1045
|
function ListTagComponent() {
|
|
1046
1046
|
this.defaultValue = '';
|
|
@@ -1081,7 +1081,7 @@
|
|
|
1081
1081
|
};
|
|
1082
1082
|
|
|
1083
1083
|
// @ts-ignore
|
|
1084
|
-
var moment$
|
|
1084
|
+
var moment$3 = require('moment');
|
|
1085
1085
|
var DAY_FORMATS = {
|
|
1086
1086
|
parse: {
|
|
1087
1087
|
dateInput: 'DD-MM-YYYY',
|
|
@@ -1099,9 +1099,9 @@
|
|
|
1099
1099
|
function DayTagComponent() {
|
|
1100
1100
|
var _this = _super.call(this) || this;
|
|
1101
1101
|
_this.lockedDate = [];
|
|
1102
|
-
_this.date = new forms.FormControl(moment$
|
|
1102
|
+
_this.date = new forms.FormControl(moment$3());
|
|
1103
1103
|
_this.dateFilter = function (date) {
|
|
1104
|
-
var calendarDate = moment$
|
|
1104
|
+
var calendarDate = moment$3(date).unix();
|
|
1105
1105
|
var status = true;
|
|
1106
1106
|
_this.lockedDate.forEach(function (timestamp) { return status = !(timestamp === calendarDate); });
|
|
1107
1107
|
return status;
|
|
@@ -1109,10 +1109,10 @@
|
|
|
1109
1109
|
return _this;
|
|
1110
1110
|
}
|
|
1111
1111
|
DayTagComponent.prototype.initDate = function () {
|
|
1112
|
-
var utcOffsetInMilliseconds = moment$
|
|
1113
|
-
this.dateObj.date = moment$
|
|
1112
|
+
var utcOffsetInMilliseconds = moment$3().utcOffset() * 60 * 1000;
|
|
1113
|
+
this.dateObj.date = moment$3(moment$3().valueOf() + utcOffsetInMilliseconds);
|
|
1114
1114
|
if (this.defaultValue) {
|
|
1115
|
-
this.dateObj.date = moment$
|
|
1115
|
+
this.dateObj.date = moment$3(new Date(this.defaultValue * 1000)).utc();
|
|
1116
1116
|
this.date.setValue(this.dateObj.date);
|
|
1117
1117
|
}
|
|
1118
1118
|
};
|
|
@@ -1122,11 +1122,11 @@
|
|
|
1122
1122
|
}
|
|
1123
1123
|
};
|
|
1124
1124
|
DayTagComponent.prototype.chosenTagHandler = function (value) {
|
|
1125
|
-
var date = moment$
|
|
1125
|
+
var date = moment$3(value).unix();
|
|
1126
1126
|
var resultTag = {
|
|
1127
1127
|
name: this.name,
|
|
1128
1128
|
value: date,
|
|
1129
|
-
label: moment$
|
|
1129
|
+
label: moment$3.unix(date).format('MM/DD/YYYY'),
|
|
1130
1130
|
locked: !this.dateFilter(value)
|
|
1131
1131
|
};
|
|
1132
1132
|
console.log('resultTag', resultTag);
|
|
@@ -1872,6 +1872,88 @@
|
|
|
1872
1872
|
},] }
|
|
1873
1873
|
];
|
|
1874
1874
|
|
|
1875
|
+
exports.DateFromats = void 0;
|
|
1876
|
+
(function (DateFromats) {
|
|
1877
|
+
DateFromats["MAT_DEFAULT_DATE_FORMAT"] = "MM/DD/yyyy";
|
|
1878
|
+
DateFromats["DATE_INPUT_FORMAT"] = "YYYY/MM/DD";
|
|
1879
|
+
DateFromats["YEAR_FORMAT"] = "yyyy";
|
|
1880
|
+
DateFromats["MONTH_YEAR_FORMAT"] = "MM/yyyy";
|
|
1881
|
+
DateFromats["QUARTER_FORMAT"] = "Q/yyyy";
|
|
1882
|
+
DateFromats["WEEK_FORMAT"] = "W/yyyy";
|
|
1883
|
+
})(exports.DateFromats || (exports.DateFromats = {}));
|
|
1884
|
+
var CustomDateFormat = /** @class */ (function () {
|
|
1885
|
+
function CustomDateFormat() {
|
|
1886
|
+
this._parse = {
|
|
1887
|
+
dateInput: exports.DateFromats.DATE_INPUT_FORMAT,
|
|
1888
|
+
};
|
|
1889
|
+
this._display = {
|
|
1890
|
+
dateInput: exports.DateFromats.DATE_INPUT_FORMAT,
|
|
1891
|
+
monthYearLabel: 'MMM YYYY',
|
|
1892
|
+
dateA11yLabel: 'LL',
|
|
1893
|
+
monthYearA11yLabel: 'MMM YYYY',
|
|
1894
|
+
quarterYearLabel: 'Q/YYYY',
|
|
1895
|
+
yearLabel: 'YYYY'
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1898
|
+
Object.defineProperty(CustomDateFormat.prototype, "parse", {
|
|
1899
|
+
get: function () {
|
|
1900
|
+
return this._parse;
|
|
1901
|
+
},
|
|
1902
|
+
set: function (parse) {
|
|
1903
|
+
this._parse = Object.assign({}, this._parse, parse);
|
|
1904
|
+
},
|
|
1905
|
+
enumerable: false,
|
|
1906
|
+
configurable: true
|
|
1907
|
+
});
|
|
1908
|
+
Object.defineProperty(CustomDateFormat.prototype, "display", {
|
|
1909
|
+
get: function () {
|
|
1910
|
+
return this._display;
|
|
1911
|
+
},
|
|
1912
|
+
set: function (display) {
|
|
1913
|
+
this._display = Object.assign({}, this._display, display);
|
|
1914
|
+
},
|
|
1915
|
+
enumerable: false,
|
|
1916
|
+
configurable: true
|
|
1917
|
+
});
|
|
1918
|
+
CustomDateFormat.prototype.updateDateFormat = function (parse, display) {
|
|
1919
|
+
this.parse = parse;
|
|
1920
|
+
if (!display) {
|
|
1921
|
+
display = parse;
|
|
1922
|
+
}
|
|
1923
|
+
this.display = display;
|
|
1924
|
+
};
|
|
1925
|
+
return CustomDateFormat;
|
|
1926
|
+
}());
|
|
1927
|
+
exports.DatePickerPeriodPosition = void 0;
|
|
1928
|
+
(function (DatePickerPeriodPosition) {
|
|
1929
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["END_OF_PERIOD"] = 0] = "END_OF_PERIOD";
|
|
1930
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["MIDDLE_OF_PERIOD"] = 1] = "MIDDLE_OF_PERIOD";
|
|
1931
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["START_OF_PERIOD"] = 2] = "START_OF_PERIOD";
|
|
1932
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["DEFAULT"] = 3] = "DEFAULT";
|
|
1933
|
+
})(exports.DatePickerPeriodPosition || (exports.DatePickerPeriodPosition = {}));
|
|
1934
|
+
exports.TimeframeOption = void 0;
|
|
1935
|
+
(function (TimeframeOption) {
|
|
1936
|
+
TimeframeOption["DAY"] = "day";
|
|
1937
|
+
TimeframeOption["MONTH"] = "month";
|
|
1938
|
+
TimeframeOption["QUARTER"] = "quarter";
|
|
1939
|
+
TimeframeOption["WEEK"] = "week";
|
|
1940
|
+
TimeframeOption["YEAR"] = "year";
|
|
1941
|
+
})(exports.TimeframeOption || (exports.TimeframeOption = {}));
|
|
1942
|
+
exports.CalendarView = void 0;
|
|
1943
|
+
(function (CalendarView) {
|
|
1944
|
+
CalendarView["FOR_DAYS"] = "month";
|
|
1945
|
+
CalendarView["FOR_MONTHS"] = "year";
|
|
1946
|
+
CalendarView["FOR_QUARTERS"] = "none";
|
|
1947
|
+
CalendarView["FOR_YEARS"] = "multi-year";
|
|
1948
|
+
})(exports.CalendarView || (exports.CalendarView = {}));
|
|
1949
|
+
exports.DateTags = void 0;
|
|
1950
|
+
(function (DateTags) {
|
|
1951
|
+
DateTags["TODAY"] = "today";
|
|
1952
|
+
DateTags["YESTERDAY"] = "yesterday";
|
|
1953
|
+
DateTags["THIS_MONTH"] = "this_month";
|
|
1954
|
+
DateTags["PREV_MONTH"] = "prev_month";
|
|
1955
|
+
})(exports.DateTags || (exports.DateTags = {}));
|
|
1956
|
+
|
|
1875
1957
|
var POPUP_POSITIONS = {
|
|
1876
1958
|
top: {
|
|
1877
1959
|
originX: 'center',
|
|
@@ -1967,6 +2049,12 @@
|
|
|
1967
2049
|
animations.animate(150, animations.style({ opacity: 0 })),
|
|
1968
2050
|
]),
|
|
1969
2051
|
];
|
|
2052
|
+
var PRESET_TAGS_LIST = [
|
|
2053
|
+
{ key: exports.DateTags.TODAY, label: 'Today' },
|
|
2054
|
+
{ key: exports.DateTags.YESTERDAY, label: 'Yesterday' },
|
|
2055
|
+
{ key: exports.DateTags.THIS_MONTH, label: 'This month' },
|
|
2056
|
+
{ key: exports.DateTags.PREV_MONTH, label: 'Prev month' }
|
|
2057
|
+
];
|
|
1970
2058
|
|
|
1971
2059
|
var TooltipComponent = /** @class */ (function () {
|
|
1972
2060
|
function TooltipComponent() {
|
|
@@ -3902,81 +3990,6 @@
|
|
|
3902
3990
|
ngModelDebounceChange: [{ type: i0.Output }]
|
|
3903
3991
|
};
|
|
3904
3992
|
|
|
3905
|
-
exports.DateFromats = void 0;
|
|
3906
|
-
(function (DateFromats) {
|
|
3907
|
-
DateFromats["MAT_DEFAULT_DATE_FORMAT"] = "MM/DD/yyyy";
|
|
3908
|
-
DateFromats["DATE_INPUT_FORMAT"] = "YYYY/MM/DD";
|
|
3909
|
-
DateFromats["YEAR_FORMAT"] = "yyyy";
|
|
3910
|
-
DateFromats["MONTH_YEAR_FORMAT"] = "MM/yyyy";
|
|
3911
|
-
DateFromats["QUARTER_FORMAT"] = "Q/yyyy";
|
|
3912
|
-
DateFromats["WEEK_FORMAT"] = "W/yyyy";
|
|
3913
|
-
})(exports.DateFromats || (exports.DateFromats = {}));
|
|
3914
|
-
var CustomDateFormat = /** @class */ (function () {
|
|
3915
|
-
function CustomDateFormat() {
|
|
3916
|
-
this._parse = {
|
|
3917
|
-
dateInput: exports.DateFromats.DATE_INPUT_FORMAT,
|
|
3918
|
-
};
|
|
3919
|
-
this._display = {
|
|
3920
|
-
dateInput: exports.DateFromats.DATE_INPUT_FORMAT,
|
|
3921
|
-
monthYearLabel: 'MMM YYYY',
|
|
3922
|
-
dateA11yLabel: 'LL',
|
|
3923
|
-
monthYearA11yLabel: 'MMM YYYY',
|
|
3924
|
-
quarterYearLabel: 'Q/YYYY',
|
|
3925
|
-
yearLabel: 'YYYY'
|
|
3926
|
-
};
|
|
3927
|
-
}
|
|
3928
|
-
Object.defineProperty(CustomDateFormat.prototype, "parse", {
|
|
3929
|
-
get: function () {
|
|
3930
|
-
return this._parse;
|
|
3931
|
-
},
|
|
3932
|
-
set: function (parse) {
|
|
3933
|
-
this._parse = Object.assign({}, this._parse, parse);
|
|
3934
|
-
},
|
|
3935
|
-
enumerable: false,
|
|
3936
|
-
configurable: true
|
|
3937
|
-
});
|
|
3938
|
-
Object.defineProperty(CustomDateFormat.prototype, "display", {
|
|
3939
|
-
get: function () {
|
|
3940
|
-
return this._display;
|
|
3941
|
-
},
|
|
3942
|
-
set: function (display) {
|
|
3943
|
-
this._display = Object.assign({}, this._display, display);
|
|
3944
|
-
},
|
|
3945
|
-
enumerable: false,
|
|
3946
|
-
configurable: true
|
|
3947
|
-
});
|
|
3948
|
-
CustomDateFormat.prototype.updateDateFormat = function (parse, display) {
|
|
3949
|
-
this.parse = parse;
|
|
3950
|
-
if (!display) {
|
|
3951
|
-
display = parse;
|
|
3952
|
-
}
|
|
3953
|
-
this.display = display;
|
|
3954
|
-
};
|
|
3955
|
-
return CustomDateFormat;
|
|
3956
|
-
}());
|
|
3957
|
-
exports.DatePickerPeriodPosition = void 0;
|
|
3958
|
-
(function (DatePickerPeriodPosition) {
|
|
3959
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["END_OF_PERIOD"] = 0] = "END_OF_PERIOD";
|
|
3960
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["MIDDLE_OF_PERIOD"] = 1] = "MIDDLE_OF_PERIOD";
|
|
3961
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["START_OF_PERIOD"] = 2] = "START_OF_PERIOD";
|
|
3962
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["DEFAULT"] = 3] = "DEFAULT";
|
|
3963
|
-
})(exports.DatePickerPeriodPosition || (exports.DatePickerPeriodPosition = {}));
|
|
3964
|
-
exports.TimeframeOption = void 0;
|
|
3965
|
-
(function (TimeframeOption) {
|
|
3966
|
-
TimeframeOption["DAY"] = "day";
|
|
3967
|
-
TimeframeOption["MONTH"] = "month";
|
|
3968
|
-
TimeframeOption["QUARTER"] = "quarter";
|
|
3969
|
-
TimeframeOption["WEEK"] = "week";
|
|
3970
|
-
TimeframeOption["YEAR"] = "year";
|
|
3971
|
-
})(exports.TimeframeOption || (exports.TimeframeOption = {}));
|
|
3972
|
-
exports.CalendarView = void 0;
|
|
3973
|
-
(function (CalendarView) {
|
|
3974
|
-
CalendarView["FOR_DAYS"] = "month";
|
|
3975
|
-
CalendarView["FOR_MONTHS"] = "year";
|
|
3976
|
-
CalendarView["FOR_QUARTERS"] = "none";
|
|
3977
|
-
CalendarView["FOR_YEARS"] = "multi-year";
|
|
3978
|
-
})(exports.CalendarView || (exports.CalendarView = {}));
|
|
3979
|
-
|
|
3980
3993
|
var IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
|
3981
3994
|
exports.CHAT_MESSAGE_TYPE = void 0;
|
|
3982
3995
|
(function (CHAT_MESSAGE_TYPE) {
|
|
@@ -4120,15 +4133,38 @@
|
|
|
4120
4133
|
return defaultFrame;
|
|
4121
4134
|
}
|
|
4122
4135
|
};
|
|
4136
|
+
DrSharedUtils.getDateByTag = function (tag) {
|
|
4137
|
+
var todayDate = momentImported__namespace().utc();
|
|
4138
|
+
switch (tag) {
|
|
4139
|
+
case exports.DateTags.TODAY:
|
|
4140
|
+
return todayDate;
|
|
4141
|
+
case exports.DateTags.YESTERDAY:
|
|
4142
|
+
todayDate.subtract(1, 'days');
|
|
4143
|
+
return todayDate;
|
|
4144
|
+
case exports.DateTags.THIS_MONTH:
|
|
4145
|
+
todayDate.month();
|
|
4146
|
+
return todayDate;
|
|
4147
|
+
case exports.DateTags.PREV_MONTH:
|
|
4148
|
+
todayDate.month();
|
|
4149
|
+
todayDate.subtract(1, 'months');
|
|
4150
|
+
return todayDate;
|
|
4151
|
+
}
|
|
4152
|
+
};
|
|
4123
4153
|
return DrSharedUtils;
|
|
4124
4154
|
}());
|
|
4125
4155
|
|
|
4156
|
+
var moment$2 = require('moment');
|
|
4126
4157
|
var DrDatePickerService = /** @class */ (function () {
|
|
4127
4158
|
function DrDatePickerService() {
|
|
4128
4159
|
this.isTimeframeSelectionEnabled = false;
|
|
4129
4160
|
this.timeframe = exports.TimeframeOption.DAY;
|
|
4130
4161
|
this.format$ = new rxjs.BehaviorSubject(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
4131
4162
|
this.updatedQuarter$ = new rxjs.Subject();
|
|
4163
|
+
this.updatedDateAndClose$ = new rxjs.Subject();
|
|
4164
|
+
this.presetTag$ = new rxjs.BehaviorSubject('');
|
|
4165
|
+
this.onSameDaySelectedInCalendar$ = new rxjs.Subject();
|
|
4166
|
+
this.keepPresetTag = false;
|
|
4167
|
+
this.isValueUpdating = false;
|
|
4132
4168
|
this.availableTimeframes = [
|
|
4133
4169
|
exports.TimeframeOption.DAY,
|
|
4134
4170
|
exports.TimeframeOption.WEEK,
|
|
@@ -4258,6 +4294,47 @@
|
|
|
4258
4294
|
if (isSubtract === void 0) { isSubtract = false; }
|
|
4259
4295
|
return date ? ___namespace.cloneDeep(date)[isSubtract ? 'subtract' : 'add'](this.fiscalYearMonthsModifier, 'month') : date;
|
|
4260
4296
|
};
|
|
4297
|
+
DrDatePickerService.prototype.updateDatePickerByPreset = function (tag, calender) {
|
|
4298
|
+
this.keepPresetTag = true;
|
|
4299
|
+
var date = null;
|
|
4300
|
+
if (tag) {
|
|
4301
|
+
date = DrSharedUtils.getDateByTag(tag);
|
|
4302
|
+
switch (tag) {
|
|
4303
|
+
case exports.DateTags.TODAY:
|
|
4304
|
+
this.updateTimeframeAndFormat(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
4305
|
+
break;
|
|
4306
|
+
case exports.DateTags.YESTERDAY:
|
|
4307
|
+
this.updateTimeframeAndFormat(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
4308
|
+
break;
|
|
4309
|
+
case exports.DateTags.THIS_MONTH:
|
|
4310
|
+
this.updateTimeframeAndFormat(exports.DateFromats.MONTH_YEAR_FORMAT);
|
|
4311
|
+
this.selectDateInCalendarMonthView(date, calender);
|
|
4312
|
+
break;
|
|
4313
|
+
case exports.DateTags.PREV_MONTH:
|
|
4314
|
+
this.updateTimeframeAndFormat(exports.DateFromats.MONTH_YEAR_FORMAT);
|
|
4315
|
+
this.selectDateInCalendarMonthView(date, calender);
|
|
4316
|
+
break;
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
this.presetTag$.next(tag);
|
|
4320
|
+
this.updatedDateAndClose$.next(date);
|
|
4321
|
+
};
|
|
4322
|
+
DrDatePickerService.prototype.selectDateInCalendarMonthView = function (date, calender) {
|
|
4323
|
+
setTimeout(function () {
|
|
4324
|
+
var monthView = calender.monthView;
|
|
4325
|
+
monthView._activeDate = date;
|
|
4326
|
+
monthView._selected = date;
|
|
4327
|
+
monthView._init();
|
|
4328
|
+
});
|
|
4329
|
+
};
|
|
4330
|
+
DrDatePickerService.prototype.resetPresetTag = function () {
|
|
4331
|
+
if (!this.keepPresetTag) {
|
|
4332
|
+
this.presetTag$.next(null);
|
|
4333
|
+
}
|
|
4334
|
+
else {
|
|
4335
|
+
this.keepPresetTag = false;
|
|
4336
|
+
}
|
|
4337
|
+
};
|
|
4261
4338
|
return DrDatePickerService;
|
|
4262
4339
|
}());
|
|
4263
4340
|
DrDatePickerService.decorators = [
|
|
@@ -4322,6 +4399,7 @@
|
|
|
4322
4399
|
this.timeframeSelection = false;
|
|
4323
4400
|
this.periodMonthLabel = '';
|
|
4324
4401
|
this.periodYearLabel = '';
|
|
4402
|
+
this.presetTagList = PRESET_TAGS_LIST;
|
|
4325
4403
|
this.calendarView = exports.CalendarView;
|
|
4326
4404
|
_calendar.stateChanges.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
|
|
4327
4405
|
this.datePickerService.format$.pipe(operators.takeUntil(this._destroyed)).subscribe(function (value) {
|
|
@@ -4338,8 +4416,21 @@
|
|
|
4338
4416
|
_this.transformDateInMultiyearViewAccordingToFY();
|
|
4339
4417
|
}
|
|
4340
4418
|
});
|
|
4419
|
+
_calendar._userSelection.subscribe(function (date) {
|
|
4420
|
+
if (!_this.datePickerService.isValueUpdating) {
|
|
4421
|
+
_this.datePickerService.onSameDaySelectedInCalendar$.next(date.value);
|
|
4422
|
+
}
|
|
4423
|
+
});
|
|
4341
4424
|
this.datePickerService.calendarInstance = _calendar;
|
|
4342
4425
|
}
|
|
4426
|
+
Object.defineProperty(DrDatePickerCustomHeaderComponent.prototype, "selectedPresetTag", {
|
|
4427
|
+
get: function () {
|
|
4428
|
+
return this.datePickerService.presetTag$.getValue();
|
|
4429
|
+
},
|
|
4430
|
+
enumerable: false,
|
|
4431
|
+
configurable: true
|
|
4432
|
+
});
|
|
4433
|
+
;
|
|
4343
4434
|
DrDatePickerCustomHeaderComponent.prototype.ngOnInit = function () {
|
|
4344
4435
|
var _this = this;
|
|
4345
4436
|
setTimeout(function () {
|
|
@@ -4366,8 +4457,12 @@
|
|
|
4366
4457
|
}
|
|
4367
4458
|
this.cdr.markForCheck();
|
|
4368
4459
|
};
|
|
4369
|
-
DrDatePickerCustomHeaderComponent.prototype.setTimeframe = function () {
|
|
4460
|
+
DrDatePickerCustomHeaderComponent.prototype.setTimeframe = function (value) {
|
|
4370
4461
|
var _this = this;
|
|
4462
|
+
if (value !== this.selectedTimeframe) {
|
|
4463
|
+
this.datePickerService.resetPresetTag();
|
|
4464
|
+
}
|
|
4465
|
+
this.selectedTimeframe = value;
|
|
4371
4466
|
this.timeframeSelection = false;
|
|
4372
4467
|
this._calendar.currentView = this.selectedTimeframe;
|
|
4373
4468
|
var chosenTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this.selectedTimeframe; })[0];
|
|
@@ -4407,14 +4502,23 @@
|
|
|
4407
4502
|
multuYearView._selectedYear = multuYearView._activeDate.year();
|
|
4408
4503
|
multuYearView._init();
|
|
4409
4504
|
};
|
|
4505
|
+
DrDatePickerCustomHeaderComponent.prototype.onSelectPresetTag = function (tag) {
|
|
4506
|
+
if (tag.key === this.selectedPresetTag) {
|
|
4507
|
+
this.datePickerService.presetTag$.next(null);
|
|
4508
|
+
}
|
|
4509
|
+
else {
|
|
4510
|
+
this.datePickerService.presetTag$.next(tag.key);
|
|
4511
|
+
}
|
|
4512
|
+
this.datePickerService.updateDatePickerByPreset(this.selectedPresetTag, this._calendar);
|
|
4513
|
+
};
|
|
4410
4514
|
return DrDatePickerCustomHeaderComponent;
|
|
4411
4515
|
}());
|
|
4412
4516
|
DrDatePickerCustomHeaderComponent.decorators = [
|
|
4413
4517
|
{ type: i0.Component, args: [{
|
|
4414
4518
|
selector: 'dr-date-picker_custom-header.component',
|
|
4415
|
-
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [
|
|
4519
|
+
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n\n <div *ngIf=\"datePickerService.isUsingDateTagPresets\" class=\"dr-datepicker-preset-date\">\n <div class=\"dr-datepicker-preset-date__tags\">\n <div *ngFor=\"let tag of presetTagList\" \n id=\"preset_tag\" \n class=\"dr-datepicker-preset-date__tags__tag\" \n (click)=\"onSelectPresetTag(tag)\" \n [ngClass]=\"{'dr-datepicker-preset-date__tags__tag--selected': tag.key === selectedPresetTag}\"\n [drTooltip]=\"selectedPresetTag === tag.key? 'Unselect preset' : ''\"\n [drTooltipPosition]=\"'top'\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n >\n {{ tag.label }}\n </div>\n </div>\n </div>\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [ngModel]=\"selectedTimeframe\"\n [items]=\"timeframeOptions | drShowTimeframePipe: datePickerService.availableTimeframes\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe($event)\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_MONTHS)\">{{ periodMonthLabel + ' ' }}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{ periodYearLabel }}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuarter\">\n <div *ngFor=\"let quarter of quarters\"\n class=\"quarter-selector\" (click)=\"onSelectQuarter(quarter)\"\n [class]=\"quarter === selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n",
|
|
4416
4520
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
4417
|
-
styles: [":host{height:54px;align-items:center;font-family:\"Poppins\";font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px
|
|
4521
|
+
styles: [":host{height:54px;align-items:center;font-family:\"Poppins\";font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-datepicker-preset-date{display:flex;flex-direction:column}.dr-datepicker-preset-date__tags{display:flex;padding-bottom:21px;padding-top:10px;font-size:12px}.dr-datepicker-preset-date__tags__tag{cursor:pointer;font-weight:400;line-height:20px!important;padding:2px 8px;border:1px solid #9EA1AA;border-radius:18px;background:#FFFFFF;margin-right:4px}.dr-datepicker-preset-date__tags__tag--selected{color:#4646ce;background:#F2F2FB;border:1px solid #4646CE}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 32px;grid-gap:4px;gap:4px}.dr-date-paging.flip-page-button{width:20px;height:20px;padding:0;color:#4e566c}.dr-date-paging.flip-page-button:hover{border-radius:50%;background:#f2f2fb;color:#4646ce}.example-header-label{cursor:pointer}.dr-quarterly-datepicker{display:flex;justify-content:space-between;padding:10px}.dr-quarterly-datepicker .quarter-selector{display:block;width:74px;height:40px;text-align:center;border-radius:40px;font-weight:400;padding-top:9px}.dr-quarterly-datepicker .quarter-selector:hover{background:#f2f2fb;color:#4646ce;font-weight:600;cursor:pointer}.dr-quarterly-datepicker .quarter-selector.selected{background-color:#4646ce;color:#f3f7ff;font-weight:600}\n"]
|
|
4418
4522
|
},] }
|
|
4419
4523
|
];
|
|
4420
4524
|
DrDatePickerCustomHeaderComponent.ctorParameters = function () { return [
|
|
@@ -4596,8 +4700,16 @@
|
|
|
4596
4700
|
* @param timestamp
|
|
4597
4701
|
*/
|
|
4598
4702
|
DrDatePickerComponent.prototype.setValue = function (timestamp) {
|
|
4703
|
+
var _this = this;
|
|
4704
|
+
// isValueUpdating is required for manage clicks on same dates: if isValueUpdating - true then
|
|
4705
|
+
// days are different and subscription on calendar day click action won't trigger Accessor ngModel update
|
|
4706
|
+
// one more time
|
|
4707
|
+
this.datePickerService.isValueUpdating = true;
|
|
4599
4708
|
this.writeValue(timestamp);
|
|
4600
4709
|
this.onChangeCallback(this.innerValue.unix());
|
|
4710
|
+
setTimeout(function () {
|
|
4711
|
+
_this.datePickerService.isValueUpdating = false;
|
|
4712
|
+
});
|
|
4601
4713
|
};
|
|
4602
4714
|
return DrDatePickerComponent;
|
|
4603
4715
|
}());
|
|
@@ -4640,6 +4752,7 @@
|
|
|
4640
4752
|
_this.canSelectTimeframe = true;
|
|
4641
4753
|
// eslint-disable-next-line
|
|
4642
4754
|
_this.onChangeFormat = new i0.EventEmitter();
|
|
4755
|
+
_this.onChangePresetTag = new i0.EventEmitter();
|
|
4643
4756
|
_this.pagingSetup = (_c = {},
|
|
4644
4757
|
_c[exports.TimeframeOption.YEAR] = function (forward) { return _this.getNextDate('addCalendarYears', 1, forward); },
|
|
4645
4758
|
_c[exports.TimeframeOption.QUARTER] = function (forward) { return _this.getNextDate('addCalendarMonths', 3, forward); },
|
|
@@ -4654,6 +4767,23 @@
|
|
|
4654
4767
|
datePickerService.format$.pipe(operators.takeUntil(_this.destroyed$)).subscribe(function (value) {
|
|
4655
4768
|
_this.onChangeFormat.emit(datePickerService.normalizeValue(value));
|
|
4656
4769
|
});
|
|
4770
|
+
datePickerService.presetTag$.pipe(operators.takeUntil(_this.destroyed$)).subscribe(function (value) {
|
|
4771
|
+
var tagObj = PRESET_TAGS_LIST.find(function (val) { return (val === null || val === void 0 ? void 0 : val.key) === value; });
|
|
4772
|
+
_this.presetTagSelected = tagObj === null || tagObj === void 0 ? void 0 : tagObj.label;
|
|
4773
|
+
_this.onChangePresetTag.emit(value);
|
|
4774
|
+
});
|
|
4775
|
+
_this.datePickerService.onSameDaySelectedInCalendar$.pipe(operators.takeUntil(_this.destroyed$)).subscribe(function (value) {
|
|
4776
|
+
_this.setValueFromMoment(value);
|
|
4777
|
+
});
|
|
4778
|
+
datePickerService.updatedDateAndClose$.pipe(operators.takeUntil(_this.destroyed$)).subscribe(function (value) {
|
|
4779
|
+
if (value) {
|
|
4780
|
+
_this.setValueFromMoment(value);
|
|
4781
|
+
}
|
|
4782
|
+
else {
|
|
4783
|
+
_this.onChangeCallback(_this.innerValue.unix());
|
|
4784
|
+
}
|
|
4785
|
+
_this.datePicker.close();
|
|
4786
|
+
});
|
|
4657
4787
|
return _this;
|
|
4658
4788
|
}
|
|
4659
4789
|
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "isDashboardClassDisplayed", {
|
|
@@ -4683,6 +4813,31 @@
|
|
|
4683
4813
|
enumerable: false,
|
|
4684
4814
|
configurable: true
|
|
4685
4815
|
});
|
|
4816
|
+
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "isUsingDateTagPresets", {
|
|
4817
|
+
set: function (flag) {
|
|
4818
|
+
this.datePickerService.isUsingDateTagPresets = flag;
|
|
4819
|
+
},
|
|
4820
|
+
enumerable: false,
|
|
4821
|
+
configurable: true
|
|
4822
|
+
});
|
|
4823
|
+
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "presetTag", {
|
|
4824
|
+
set: function (tag) {
|
|
4825
|
+
this.datePickerService.presetTag$.next(tag);
|
|
4826
|
+
},
|
|
4827
|
+
enumerable: false,
|
|
4828
|
+
configurable: true
|
|
4829
|
+
});
|
|
4830
|
+
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "value", {
|
|
4831
|
+
get: function () {
|
|
4832
|
+
return this.innerValue;
|
|
4833
|
+
},
|
|
4834
|
+
set: function (v) {
|
|
4835
|
+
this.setValueFromMoment(v);
|
|
4836
|
+
this.cdr.markForCheck();
|
|
4837
|
+
},
|
|
4838
|
+
enumerable: false,
|
|
4839
|
+
configurable: true
|
|
4840
|
+
});
|
|
4686
4841
|
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "displayedFormattedValue", {
|
|
4687
4842
|
get: function () {
|
|
4688
4843
|
if (!this.value) {
|
|
@@ -4720,6 +4875,7 @@
|
|
|
4720
4875
|
// this is required for not sending extra requests when user quickly clicking on pagination
|
|
4721
4876
|
// here we do the same as in setValueFromMoment(newValue) with difference
|
|
4722
4877
|
// that updating of ngModel/formControl is debounced
|
|
4878
|
+
this.datePickerService.resetPresetTag();
|
|
4723
4879
|
var timestamp = newValue.unix();
|
|
4724
4880
|
this.writeValue(timestamp);
|
|
4725
4881
|
this.onChangeDebounced$.next(this.innerValue.unix());
|
|
@@ -4728,6 +4884,15 @@
|
|
|
4728
4884
|
this.setValueFromMoment(newValue);
|
|
4729
4885
|
}
|
|
4730
4886
|
};
|
|
4887
|
+
/**
|
|
4888
|
+
* Set inner value from timestamp and propagate
|
|
4889
|
+
*
|
|
4890
|
+
* @param timestamp
|
|
4891
|
+
*/
|
|
4892
|
+
DrDatePickerWithTimeframeComponent.prototype.setValue = function (timestamp) {
|
|
4893
|
+
this.datePickerService.resetPresetTag();
|
|
4894
|
+
_super.prototype.setValue.call(this, timestamp);
|
|
4895
|
+
};
|
|
4731
4896
|
DrDatePickerWithTimeframeComponent.prototype.writeValue = function (value) {
|
|
4732
4897
|
_super.prototype.writeValue.call(this, value);
|
|
4733
4898
|
if (!value)
|
|
@@ -4751,13 +4916,13 @@
|
|
|
4751
4916
|
DrDatePickerWithTimeframeComponent.decorators = [
|
|
4752
4917
|
{ type: i0.Component, args: [{
|
|
4753
4918
|
selector: 'dr-date-picker-with-timeframe',
|
|
4754
|
-
template: "<dr-button [disabled]=\"isPrevDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n <div
|
|
4919
|
+
template: "<dr-button [disabled]=\"isPrevDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n \n <div class=\"dr-datepicker-input-container__formatted-value-display\" (click)=\"datepickerInput.click()\">\n <span *ngIf=\"presetTagSelected\"> {{ presetTagSelected }} </span>\n <span>{{ presetTagSelected ? '(' + displayedFormattedValue + ')' : displayedFormattedValue }}</span>\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<dr-button [disabled]=\"isNextDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-right\" (click)=\"pagingClicked(true)\"></dr-button>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\"\n panelClass=\"date-picker-preset-tag\"\n >\n</mat-datepicker>\n",
|
|
4755
4920
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
4756
4921
|
providers: [
|
|
4757
4922
|
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
|
|
4758
4923
|
{ provide: DrDatePickerService }
|
|
4759
4924
|
],
|
|
4760
|
-
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #c3c4ce;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#e5e6ea}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.dr-date-picker-on-dashboard{width:
|
|
4925
|
+
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #c3c4ce;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#e5e6ea}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.dr-date-picker-on-dashboard{width:-moz-fit-content;width:fit-content;justify-content:space-between}:host.dr-date-picker-on-dashboard mat-datepicker{position:absolute}:host.dr-date-picker-on-dashboard:after{visibility:hidden}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container{display:flex;flex-direction:row;justify-content:center;align-items:center;margin-left:-10px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{font-weight:600;width:auto;margin-left:5px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container .dr-icon-date{display:block;position:relative;top:0;margin-right:8px;color:#4e566c}:host .dr-datepicker-input-container input{visibility:hidden;position:absolute;width:100%}:host .dr-datepicker-input-container__formatted-value-display{width:90px;height:22px;padding-left:0;text-align:center;line-height:22px;color:#0c142b;-webkit-text-decoration-line:underline;text-decoration-line:underline}:host .dr-datepicker-input-container__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}::ng-deep .date-picker-preset-tag{width:386px!important}::ng-deep .date-picker-preset-tag .mat-calendar-content{padding-left:32px!important;padding-right:32px!important}\n"]
|
|
4761
4926
|
},] }
|
|
4762
4927
|
];
|
|
4763
4928
|
DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
|
|
@@ -4772,7 +4937,10 @@
|
|
|
4772
4937
|
canSelectTimeframe: [{ type: i0.Input }],
|
|
4773
4938
|
availableTimeframes: [{ type: i0.Input }],
|
|
4774
4939
|
paginationDebounce: [{ type: i0.Input }],
|
|
4775
|
-
|
|
4940
|
+
isUsingDateTagPresets: [{ type: i0.Input }],
|
|
4941
|
+
presetTag: [{ type: i0.Input }],
|
|
4942
|
+
onChangeFormat: [{ type: i0.Output }],
|
|
4943
|
+
onChangePresetTag: [{ type: i0.Output }]
|
|
4776
4944
|
};
|
|
4777
4945
|
|
|
4778
4946
|
var DrDatePickerFormatDirective = /** @class */ (function () {
|
|
@@ -4836,47 +5004,6 @@
|
|
|
4836
5004
|
},] }
|
|
4837
5005
|
];
|
|
4838
5006
|
|
|
4839
|
-
// !!! Please do not use such approach in other places
|
|
4840
|
-
// Hard fix for 'none' calendar view selection
|
|
4841
|
-
datepicker.MatCalendar.prototype.focusActiveCell = function () {
|
|
4842
|
-
var _a;
|
|
4843
|
-
(_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
|
|
4844
|
-
};
|
|
4845
|
-
var components$2 = [
|
|
4846
|
-
DrButtonComponent,
|
|
4847
|
-
RadioButtonComponent,
|
|
4848
|
-
RadioGroupComponent,
|
|
4849
|
-
CheckboxComponent,
|
|
4850
|
-
DrInputComponent,
|
|
4851
|
-
DrSelectComponent,
|
|
4852
|
-
DrToggleComponent,
|
|
4853
|
-
DrToggleButtonComponent,
|
|
4854
|
-
DrDatePickerComponent,
|
|
4855
|
-
DrDatePickerWithTimeframeComponent,
|
|
4856
|
-
DrDatePickerFormatDirective,
|
|
4857
|
-
DrDatePickerCustomHeaderComponent,
|
|
4858
|
-
DrModelDebounceChangeDirective,
|
|
4859
|
-
DrShowTimeframePipe
|
|
4860
|
-
];
|
|
4861
|
-
var DrInputsModule = /** @class */ (function () {
|
|
4862
|
-
function DrInputsModule() {
|
|
4863
|
-
}
|
|
4864
|
-
return DrInputsModule;
|
|
4865
|
-
}());
|
|
4866
|
-
DrInputsModule.decorators = [
|
|
4867
|
-
{ type: i0.NgModule, args: [{
|
|
4868
|
-
declarations: components$2,
|
|
4869
|
-
exports: components$2,
|
|
4870
|
-
imports: [
|
|
4871
|
-
forms.FormsModule,
|
|
4872
|
-
forms.ReactiveFormsModule,
|
|
4873
|
-
common.CommonModule,
|
|
4874
|
-
ngSelect.NgSelectModule,
|
|
4875
|
-
datepicker.MatDatepickerModule
|
|
4876
|
-
]
|
|
4877
|
-
},] }
|
|
4878
|
-
];
|
|
4879
|
-
|
|
4880
5007
|
var TooltipInfoComponent = /** @class */ (function () {
|
|
4881
5008
|
function TooltipInfoComponent() {
|
|
4882
5009
|
}
|
|
@@ -4980,6 +5107,49 @@
|
|
|
4980
5107
|
},] }
|
|
4981
5108
|
];
|
|
4982
5109
|
|
|
5110
|
+
// !!! Please do not use such approach in other places
|
|
5111
|
+
// Hard fix for 'none' calendar view selection
|
|
5112
|
+
datepicker.MatCalendar.prototype.focusActiveCell = function () {
|
|
5113
|
+
var _a;
|
|
5114
|
+
(_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
|
|
5115
|
+
};
|
|
5116
|
+
var components$2 = [
|
|
5117
|
+
DrButtonComponent,
|
|
5118
|
+
RadioButtonComponent,
|
|
5119
|
+
RadioGroupComponent,
|
|
5120
|
+
CheckboxComponent,
|
|
5121
|
+
DrInputComponent,
|
|
5122
|
+
DrSelectComponent,
|
|
5123
|
+
DrToggleComponent,
|
|
5124
|
+
DrToggleButtonComponent,
|
|
5125
|
+
DrDatePickerComponent,
|
|
5126
|
+
DrDatePickerWithTimeframeComponent,
|
|
5127
|
+
DrDatePickerFormatDirective,
|
|
5128
|
+
DrDatePickerCustomHeaderComponent,
|
|
5129
|
+
DrModelDebounceChangeDirective,
|
|
5130
|
+
DrShowTimeframePipe
|
|
5131
|
+
];
|
|
5132
|
+
var DrInputsModule = /** @class */ (function () {
|
|
5133
|
+
function DrInputsModule() {
|
|
5134
|
+
}
|
|
5135
|
+
return DrInputsModule;
|
|
5136
|
+
}());
|
|
5137
|
+
DrInputsModule.decorators = [
|
|
5138
|
+
{ type: i0.NgModule, args: [{
|
|
5139
|
+
declarations: components$2,
|
|
5140
|
+
exports: components$2,
|
|
5141
|
+
imports: [
|
|
5142
|
+
forms.FormsModule,
|
|
5143
|
+
forms.ReactiveFormsModule,
|
|
5144
|
+
common.CommonModule,
|
|
5145
|
+
ngSelect.NgSelectModule,
|
|
5146
|
+
datepicker.MatDatepickerModule,
|
|
5147
|
+
tooltip.MatTooltipModule,
|
|
5148
|
+
DrTooltipModule
|
|
5149
|
+
]
|
|
5150
|
+
},] }
|
|
5151
|
+
];
|
|
5152
|
+
|
|
4983
5153
|
var DrAvatarModule = /** @class */ (function () {
|
|
4984
5154
|
function DrAvatarModule() {
|
|
4985
5155
|
}
|