@datarailsshared/datarailsshared 1.4.116 → 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-dialog/interfaces/dialog-data.js +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-dialog/interfaces/dialog-data.d.ts +4 -5
- 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.116.tgz +0 -0
|
@@ -96,7 +96,7 @@ AnyTagComponent.propDecorators = {
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
// @ts-ignore
|
|
99
|
-
const moment$
|
|
99
|
+
const moment$9 = require('moment');
|
|
100
100
|
class ForecastTagComponent extends AnyTagComponent {
|
|
101
101
|
constructor() {
|
|
102
102
|
super();
|
|
@@ -117,10 +117,10 @@ class ForecastTagComponent extends AnyTagComponent {
|
|
|
117
117
|
{ value: 11, label: '11+1' }
|
|
118
118
|
];
|
|
119
119
|
this.dateFilter = (date) => {
|
|
120
|
-
const forecastDate = moment$
|
|
120
|
+
const forecastDate = moment$9.unix(date);
|
|
121
121
|
let status = true;
|
|
122
122
|
this.lockedDate.forEach(timestamp => {
|
|
123
|
-
const locked = moment$
|
|
123
|
+
const locked = moment$9.unix(timestamp);
|
|
124
124
|
return status = !(locked.month() === forecastDate.month() && locked.year() === forecastDate.year());
|
|
125
125
|
});
|
|
126
126
|
return status;
|
|
@@ -136,14 +136,14 @@ class ForecastTagComponent extends AnyTagComponent {
|
|
|
136
136
|
this.forecastValue = this.getFiscalMonthFromDate(dateVal, fiscal_year_starts_from) - 1;
|
|
137
137
|
const fiscal_year = this.getFiscalYearFromDate(dateVal, fiscal_year_starts_from, fiscal_year_back);
|
|
138
138
|
console.log('test', dateVal, fiscal_year_starts_from, this.forecastValue, fiscal_year);
|
|
139
|
-
this.dateObj.date = moment$
|
|
139
|
+
this.dateObj.date = moment$9(new Date(fiscal_year, 0, 1)).format('YYYY');
|
|
140
140
|
this.updateLockedDate();
|
|
141
141
|
}
|
|
142
142
|
updateLockedDate() {
|
|
143
143
|
for (const forecastTag of this.forecastTags) {
|
|
144
144
|
forecastTag.disable = false;
|
|
145
145
|
this.lockedDate.forEach(timestamp => {
|
|
146
|
-
const locked = moment$
|
|
146
|
+
const locked = moment$9.unix(timestamp);
|
|
147
147
|
if (locked.month() - 1 === forecastTag.value && +locked.year() + 1 === +this.dateObj.date) {
|
|
148
148
|
forecastTag.disable = true;
|
|
149
149
|
}
|
|
@@ -239,7 +239,7 @@ ForecastTagComponent.propDecorators = {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
// @ts-ignore
|
|
242
|
-
const moment$
|
|
242
|
+
const moment$8 = require('moment');
|
|
243
243
|
const MONTH_FORMATS = {
|
|
244
244
|
parse: {
|
|
245
245
|
dateInput: 'DD-MM-YYYY',
|
|
@@ -256,12 +256,12 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
256
256
|
constructor() {
|
|
257
257
|
super();
|
|
258
258
|
this.lockedDate = [];
|
|
259
|
-
this.date = new FormControl(moment$
|
|
259
|
+
this.date = new FormControl(moment$8());
|
|
260
260
|
this.dateFilter = (date) => {
|
|
261
|
-
const calendarDate = moment$
|
|
261
|
+
const calendarDate = moment$8(date);
|
|
262
262
|
let status = true;
|
|
263
263
|
this.lockedDate.forEach(timestamp => {
|
|
264
|
-
const lockDate = moment$
|
|
264
|
+
const lockDate = moment$8.unix(timestamp);
|
|
265
265
|
return status = !(lockDate.year() === calendarDate.year() && lockDate.month() === calendarDate.month());
|
|
266
266
|
});
|
|
267
267
|
return status;
|
|
@@ -269,11 +269,11 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
269
269
|
}
|
|
270
270
|
initDate() {
|
|
271
271
|
if (this.defaultValue) {
|
|
272
|
-
this.dateObj.date = moment$
|
|
273
|
-
this.date = new FormControl(moment$
|
|
272
|
+
this.dateObj.date = moment$8(this.defaultValue * 1000).utc().format('YYYY-MM');
|
|
273
|
+
this.date = new FormControl(moment$8(this.defaultValue * 1000));
|
|
274
274
|
}
|
|
275
275
|
else {
|
|
276
|
-
this.dateObj.date = moment$
|
|
276
|
+
this.dateObj.date = moment$8(new Date()).format('YYYY-MM');
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
initName() {
|
|
@@ -282,7 +282,7 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
chosenTagHandler(value) {
|
|
285
|
-
const resultDate = moment$
|
|
285
|
+
const resultDate = moment$8.utc(value);
|
|
286
286
|
resultDate.hour(12);
|
|
287
287
|
const resultTag = {
|
|
288
288
|
name: this.name,
|
|
@@ -320,7 +320,7 @@ MonthTagComponent.propDecorators = {
|
|
|
320
320
|
};
|
|
321
321
|
|
|
322
322
|
// @ts-ignore
|
|
323
|
-
const moment$
|
|
323
|
+
const moment$7 = require('moment');
|
|
324
324
|
class QuarterTagComponent extends AnyTagComponent {
|
|
325
325
|
constructor() {
|
|
326
326
|
super();
|
|
@@ -330,8 +330,8 @@ class QuarterTagComponent extends AnyTagComponent {
|
|
|
330
330
|
this.dateFilter = (date) => {
|
|
331
331
|
let status = true;
|
|
332
332
|
this.lockedDate.forEach(timestamp => {
|
|
333
|
-
const lockDate = moment$
|
|
334
|
-
const quarterDate = moment$
|
|
333
|
+
const lockDate = moment$7.unix(timestamp);
|
|
334
|
+
const quarterDate = moment$7.unix(date.value);
|
|
335
335
|
if (lockDate.year() === quarterDate.year() && lockDate.month() === quarterDate.month()) {
|
|
336
336
|
date.disable = true;
|
|
337
337
|
status = false;
|
|
@@ -362,7 +362,7 @@ class QuarterTagComponent extends AnyTagComponent {
|
|
|
362
362
|
}
|
|
363
363
|
chosenTagHandler(value) {
|
|
364
364
|
const date = new Date(value * 1000);
|
|
365
|
-
const resultDate = moment$
|
|
365
|
+
const resultDate = moment$7.utc(date);
|
|
366
366
|
const resultTag = {
|
|
367
367
|
name: this.name,
|
|
368
368
|
value: parseInt(resultDate.format('X'), 10),
|
|
@@ -420,7 +420,7 @@ QuarterTagComponent.propDecorators = {
|
|
|
420
420
|
};
|
|
421
421
|
|
|
422
422
|
// @ts-ignore
|
|
423
|
-
const moment$
|
|
423
|
+
const moment$6 = require('moment');
|
|
424
424
|
const WEEK_FORMATS = {
|
|
425
425
|
parse: {
|
|
426
426
|
dateInput: 'WW-YYYY',
|
|
@@ -437,13 +437,13 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
437
437
|
constructor() {
|
|
438
438
|
super();
|
|
439
439
|
this.lockedDate = [];
|
|
440
|
-
this.date = new FormControl(moment$
|
|
440
|
+
this.date = new FormControl(moment$6());
|
|
441
441
|
this.selectedValue = '';
|
|
442
442
|
this.dateFilter = (date) => {
|
|
443
|
-
const calendarDate = moment$
|
|
443
|
+
const calendarDate = moment$6(date);
|
|
444
444
|
let status = true;
|
|
445
445
|
this.lockedDate.forEach(timestamp => {
|
|
446
|
-
const lockDate = moment$
|
|
446
|
+
const lockDate = moment$6.unix(timestamp);
|
|
447
447
|
return status = !(lockDate.week() === calendarDate.week() && lockDate.year() === calendarDate.year());
|
|
448
448
|
});
|
|
449
449
|
return status;
|
|
@@ -473,7 +473,7 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
chosenDateHandler(normalizedDay) {
|
|
476
|
-
const date = moment$
|
|
476
|
+
const date = moment$6(normalizedDay).unix();
|
|
477
477
|
this.chosenTagHandler(date);
|
|
478
478
|
}
|
|
479
479
|
chosenTagHandler(value) {
|
|
@@ -485,7 +485,7 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
485
485
|
else {
|
|
486
486
|
date = new Date(value * 1000);
|
|
487
487
|
}
|
|
488
|
-
const resultDate = moment$
|
|
488
|
+
const resultDate = moment$6(date);
|
|
489
489
|
const resultTag = {
|
|
490
490
|
name: this.name,
|
|
491
491
|
value: parseInt(resultDate.format('X'), 10),
|
|
@@ -496,8 +496,8 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
496
496
|
this.dateChange.emit(resultTag);
|
|
497
497
|
}
|
|
498
498
|
getWeekLabel(date) {
|
|
499
|
-
return 'W' + this.pad(moment$
|
|
500
|
-
' ' + moment$
|
|
499
|
+
return 'W' + this.pad(moment$6(date).isoWeek(), 2) +
|
|
500
|
+
' ' + moment$6(date).year();
|
|
501
501
|
}
|
|
502
502
|
getUTCTimestamp(date) {
|
|
503
503
|
return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0, 0);
|
|
@@ -510,7 +510,7 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
510
510
|
return date;
|
|
511
511
|
}
|
|
512
512
|
getWeekNumberByDate(date) {
|
|
513
|
-
return this.pad(moment$
|
|
513
|
+
return this.pad(moment$6(date).isoWeek(), 2);
|
|
514
514
|
}
|
|
515
515
|
pad(n, width, z = '0') {
|
|
516
516
|
z = z || '0';
|
|
@@ -538,7 +538,7 @@ WeekTagComponent.propDecorators = {
|
|
|
538
538
|
};
|
|
539
539
|
|
|
540
540
|
// @ts-ignore
|
|
541
|
-
const moment$
|
|
541
|
+
const moment$5 = require('moment');
|
|
542
542
|
const YEAR_FORMATS = {
|
|
543
543
|
parse: {
|
|
544
544
|
dateInput: 'YYYY',
|
|
@@ -555,12 +555,12 @@ class YearTagComponent extends AnyTagComponent {
|
|
|
555
555
|
constructor() {
|
|
556
556
|
super();
|
|
557
557
|
this.lockedDate = [];
|
|
558
|
-
this.date = new FormControl(moment$
|
|
558
|
+
this.date = new FormControl(moment$5());
|
|
559
559
|
this.dateFilter = (date) => {
|
|
560
|
-
const calendarDateYear = moment$
|
|
560
|
+
const calendarDateYear = moment$5(date).year();
|
|
561
561
|
let status = true;
|
|
562
562
|
this.lockedDate.forEach(timestamp => {
|
|
563
|
-
const lockDate = moment$
|
|
563
|
+
const lockDate = moment$5.unix(timestamp);
|
|
564
564
|
return status = !(lockDate.year() === calendarDateYear);
|
|
565
565
|
});
|
|
566
566
|
return status;
|
|
@@ -568,11 +568,11 @@ class YearTagComponent extends AnyTagComponent {
|
|
|
568
568
|
}
|
|
569
569
|
initDate() {
|
|
570
570
|
if (this.defaultValue) {
|
|
571
|
-
this.dateObj.date = moment$
|
|
572
|
-
this.date = new FormControl(moment$
|
|
571
|
+
this.dateObj.date = moment$5(new Date(this.defaultValue * 1000)).utc().format('YYYY');
|
|
572
|
+
this.date = new FormControl(moment$5(this.defaultValue * 1000));
|
|
573
573
|
}
|
|
574
574
|
else {
|
|
575
|
-
this.dateObj.date = moment$
|
|
575
|
+
this.dateObj.date = moment$5(new Date()).format('YYYY');
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
initName() {
|
|
@@ -582,10 +582,10 @@ class YearTagComponent extends AnyTagComponent {
|
|
|
582
582
|
}
|
|
583
583
|
chosenTagHandler(value) {
|
|
584
584
|
const date = new Date();
|
|
585
|
-
const year = moment$
|
|
585
|
+
const year = moment$5(value).year();
|
|
586
586
|
date.setTime(0);
|
|
587
587
|
date.setFullYear(year, 0, 1);
|
|
588
|
-
const resultDate = moment$
|
|
588
|
+
const resultDate = moment$5.utc(date);
|
|
589
589
|
resultDate.hour(12);
|
|
590
590
|
const resultTag = {
|
|
591
591
|
name: this.name,
|
|
@@ -677,7 +677,7 @@ DrTagComponent.propDecorators = {
|
|
|
677
677
|
tagChange: [{ type: Output }]
|
|
678
678
|
};
|
|
679
679
|
|
|
680
|
-
const moment$
|
|
680
|
+
const moment$4 = momentImported;
|
|
681
681
|
class ListTagComponent {
|
|
682
682
|
constructor() {
|
|
683
683
|
this.defaultValue = '';
|
|
@@ -717,7 +717,7 @@ ListTagComponent.propDecorators = {
|
|
|
717
717
|
};
|
|
718
718
|
|
|
719
719
|
// @ts-ignore
|
|
720
|
-
const moment$
|
|
720
|
+
const moment$3 = require('moment');
|
|
721
721
|
const DAY_FORMATS = {
|
|
722
722
|
parse: {
|
|
723
723
|
dateInput: 'DD-MM-YYYY',
|
|
@@ -734,19 +734,19 @@ class DayTagComponent extends AnyTagComponent {
|
|
|
734
734
|
constructor() {
|
|
735
735
|
super();
|
|
736
736
|
this.lockedDate = [];
|
|
737
|
-
this.date = new FormControl(moment$
|
|
737
|
+
this.date = new FormControl(moment$3());
|
|
738
738
|
this.dateFilter = (date) => {
|
|
739
|
-
const calendarDate = moment$
|
|
739
|
+
const calendarDate = moment$3(date).unix();
|
|
740
740
|
let status = true;
|
|
741
741
|
this.lockedDate.forEach(timestamp => status = !(timestamp === calendarDate));
|
|
742
742
|
return status;
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
745
|
initDate() {
|
|
746
|
-
const utcOffsetInMilliseconds = moment$
|
|
747
|
-
this.dateObj.date = moment$
|
|
746
|
+
const utcOffsetInMilliseconds = moment$3().utcOffset() * 60 * 1000;
|
|
747
|
+
this.dateObj.date = moment$3(moment$3().valueOf() + utcOffsetInMilliseconds);
|
|
748
748
|
if (this.defaultValue) {
|
|
749
|
-
this.dateObj.date = moment$
|
|
749
|
+
this.dateObj.date = moment$3(new Date(this.defaultValue * 1000)).utc();
|
|
750
750
|
this.date.setValue(this.dateObj.date);
|
|
751
751
|
}
|
|
752
752
|
}
|
|
@@ -756,11 +756,11 @@ class DayTagComponent extends AnyTagComponent {
|
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
chosenTagHandler(value) {
|
|
759
|
-
const date = moment$
|
|
759
|
+
const date = moment$3(value).unix();
|
|
760
760
|
const resultTag = {
|
|
761
761
|
name: this.name,
|
|
762
762
|
value: date,
|
|
763
|
-
label: moment$
|
|
763
|
+
label: moment$3.unix(date).format('MM/DD/YYYY'),
|
|
764
764
|
locked: !this.dateFilter(value)
|
|
765
765
|
};
|
|
766
766
|
console.log('resultTag', resultTag);
|
|
@@ -1421,6 +1421,79 @@ DrAvatarPipe.decorators = [
|
|
|
1421
1421
|
},] }
|
|
1422
1422
|
];
|
|
1423
1423
|
|
|
1424
|
+
var DateFromats;
|
|
1425
|
+
(function (DateFromats) {
|
|
1426
|
+
DateFromats["MAT_DEFAULT_DATE_FORMAT"] = "MM/DD/yyyy";
|
|
1427
|
+
DateFromats["DATE_INPUT_FORMAT"] = "YYYY/MM/DD";
|
|
1428
|
+
DateFromats["YEAR_FORMAT"] = "yyyy";
|
|
1429
|
+
DateFromats["MONTH_YEAR_FORMAT"] = "MM/yyyy";
|
|
1430
|
+
DateFromats["QUARTER_FORMAT"] = "Q/yyyy";
|
|
1431
|
+
DateFromats["WEEK_FORMAT"] = "W/yyyy";
|
|
1432
|
+
})(DateFromats || (DateFromats = {}));
|
|
1433
|
+
class CustomDateFormat {
|
|
1434
|
+
constructor() {
|
|
1435
|
+
this._parse = {
|
|
1436
|
+
dateInput: DateFromats.DATE_INPUT_FORMAT,
|
|
1437
|
+
};
|
|
1438
|
+
this._display = {
|
|
1439
|
+
dateInput: DateFromats.DATE_INPUT_FORMAT,
|
|
1440
|
+
monthYearLabel: 'MMM YYYY',
|
|
1441
|
+
dateA11yLabel: 'LL',
|
|
1442
|
+
monthYearA11yLabel: 'MMM YYYY',
|
|
1443
|
+
quarterYearLabel: 'Q/YYYY',
|
|
1444
|
+
yearLabel: 'YYYY'
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
set parse(parse) {
|
|
1448
|
+
this._parse = Object.assign({}, this._parse, parse);
|
|
1449
|
+
}
|
|
1450
|
+
get parse() {
|
|
1451
|
+
return this._parse;
|
|
1452
|
+
}
|
|
1453
|
+
set display(display) {
|
|
1454
|
+
this._display = Object.assign({}, this._display, display);
|
|
1455
|
+
}
|
|
1456
|
+
get display() {
|
|
1457
|
+
return this._display;
|
|
1458
|
+
}
|
|
1459
|
+
updateDateFormat(parse, display) {
|
|
1460
|
+
this.parse = parse;
|
|
1461
|
+
if (!display) {
|
|
1462
|
+
display = parse;
|
|
1463
|
+
}
|
|
1464
|
+
this.display = display;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
var DatePickerPeriodPosition;
|
|
1468
|
+
(function (DatePickerPeriodPosition) {
|
|
1469
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["END_OF_PERIOD"] = 0] = "END_OF_PERIOD";
|
|
1470
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["MIDDLE_OF_PERIOD"] = 1] = "MIDDLE_OF_PERIOD";
|
|
1471
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["START_OF_PERIOD"] = 2] = "START_OF_PERIOD";
|
|
1472
|
+
DatePickerPeriodPosition[DatePickerPeriodPosition["DEFAULT"] = 3] = "DEFAULT";
|
|
1473
|
+
})(DatePickerPeriodPosition || (DatePickerPeriodPosition = {}));
|
|
1474
|
+
var TimeframeOption;
|
|
1475
|
+
(function (TimeframeOption) {
|
|
1476
|
+
TimeframeOption["DAY"] = "day";
|
|
1477
|
+
TimeframeOption["MONTH"] = "month";
|
|
1478
|
+
TimeframeOption["QUARTER"] = "quarter";
|
|
1479
|
+
TimeframeOption["WEEK"] = "week";
|
|
1480
|
+
TimeframeOption["YEAR"] = "year";
|
|
1481
|
+
})(TimeframeOption || (TimeframeOption = {}));
|
|
1482
|
+
var CalendarView;
|
|
1483
|
+
(function (CalendarView) {
|
|
1484
|
+
CalendarView["FOR_DAYS"] = "month";
|
|
1485
|
+
CalendarView["FOR_MONTHS"] = "year";
|
|
1486
|
+
CalendarView["FOR_QUARTERS"] = "none";
|
|
1487
|
+
CalendarView["FOR_YEARS"] = "multi-year";
|
|
1488
|
+
})(CalendarView || (CalendarView = {}));
|
|
1489
|
+
var DateTags;
|
|
1490
|
+
(function (DateTags) {
|
|
1491
|
+
DateTags["TODAY"] = "today";
|
|
1492
|
+
DateTags["YESTERDAY"] = "yesterday";
|
|
1493
|
+
DateTags["THIS_MONTH"] = "this_month";
|
|
1494
|
+
DateTags["PREV_MONTH"] = "prev_month";
|
|
1495
|
+
})(DateTags || (DateTags = {}));
|
|
1496
|
+
|
|
1424
1497
|
const POPUP_POSITIONS = {
|
|
1425
1498
|
top: {
|
|
1426
1499
|
originX: 'center',
|
|
@@ -1516,6 +1589,12 @@ const POPUP_ANIMATION = [
|
|
|
1516
1589
|
animate(150, style({ opacity: 0 })),
|
|
1517
1590
|
]),
|
|
1518
1591
|
];
|
|
1592
|
+
const PRESET_TAGS_LIST = [
|
|
1593
|
+
{ key: DateTags.TODAY, label: 'Today' },
|
|
1594
|
+
{ key: DateTags.YESTERDAY, label: 'Yesterday' },
|
|
1595
|
+
{ key: DateTags.THIS_MONTH, label: 'This month' },
|
|
1596
|
+
{ key: DateTags.PREV_MONTH, label: 'Prev month' }
|
|
1597
|
+
];
|
|
1519
1598
|
|
|
1520
1599
|
class TooltipComponent {
|
|
1521
1600
|
constructor() {
|
|
@@ -3323,72 +3402,6 @@ DrModelDebounceChangeDirective.propDecorators = {
|
|
|
3323
3402
|
ngModelDebounceChange: [{ type: Output }]
|
|
3324
3403
|
};
|
|
3325
3404
|
|
|
3326
|
-
var DateFromats;
|
|
3327
|
-
(function (DateFromats) {
|
|
3328
|
-
DateFromats["MAT_DEFAULT_DATE_FORMAT"] = "MM/DD/yyyy";
|
|
3329
|
-
DateFromats["DATE_INPUT_FORMAT"] = "YYYY/MM/DD";
|
|
3330
|
-
DateFromats["YEAR_FORMAT"] = "yyyy";
|
|
3331
|
-
DateFromats["MONTH_YEAR_FORMAT"] = "MM/yyyy";
|
|
3332
|
-
DateFromats["QUARTER_FORMAT"] = "Q/yyyy";
|
|
3333
|
-
DateFromats["WEEK_FORMAT"] = "W/yyyy";
|
|
3334
|
-
})(DateFromats || (DateFromats = {}));
|
|
3335
|
-
class CustomDateFormat {
|
|
3336
|
-
constructor() {
|
|
3337
|
-
this._parse = {
|
|
3338
|
-
dateInput: DateFromats.DATE_INPUT_FORMAT,
|
|
3339
|
-
};
|
|
3340
|
-
this._display = {
|
|
3341
|
-
dateInput: DateFromats.DATE_INPUT_FORMAT,
|
|
3342
|
-
monthYearLabel: 'MMM YYYY',
|
|
3343
|
-
dateA11yLabel: 'LL',
|
|
3344
|
-
monthYearA11yLabel: 'MMM YYYY',
|
|
3345
|
-
quarterYearLabel: 'Q/YYYY',
|
|
3346
|
-
yearLabel: 'YYYY'
|
|
3347
|
-
};
|
|
3348
|
-
}
|
|
3349
|
-
set parse(parse) {
|
|
3350
|
-
this._parse = Object.assign({}, this._parse, parse);
|
|
3351
|
-
}
|
|
3352
|
-
get parse() {
|
|
3353
|
-
return this._parse;
|
|
3354
|
-
}
|
|
3355
|
-
set display(display) {
|
|
3356
|
-
this._display = Object.assign({}, this._display, display);
|
|
3357
|
-
}
|
|
3358
|
-
get display() {
|
|
3359
|
-
return this._display;
|
|
3360
|
-
}
|
|
3361
|
-
updateDateFormat(parse, display) {
|
|
3362
|
-
this.parse = parse;
|
|
3363
|
-
if (!display) {
|
|
3364
|
-
display = parse;
|
|
3365
|
-
}
|
|
3366
|
-
this.display = display;
|
|
3367
|
-
}
|
|
3368
|
-
}
|
|
3369
|
-
var DatePickerPeriodPosition;
|
|
3370
|
-
(function (DatePickerPeriodPosition) {
|
|
3371
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["END_OF_PERIOD"] = 0] = "END_OF_PERIOD";
|
|
3372
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["MIDDLE_OF_PERIOD"] = 1] = "MIDDLE_OF_PERIOD";
|
|
3373
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["START_OF_PERIOD"] = 2] = "START_OF_PERIOD";
|
|
3374
|
-
DatePickerPeriodPosition[DatePickerPeriodPosition["DEFAULT"] = 3] = "DEFAULT";
|
|
3375
|
-
})(DatePickerPeriodPosition || (DatePickerPeriodPosition = {}));
|
|
3376
|
-
var TimeframeOption;
|
|
3377
|
-
(function (TimeframeOption) {
|
|
3378
|
-
TimeframeOption["DAY"] = "day";
|
|
3379
|
-
TimeframeOption["MONTH"] = "month";
|
|
3380
|
-
TimeframeOption["QUARTER"] = "quarter";
|
|
3381
|
-
TimeframeOption["WEEK"] = "week";
|
|
3382
|
-
TimeframeOption["YEAR"] = "year";
|
|
3383
|
-
})(TimeframeOption || (TimeframeOption = {}));
|
|
3384
|
-
var CalendarView;
|
|
3385
|
-
(function (CalendarView) {
|
|
3386
|
-
CalendarView["FOR_DAYS"] = "month";
|
|
3387
|
-
CalendarView["FOR_MONTHS"] = "year";
|
|
3388
|
-
CalendarView["FOR_QUARTERS"] = "none";
|
|
3389
|
-
CalendarView["FOR_YEARS"] = "multi-year";
|
|
3390
|
-
})(CalendarView || (CalendarView = {}));
|
|
3391
|
-
|
|
3392
3405
|
const IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
|
3393
3406
|
var CHAT_MESSAGE_TYPE;
|
|
3394
3407
|
(function (CHAT_MESSAGE_TYPE) {
|
|
@@ -3520,14 +3533,37 @@ class DrSharedUtils {
|
|
|
3520
3533
|
return defaultFrame;
|
|
3521
3534
|
}
|
|
3522
3535
|
}
|
|
3536
|
+
static getDateByTag(tag) {
|
|
3537
|
+
const todayDate = momentImported().utc();
|
|
3538
|
+
switch (tag) {
|
|
3539
|
+
case DateTags.TODAY:
|
|
3540
|
+
return todayDate;
|
|
3541
|
+
case DateTags.YESTERDAY:
|
|
3542
|
+
todayDate.subtract(1, 'days');
|
|
3543
|
+
return todayDate;
|
|
3544
|
+
case DateTags.THIS_MONTH:
|
|
3545
|
+
todayDate.month();
|
|
3546
|
+
return todayDate;
|
|
3547
|
+
case DateTags.PREV_MONTH:
|
|
3548
|
+
todayDate.month();
|
|
3549
|
+
todayDate.subtract(1, 'months');
|
|
3550
|
+
return todayDate;
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3523
3553
|
}
|
|
3524
3554
|
|
|
3555
|
+
const moment$2 = require('moment');
|
|
3525
3556
|
class DrDatePickerService {
|
|
3526
3557
|
constructor() {
|
|
3527
3558
|
this.isTimeframeSelectionEnabled = false;
|
|
3528
3559
|
this.timeframe = TimeframeOption.DAY;
|
|
3529
3560
|
this.format$ = new BehaviorSubject(DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
3530
3561
|
this.updatedQuarter$ = new Subject();
|
|
3562
|
+
this.updatedDateAndClose$ = new Subject();
|
|
3563
|
+
this.presetTag$ = new BehaviorSubject('');
|
|
3564
|
+
this.onSameDaySelectedInCalendar$ = new Subject();
|
|
3565
|
+
this.keepPresetTag = false;
|
|
3566
|
+
this.isValueUpdating = false;
|
|
3531
3567
|
this.availableTimeframes = [
|
|
3532
3568
|
TimeframeOption.DAY,
|
|
3533
3569
|
TimeframeOption.WEEK,
|
|
@@ -3656,6 +3692,47 @@ class DrDatePickerService {
|
|
|
3656
3692
|
getDateModifiedByFiscalMonths(date, isSubtract = false) {
|
|
3657
3693
|
return date ? _.cloneDeep(date)[isSubtract ? 'subtract' : 'add'](this.fiscalYearMonthsModifier, 'month') : date;
|
|
3658
3694
|
}
|
|
3695
|
+
updateDatePickerByPreset(tag, calender) {
|
|
3696
|
+
this.keepPresetTag = true;
|
|
3697
|
+
let date = null;
|
|
3698
|
+
if (tag) {
|
|
3699
|
+
date = DrSharedUtils.getDateByTag(tag);
|
|
3700
|
+
switch (tag) {
|
|
3701
|
+
case DateTags.TODAY:
|
|
3702
|
+
this.updateTimeframeAndFormat(DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
3703
|
+
break;
|
|
3704
|
+
case DateTags.YESTERDAY:
|
|
3705
|
+
this.updateTimeframeAndFormat(DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
3706
|
+
break;
|
|
3707
|
+
case DateTags.THIS_MONTH:
|
|
3708
|
+
this.updateTimeframeAndFormat(DateFromats.MONTH_YEAR_FORMAT);
|
|
3709
|
+
this.selectDateInCalendarMonthView(date, calender);
|
|
3710
|
+
break;
|
|
3711
|
+
case DateTags.PREV_MONTH:
|
|
3712
|
+
this.updateTimeframeAndFormat(DateFromats.MONTH_YEAR_FORMAT);
|
|
3713
|
+
this.selectDateInCalendarMonthView(date, calender);
|
|
3714
|
+
break;
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
this.presetTag$.next(tag);
|
|
3718
|
+
this.updatedDateAndClose$.next(date);
|
|
3719
|
+
}
|
|
3720
|
+
selectDateInCalendarMonthView(date, calender) {
|
|
3721
|
+
setTimeout(() => {
|
|
3722
|
+
const monthView = calender.monthView;
|
|
3723
|
+
monthView._activeDate = date;
|
|
3724
|
+
monthView._selected = date;
|
|
3725
|
+
monthView._init();
|
|
3726
|
+
});
|
|
3727
|
+
}
|
|
3728
|
+
resetPresetTag() {
|
|
3729
|
+
if (!this.keepPresetTag) {
|
|
3730
|
+
this.presetTag$.next(null);
|
|
3731
|
+
}
|
|
3732
|
+
else {
|
|
3733
|
+
this.keepPresetTag = false;
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3659
3736
|
}
|
|
3660
3737
|
DrDatePickerService.decorators = [
|
|
3661
3738
|
{ type: Injectable }
|
|
@@ -3717,6 +3794,7 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3717
3794
|
this.timeframeSelection = false;
|
|
3718
3795
|
this.periodMonthLabel = '';
|
|
3719
3796
|
this.periodYearLabel = '';
|
|
3797
|
+
this.presetTagList = PRESET_TAGS_LIST;
|
|
3720
3798
|
this.calendarView = CalendarView;
|
|
3721
3799
|
_calendar.stateChanges.pipe(takeUntil(this._destroyed)).subscribe(() => this.setPeriodLabels());
|
|
3722
3800
|
this.datePickerService.format$.pipe(takeUntil(this._destroyed)).subscribe(value => {
|
|
@@ -3733,8 +3811,17 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3733
3811
|
this.transformDateInMultiyearViewAccordingToFY();
|
|
3734
3812
|
}
|
|
3735
3813
|
});
|
|
3814
|
+
_calendar._userSelection.subscribe(date => {
|
|
3815
|
+
if (!this.datePickerService.isValueUpdating) {
|
|
3816
|
+
this.datePickerService.onSameDaySelectedInCalendar$.next(date.value);
|
|
3817
|
+
}
|
|
3818
|
+
});
|
|
3736
3819
|
this.datePickerService.calendarInstance = _calendar;
|
|
3737
3820
|
}
|
|
3821
|
+
get selectedPresetTag() {
|
|
3822
|
+
return this.datePickerService.presetTag$.getValue();
|
|
3823
|
+
}
|
|
3824
|
+
;
|
|
3738
3825
|
ngOnInit() {
|
|
3739
3826
|
setTimeout(() => {
|
|
3740
3827
|
if (this._calendar.multiYearView) {
|
|
@@ -3759,7 +3846,11 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3759
3846
|
}
|
|
3760
3847
|
this.cdr.markForCheck();
|
|
3761
3848
|
}
|
|
3762
|
-
setTimeframe() {
|
|
3849
|
+
setTimeframe(value) {
|
|
3850
|
+
if (value !== this.selectedTimeframe) {
|
|
3851
|
+
this.datePickerService.resetPresetTag();
|
|
3852
|
+
}
|
|
3853
|
+
this.selectedTimeframe = value;
|
|
3763
3854
|
this.timeframeSelection = false;
|
|
3764
3855
|
this._calendar.currentView = this.selectedTimeframe;
|
|
3765
3856
|
const chosenTimeframeOption = this.timeframeOptions.filter(option => option.value === this.selectedTimeframe)[0];
|
|
@@ -3795,13 +3886,22 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3795
3886
|
multuYearView._selectedYear = multuYearView._activeDate.year();
|
|
3796
3887
|
multuYearView._init();
|
|
3797
3888
|
}
|
|
3889
|
+
onSelectPresetTag(tag) {
|
|
3890
|
+
if (tag.key === this.selectedPresetTag) {
|
|
3891
|
+
this.datePickerService.presetTag$.next(null);
|
|
3892
|
+
}
|
|
3893
|
+
else {
|
|
3894
|
+
this.datePickerService.presetTag$.next(tag.key);
|
|
3895
|
+
}
|
|
3896
|
+
this.datePickerService.updateDatePickerByPreset(this.selectedPresetTag, this._calendar);
|
|
3897
|
+
}
|
|
3798
3898
|
}
|
|
3799
3899
|
DrDatePickerCustomHeaderComponent.decorators = [
|
|
3800
3900
|
{ type: Component, args: [{
|
|
3801
3901
|
selector: 'dr-date-picker_custom-header.component',
|
|
3802
|
-
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [
|
|
3902
|
+
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",
|
|
3803
3903
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3804
|
-
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
|
|
3904
|
+
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"]
|
|
3805
3905
|
},] }
|
|
3806
3906
|
];
|
|
3807
3907
|
DrDatePickerCustomHeaderComponent.ctorParameters = () => [
|
|
@@ -3966,8 +4066,15 @@ class DrDatePickerComponent {
|
|
|
3966
4066
|
* @param timestamp
|
|
3967
4067
|
*/
|
|
3968
4068
|
setValue(timestamp) {
|
|
4069
|
+
// isValueUpdating is required for manage clicks on same dates: if isValueUpdating - true then
|
|
4070
|
+
// days are different and subscription on calendar day click action won't trigger Accessor ngModel update
|
|
4071
|
+
// one more time
|
|
4072
|
+
this.datePickerService.isValueUpdating = true;
|
|
3969
4073
|
this.writeValue(timestamp);
|
|
3970
4074
|
this.onChangeCallback(this.innerValue.unix());
|
|
4075
|
+
setTimeout(() => {
|
|
4076
|
+
this.datePickerService.isValueUpdating = false;
|
|
4077
|
+
});
|
|
3971
4078
|
}
|
|
3972
4079
|
}
|
|
3973
4080
|
DrDatePickerComponent.decorators = [
|
|
@@ -4007,6 +4114,7 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4007
4114
|
this.canSelectTimeframe = true;
|
|
4008
4115
|
// eslint-disable-next-line
|
|
4009
4116
|
this.onChangeFormat = new EventEmitter();
|
|
4117
|
+
this.onChangePresetTag = new EventEmitter();
|
|
4010
4118
|
this.pagingSetup = {
|
|
4011
4119
|
[TimeframeOption.YEAR]: (forward) => this.getNextDate('addCalendarYears', 1, forward),
|
|
4012
4120
|
[TimeframeOption.QUARTER]: (forward) => this.getNextDate('addCalendarMonths', 3, forward),
|
|
@@ -4021,6 +4129,23 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4021
4129
|
datePickerService.format$.pipe(takeUntil(this.destroyed$)).subscribe((value) => {
|
|
4022
4130
|
this.onChangeFormat.emit(datePickerService.normalizeValue(value));
|
|
4023
4131
|
});
|
|
4132
|
+
datePickerService.presetTag$.pipe(takeUntil(this.destroyed$)).subscribe((value) => {
|
|
4133
|
+
let tagObj = PRESET_TAGS_LIST.find((val) => (val === null || val === void 0 ? void 0 : val.key) === value);
|
|
4134
|
+
this.presetTagSelected = tagObj === null || tagObj === void 0 ? void 0 : tagObj.label;
|
|
4135
|
+
this.onChangePresetTag.emit(value);
|
|
4136
|
+
});
|
|
4137
|
+
this.datePickerService.onSameDaySelectedInCalendar$.pipe(takeUntil(this.destroyed$)).subscribe((value) => {
|
|
4138
|
+
this.setValueFromMoment(value);
|
|
4139
|
+
});
|
|
4140
|
+
datePickerService.updatedDateAndClose$.pipe(takeUntil(this.destroyed$)).subscribe((value) => {
|
|
4141
|
+
if (value) {
|
|
4142
|
+
this.setValueFromMoment(value);
|
|
4143
|
+
}
|
|
4144
|
+
else {
|
|
4145
|
+
this.onChangeCallback(this.innerValue.unix());
|
|
4146
|
+
}
|
|
4147
|
+
this.datePicker.close();
|
|
4148
|
+
});
|
|
4024
4149
|
}
|
|
4025
4150
|
get isDashboardClassDisplayed() {
|
|
4026
4151
|
return this.isDashboardDatepicker;
|
|
@@ -4037,6 +4162,19 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4037
4162
|
this.datePickerService.availableTimeframes = value;
|
|
4038
4163
|
}
|
|
4039
4164
|
}
|
|
4165
|
+
set isUsingDateTagPresets(flag) {
|
|
4166
|
+
this.datePickerService.isUsingDateTagPresets = flag;
|
|
4167
|
+
}
|
|
4168
|
+
set presetTag(tag) {
|
|
4169
|
+
this.datePickerService.presetTag$.next(tag);
|
|
4170
|
+
}
|
|
4171
|
+
get value() {
|
|
4172
|
+
return this.innerValue;
|
|
4173
|
+
}
|
|
4174
|
+
set value(v) {
|
|
4175
|
+
this.setValueFromMoment(v);
|
|
4176
|
+
this.cdr.markForCheck();
|
|
4177
|
+
}
|
|
4040
4178
|
get displayedFormattedValue() {
|
|
4041
4179
|
if (!this.value) {
|
|
4042
4180
|
return this.placeholder;
|
|
@@ -4069,6 +4207,7 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4069
4207
|
// this is required for not sending extra requests when user quickly clicking on pagination
|
|
4070
4208
|
// here we do the same as in setValueFromMoment(newValue) with difference
|
|
4071
4209
|
// that updating of ngModel/formControl is debounced
|
|
4210
|
+
this.datePickerService.resetPresetTag();
|
|
4072
4211
|
const timestamp = newValue.unix();
|
|
4073
4212
|
this.writeValue(timestamp);
|
|
4074
4213
|
this.onChangeDebounced$.next(this.innerValue.unix());
|
|
@@ -4077,6 +4216,15 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4077
4216
|
this.setValueFromMoment(newValue);
|
|
4078
4217
|
}
|
|
4079
4218
|
}
|
|
4219
|
+
/**
|
|
4220
|
+
* Set inner value from timestamp and propagate
|
|
4221
|
+
*
|
|
4222
|
+
* @param timestamp
|
|
4223
|
+
*/
|
|
4224
|
+
setValue(timestamp) {
|
|
4225
|
+
this.datePickerService.resetPresetTag();
|
|
4226
|
+
super.setValue(timestamp);
|
|
4227
|
+
}
|
|
4080
4228
|
writeValue(value) {
|
|
4081
4229
|
super.writeValue(value);
|
|
4082
4230
|
if (!value)
|
|
@@ -4099,13 +4247,13 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4099
4247
|
DrDatePickerWithTimeframeComponent.decorators = [
|
|
4100
4248
|
{ type: Component, args: [{
|
|
4101
4249
|
selector: 'dr-date-picker-with-timeframe',
|
|
4102
|
-
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
|
|
4250
|
+
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",
|
|
4103
4251
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4104
4252
|
providers: [
|
|
4105
4253
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
|
|
4106
4254
|
{ provide: DrDatePickerService }
|
|
4107
4255
|
],
|
|
4108
|
-
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:
|
|
4256
|
+
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"]
|
|
4109
4257
|
},] }
|
|
4110
4258
|
];
|
|
4111
4259
|
DrDatePickerWithTimeframeComponent.ctorParameters = () => [
|
|
@@ -4120,7 +4268,10 @@ DrDatePickerWithTimeframeComponent.propDecorators = {
|
|
|
4120
4268
|
canSelectTimeframe: [{ type: Input }],
|
|
4121
4269
|
availableTimeframes: [{ type: Input }],
|
|
4122
4270
|
paginationDebounce: [{ type: Input }],
|
|
4123
|
-
|
|
4271
|
+
isUsingDateTagPresets: [{ type: Input }],
|
|
4272
|
+
presetTag: [{ type: Input }],
|
|
4273
|
+
onChangeFormat: [{ type: Output }],
|
|
4274
|
+
onChangePresetTag: [{ type: Output }]
|
|
4124
4275
|
};
|
|
4125
4276
|
|
|
4126
4277
|
class DrDatePickerFormatDirective {
|
|
@@ -4176,44 +4327,6 @@ DrShowTimeframePipe.decorators = [
|
|
|
4176
4327
|
},] }
|
|
4177
4328
|
];
|
|
4178
4329
|
|
|
4179
|
-
// !!! Please do not use such approach in other places
|
|
4180
|
-
// Hard fix for 'none' calendar view selection
|
|
4181
|
-
MatCalendar.prototype.focusActiveCell = function () {
|
|
4182
|
-
var _a;
|
|
4183
|
-
(_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
|
|
4184
|
-
};
|
|
4185
|
-
const components$2 = [
|
|
4186
|
-
DrButtonComponent,
|
|
4187
|
-
RadioButtonComponent,
|
|
4188
|
-
RadioGroupComponent,
|
|
4189
|
-
CheckboxComponent,
|
|
4190
|
-
DrInputComponent,
|
|
4191
|
-
DrSelectComponent,
|
|
4192
|
-
DrToggleComponent,
|
|
4193
|
-
DrToggleButtonComponent,
|
|
4194
|
-
DrDatePickerComponent,
|
|
4195
|
-
DrDatePickerWithTimeframeComponent,
|
|
4196
|
-
DrDatePickerFormatDirective,
|
|
4197
|
-
DrDatePickerCustomHeaderComponent,
|
|
4198
|
-
DrModelDebounceChangeDirective,
|
|
4199
|
-
DrShowTimeframePipe
|
|
4200
|
-
];
|
|
4201
|
-
class DrInputsModule {
|
|
4202
|
-
}
|
|
4203
|
-
DrInputsModule.decorators = [
|
|
4204
|
-
{ type: NgModule, args: [{
|
|
4205
|
-
declarations: components$2,
|
|
4206
|
-
exports: components$2,
|
|
4207
|
-
imports: [
|
|
4208
|
-
FormsModule,
|
|
4209
|
-
ReactiveFormsModule,
|
|
4210
|
-
CommonModule,
|
|
4211
|
-
NgSelectModule,
|
|
4212
|
-
MatDatepickerModule
|
|
4213
|
-
]
|
|
4214
|
-
},] }
|
|
4215
|
-
];
|
|
4216
|
-
|
|
4217
4330
|
class TooltipInfoComponent {
|
|
4218
4331
|
constructor() {
|
|
4219
4332
|
}
|
|
@@ -4328,6 +4441,46 @@ DrTooltipModule.decorators = [
|
|
|
4328
4441
|
},] }
|
|
4329
4442
|
];
|
|
4330
4443
|
|
|
4444
|
+
// !!! Please do not use such approach in other places
|
|
4445
|
+
// Hard fix for 'none' calendar view selection
|
|
4446
|
+
MatCalendar.prototype.focusActiveCell = function () {
|
|
4447
|
+
var _a;
|
|
4448
|
+
(_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
|
|
4449
|
+
};
|
|
4450
|
+
const components$2 = [
|
|
4451
|
+
DrButtonComponent,
|
|
4452
|
+
RadioButtonComponent,
|
|
4453
|
+
RadioGroupComponent,
|
|
4454
|
+
CheckboxComponent,
|
|
4455
|
+
DrInputComponent,
|
|
4456
|
+
DrSelectComponent,
|
|
4457
|
+
DrToggleComponent,
|
|
4458
|
+
DrToggleButtonComponent,
|
|
4459
|
+
DrDatePickerComponent,
|
|
4460
|
+
DrDatePickerWithTimeframeComponent,
|
|
4461
|
+
DrDatePickerFormatDirective,
|
|
4462
|
+
DrDatePickerCustomHeaderComponent,
|
|
4463
|
+
DrModelDebounceChangeDirective,
|
|
4464
|
+
DrShowTimeframePipe
|
|
4465
|
+
];
|
|
4466
|
+
class DrInputsModule {
|
|
4467
|
+
}
|
|
4468
|
+
DrInputsModule.decorators = [
|
|
4469
|
+
{ type: NgModule, args: [{
|
|
4470
|
+
declarations: components$2,
|
|
4471
|
+
exports: components$2,
|
|
4472
|
+
imports: [
|
|
4473
|
+
FormsModule,
|
|
4474
|
+
ReactiveFormsModule,
|
|
4475
|
+
CommonModule,
|
|
4476
|
+
NgSelectModule,
|
|
4477
|
+
MatDatepickerModule,
|
|
4478
|
+
MatTooltipModule,
|
|
4479
|
+
DrTooltipModule
|
|
4480
|
+
]
|
|
4481
|
+
},] }
|
|
4482
|
+
];
|
|
4483
|
+
|
|
4331
4484
|
class DrAvatarModule {
|
|
4332
4485
|
}
|
|
4333
4486
|
DrAvatarModule.decorators = [
|
|
@@ -5008,5 +5161,5 @@ DrChatModule.decorators = [
|
|
|
5008
5161
|
* Generated bundle index. Do not edit.
|
|
5009
5162
|
*/
|
|
5010
5163
|
|
|
5011
|
-
export { AnyTagComponent, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, ChatRole, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrChatModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, TimeframeOption, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$3 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, TooltipInfoComponent as ɵi, TooltipInfoSimpleComponent as ɵj, TooltipNoBodyComponent as ɵk, TooltipProcessDefaultComponent as ɵl, StepperComponent as ɵm, DialogWrapperComponent as ɵn, DialogModalWrapperComponent as ɵo, DrChatComponent as ɵp, DrChatCustomMessageService as ɵq, DrChatMessageComponent as ɵr, DrChatFormComponent as ɵs, DrChatMessageTextComponent as ɵt, DrChatMessageFileComponent as ɵu, DrChatCustomMessageDirective as ɵv };
|
|
5164
|
+
export { AnyTagComponent, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, ChatRole, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DateTags, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrChatModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, TimeframeOption, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$3 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, TooltipInfoComponent as ɵi, TooltipInfoSimpleComponent as ɵj, TooltipNoBodyComponent as ɵk, TooltipProcessDefaultComponent as ɵl, StepperComponent as ɵm, DialogWrapperComponent as ɵn, DialogModalWrapperComponent as ɵo, DrChatComponent as ɵp, DrChatCustomMessageService as ɵq, DrChatMessageComponent as ɵr, DrChatFormComponent as ɵs, DrChatMessageTextComponent as ɵt, DrChatMessageFileComponent as ɵu, DrChatCustomMessageDirective as ɵv };
|
|
5012
5165
|
//# sourceMappingURL=datarailsshared-datarailsshared.js.map
|