@datarailsshared/datarailsshared 1.4.54 → 1.4.55
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 +103 -25
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.55.tgz +0 -0
- package/datarailsshared-datarailsshared.d.ts +1 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/datarailsshared-datarailsshared.js +2 -1
- package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +6 -2
- package/esm2015/lib/dr-dropdown/dr-dropdown.directive.js +21 -5
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +11 -9
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +19 -4
- package/esm2015/lib/dr-inputs/date-pickers/dr-show-timeframe.pipe.js +12 -0
- package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +19 -3
- package/esm2015/lib/dr-inputs/dr-inputs.module.js +4 -2
- package/esm2015/lib/models/datePicker.js +3 -1
- package/esm2015/lib/utils/dr-shared-utils.js +3 -1
- package/fesm2015/datarailsshared-datarailsshared.js +88 -19
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-dropdown/dr-dropdown.component.d.ts +2 -0
- package/lib/dr-dropdown/dr-dropdown.directive.d.ts +2 -0
- package/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.d.ts +3 -1
- package/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.d.ts +2 -1
- package/lib/dr-inputs/date-pickers/dr-show-timeframe.pipe.d.ts +6 -0
- package/lib/dr-inputs/date-pickers/services/dr-date-picker.service.d.ts +2 -1
- package/lib/models/datePicker.d.ts +4 -1
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.54.tgz +0 -0
|
@@ -2755,6 +2755,7 @@
|
|
|
2755
2755
|
this.menuService = menuService;
|
|
2756
2756
|
this.cdr = cdr;
|
|
2757
2757
|
this.position = 'left';
|
|
2758
|
+
this.wasHovered = false;
|
|
2758
2759
|
}
|
|
2759
2760
|
Object.defineProperty(DrDropdownComponent.prototype, "options", {
|
|
2760
2761
|
set: function (data) {
|
|
@@ -2780,6 +2781,9 @@
|
|
|
2780
2781
|
enumerable: false,
|
|
2781
2782
|
configurable: true
|
|
2782
2783
|
});
|
|
2784
|
+
DrDropdownComponent.prototype.onMouseEnter = function () {
|
|
2785
|
+
this.wasHovered = true;
|
|
2786
|
+
};
|
|
2783
2787
|
DrDropdownComponent.prototype.onMouseLeave = function () {
|
|
2784
2788
|
if (this.drDropdownInHover)
|
|
2785
2789
|
this.menuService.destroy();
|
|
@@ -2848,7 +2852,7 @@
|
|
|
2848
2852
|
DrDropdownComponent.decorators = [
|
|
2849
2853
|
{ type: i0.Component, args: [{
|
|
2850
2854
|
selector: 'dr-dropdown',
|
|
2851
|
-
template: "<div #menuContainer\n (mouseleave)=\"onMouseLeave()\"\n (clickOutside)=\"onClickedOutside()\"\n [drDropdownPosition]=\"option\"\n #dropdownPosition=\"dropdownPosition\"\n [position]=\"position\"\n [class]=\"containerClass\"\n class=\"dr-dropdown\">\n <div class=\"dr-dropdown__container\">\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\n (click)=\"action(act)\"\n [drTooltip]=\"tooltipToShow(act)\"\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\n class=\"dr-dropdown__container__item\"\n [class.item-disabled]=\"disabled(act)\"\n [class.item-selected]=\"selected(act)\"\n [class.separate-line]=\"act.separateLine\">\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\n <i *ngFor=\"let actionIcon of act.actionIcons\"\n [class]=\"actionIcon.icon\"\n [class.showOnHover]=\"actionIcon.showOnHover\"\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\n </div>\n </div>\n</div>\n",
|
|
2855
|
+
template: "<div #menuContainer\n (mouseleave)=\"onMouseLeave()\"\n (mouseenter)=\"onMouseEnter()\"\n (clickOutside)=\"onClickedOutside()\"\n [drDropdownPosition]=\"option\"\n #dropdownPosition=\"dropdownPosition\"\n [position]=\"position\"\n [class]=\"containerClass\"\n class=\"dr-dropdown\">\n <div class=\"dr-dropdown__container\">\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\n (click)=\"action(act)\"\n [drTooltip]=\"tooltipToShow(act)\"\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\n class=\"dr-dropdown__container__item\"\n [class.item-disabled]=\"disabled(act)\"\n [class.item-selected]=\"selected(act)\"\n [class.separate-line]=\"act.separateLine\">\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\n <i *ngFor=\"let actionIcon of act.actionIcons\"\n [class]=\"actionIcon.icon\"\n [class.showOnHover]=\"actionIcon.showOnHover\"\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\n </div>\n </div>\n</div>\n",
|
|
2852
2856
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2853
2857
|
styles: ["::ng-deep .dr-dropdown__container__item .dr-dropdown{visibility:hidden;transition-delay:.2s}::ng-deep .dr-dropdown__container__item:hover>*>.dr-dropdown{visibility:visible;transition-delay:0s}::ng-deep .dr-dropdown__tooltip>.default-content{max-width:300px;white-space:normal!important}.dr-dropdown{position:absolute;z-index:-1;top:0;left:0;width:auto}.dr-dropdown__container{display:flex;flex-direction:column;background:#fff;border-radius:4px;box-shadow:0 4px 8px 1px #00000040;padding:8px 0;overflow-y:auto;max-height:60vh}.dr-dropdown__container__item{display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}.dr-dropdown__container__item.separate-line{border-top:1px solid #BCBCBC}.dr-dropdown__container__item:hover{background-color:#f9faff}.dr-dropdown__container__item:hover .showOnHover{visibility:visible}.dr-dropdown__container__item.item-selected{background:#F3F7FF}.dr-dropdown__container__item.item-disabled,.dr-dropdown__container__item.item-disabled i,.dr-dropdown__container__item.item-disabled .dr-dropdown__container__item__text{color:#bcbcbc}.dr-dropdown__container__item i:first-child{margin-right:8px}.dr-dropdown__container__item__text{margin-right:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown__container__item i{color:#4e566c}.dr-dropdown__container__item i:hover{color:#4646ce}.dr-dropdown__container__item .showOnHover{visibility:hidden}.dr-dropdown.content-top{transform:translate(-50%,-100%)}.dr-dropdown.content-top-left{transform:translate(-100%,-100%)}.dr-dropdown.content-bottom{transform:translate(-50%,50%)}.dr-dropdown.content-bottom-left{transform:translate(-90%,35%)}.dr-dropdown.content-bottom-right{transform:translateY(15%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
|
|
2854
2858
|
},] }
|
|
@@ -2871,6 +2875,7 @@
|
|
|
2871
2875
|
this.el = el;
|
|
2872
2876
|
this._document = _document;
|
|
2873
2877
|
this.position = 'left';
|
|
2878
|
+
this.mouseleaveTimeout = 200;
|
|
2874
2879
|
}
|
|
2875
2880
|
DrDropdownDirective.prototype.elementHover = function () {
|
|
2876
2881
|
if (!this.drDropdownInHover)
|
|
@@ -2880,6 +2885,17 @@
|
|
|
2880
2885
|
DrDropdownDirective.prototype.elementClick = function () {
|
|
2881
2886
|
this.openDropdown();
|
|
2882
2887
|
};
|
|
2888
|
+
DrDropdownDirective.prototype.leaveDropdownTriggerElement = function () {
|
|
2889
|
+
var _this = this;
|
|
2890
|
+
if (this.drDropdownInHover) {
|
|
2891
|
+
setTimeout(function (_) {
|
|
2892
|
+
if (_this.contentCmpRef && !_this.contentCmpRef.instance.wasHovered) {
|
|
2893
|
+
_this.contentCmpRef.destroy();
|
|
2894
|
+
_this.contentCmpRef = null;
|
|
2895
|
+
}
|
|
2896
|
+
}, this.mouseleaveTimeout);
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2883
2899
|
DrDropdownDirective.prototype.documentClick = function (e) {
|
|
2884
2900
|
this.closeDropdown(e);
|
|
2885
2901
|
};
|
|
@@ -2902,13 +2918,17 @@
|
|
|
2902
2918
|
}
|
|
2903
2919
|
};
|
|
2904
2920
|
DrDropdownDirective.prototype.closeDropdown = function (e) {
|
|
2905
|
-
|
|
2906
|
-
if (menuItem.contains('dr-dropdown__container__item') || menuItem.contains('dr-dropdown__container__item__text')) {
|
|
2921
|
+
if (!this.contentCmpRef) {
|
|
2907
2922
|
return;
|
|
2908
2923
|
}
|
|
2909
|
-
var
|
|
2910
|
-
|
|
2911
|
-
|
|
2924
|
+
var clickTarget = e.target;
|
|
2925
|
+
var triggerElement = this.el.nativeElement;
|
|
2926
|
+
var dropdownElement = this.contentCmpRef.location.nativeElement;
|
|
2927
|
+
var isClickTriggerElement = triggerElement.contains(clickTarget) || triggerElement === clickTarget;
|
|
2928
|
+
var isClickDropdownContents = dropdownElement.contains(clickTarget);
|
|
2929
|
+
if (!isClickTriggerElement && !isClickDropdownContents) {
|
|
2930
|
+
var elems_1 = this._document.querySelectorAll('dr-dropdown');
|
|
2931
|
+
setTimeout(function () { return elems_1.forEach(function (item) { return item.remove(); }); }, 100);
|
|
2912
2932
|
}
|
|
2913
2933
|
};
|
|
2914
2934
|
DrDropdownDirective.prototype.showMenu = function (options) {
|
|
@@ -2946,6 +2966,7 @@
|
|
|
2946
2966
|
contentCmpRef: [{ type: i0.ViewChild, args: [DrDropdownComponent, { static: true, read: i0.ViewContainerRef },] }],
|
|
2947
2967
|
elementHover: [{ type: i0.HostListener, args: ['mouseenter',] }],
|
|
2948
2968
|
elementClick: [{ type: i0.HostListener, args: ['click',] }],
|
|
2969
|
+
leaveDropdownTriggerElement: [{ type: i0.HostListener, args: ['mouseleave',] }],
|
|
2949
2970
|
documentClick: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
2950
2971
|
};
|
|
2951
2972
|
|
|
@@ -3467,6 +3488,7 @@
|
|
|
3467
3488
|
DateFromats["YEAR_FORMAT"] = "yyyy";
|
|
3468
3489
|
DateFromats["MONTH_YEAR_FORMAT"] = "MM/yyyy";
|
|
3469
3490
|
DateFromats["QUARTER_FORMAT"] = "Q/yyyy";
|
|
3491
|
+
DateFromats["WEEK_FORMAT"] = "W/yyyy";
|
|
3470
3492
|
})(exports.DateFromats || (exports.DateFromats = {}));
|
|
3471
3493
|
var CustomDateFormat = /** @class */ (function () {
|
|
3472
3494
|
function CustomDateFormat() {
|
|
@@ -3523,6 +3545,7 @@
|
|
|
3523
3545
|
TimeframeOption["DAY"] = "day";
|
|
3524
3546
|
TimeframeOption["MONTH"] = "month";
|
|
3525
3547
|
TimeframeOption["QUARTER"] = "quarter";
|
|
3548
|
+
TimeframeOption["WEEK"] = "week";
|
|
3526
3549
|
TimeframeOption["YEAR"] = "year";
|
|
3527
3550
|
})(exports.TimeframeOption || (exports.TimeframeOption = {}));
|
|
3528
3551
|
exports.CalendarView = void 0;
|
|
@@ -3631,6 +3654,8 @@
|
|
|
3631
3654
|
return exports.TimeframeOption.QUARTER;
|
|
3632
3655
|
case lowerCaseFormat.includes('d'):
|
|
3633
3656
|
return exports.TimeframeOption.DAY;
|
|
3657
|
+
case lowerCaseFormat.includes('w'):
|
|
3658
|
+
return exports.TimeframeOption.WEEK;
|
|
3634
3659
|
case lowerCaseFormat.includes('m'):
|
|
3635
3660
|
return exports.TimeframeOption.MONTH;
|
|
3636
3661
|
case lowerCaseFormat.includes('y'):
|
|
@@ -3648,15 +3673,31 @@
|
|
|
3648
3673
|
this.timeframe = exports.TimeframeOption.DAY;
|
|
3649
3674
|
this.format$ = new rxjs.BehaviorSubject(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
|
|
3650
3675
|
this.updatedQuarter$ = new rxjs.Subject();
|
|
3676
|
+
this.availableTimeframes = [
|
|
3677
|
+
exports.TimeframeOption.DAY,
|
|
3678
|
+
exports.TimeframeOption.WEEK,
|
|
3679
|
+
exports.TimeframeOption.MONTH,
|
|
3680
|
+
exports.TimeframeOption.QUARTER,
|
|
3681
|
+
exports.TimeframeOption.YEAR
|
|
3682
|
+
];
|
|
3651
3683
|
this.formatConfig = {
|
|
3652
3684
|
day: exports.DateFromats.MAT_DEFAULT_DATE_FORMAT,
|
|
3653
3685
|
month: exports.DateFromats.MONTH_YEAR_FORMAT,
|
|
3654
3686
|
year: exports.DateFromats.YEAR_FORMAT,
|
|
3655
3687
|
quarter: exports.DateFromats.QUARTER_FORMAT,
|
|
3688
|
+
week: exports.DateFromats.WEEK_FORMAT
|
|
3656
3689
|
};
|
|
3657
3690
|
}
|
|
3658
|
-
DrDatePickerService.prototype.
|
|
3659
|
-
|
|
3691
|
+
DrDatePickerService.prototype.getDisplayPrefix = function () {
|
|
3692
|
+
var formatCached = this.format$.getValue();
|
|
3693
|
+
switch (true) {
|
|
3694
|
+
case formatCached === null || formatCached === void 0 ? void 0 : formatCached.includes('Q'):
|
|
3695
|
+
return 'Q';
|
|
3696
|
+
case formatCached === null || formatCached === void 0 ? void 0 : formatCached.includes('W'):
|
|
3697
|
+
return 'W';
|
|
3698
|
+
default:
|
|
3699
|
+
return '';
|
|
3700
|
+
}
|
|
3660
3701
|
};
|
|
3661
3702
|
DrDatePickerService.prototype.getTimeframe = function (format) {
|
|
3662
3703
|
return DrSharedUtils.getTimeframeByDateFormat(format);
|
|
@@ -3692,6 +3733,7 @@
|
|
|
3692
3733
|
this.quarters = [1, 2, 3, 4];
|
|
3693
3734
|
this.selectedQuarter = 1;
|
|
3694
3735
|
this.timeframeOptions = [{
|
|
3736
|
+
timeframe: exports.TimeframeOption.DAY,
|
|
3695
3737
|
title: 'Day',
|
|
3696
3738
|
value: exports.CalendarView.FOR_DAYS,
|
|
3697
3739
|
format: this.datePickerService.formatConfig.day,
|
|
@@ -3699,16 +3741,27 @@
|
|
|
3699
3741
|
.format(_this._calendar.activeDate, _this._dateFormats.display.monthYearLabel)
|
|
3700
3742
|
.toLocaleUpperCase(); }
|
|
3701
3743
|
}, {
|
|
3744
|
+
timeframe: exports.TimeframeOption.WEEK,
|
|
3745
|
+
title: 'Week',
|
|
3746
|
+
value: exports.CalendarView.FOR_DAYS,
|
|
3747
|
+
format: this.datePickerService.formatConfig.week,
|
|
3748
|
+
periodLabel: function () { return _this._dateAdapter
|
|
3749
|
+
.format(_this._calendar.activeDate, _this._dateFormats.display.monthYearLabel)
|
|
3750
|
+
.toLocaleUpperCase(); }
|
|
3751
|
+
}, {
|
|
3752
|
+
timeframe: exports.TimeframeOption.MONTH,
|
|
3702
3753
|
title: 'Month',
|
|
3703
3754
|
value: exports.CalendarView.FOR_MONTHS,
|
|
3704
3755
|
format: this.datePickerService.formatConfig.month,
|
|
3705
3756
|
periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
|
|
3706
3757
|
}, {
|
|
3758
|
+
timeframe: exports.TimeframeOption.QUARTER,
|
|
3707
3759
|
title: 'Quarter',
|
|
3708
3760
|
value: exports.CalendarView.FOR_QUARTERS,
|
|
3709
3761
|
format: this.datePickerService.formatConfig.quarter,
|
|
3710
3762
|
periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
|
|
3711
3763
|
}, {
|
|
3764
|
+
timeframe: exports.TimeframeOption.YEAR,
|
|
3712
3765
|
title: 'Year',
|
|
3713
3766
|
value: exports.CalendarView.FOR_YEARS,
|
|
3714
3767
|
format: this.datePickerService.formatConfig.year,
|
|
@@ -3736,6 +3789,9 @@
|
|
|
3736
3789
|
_this.selectedTimeframe = _this.timeframeOptions.filter(function (option) { return option.format == value; })[0].value;
|
|
3737
3790
|
_calendar.currentView = _this.selectedTimeframe;
|
|
3738
3791
|
_this.setPeriodLabels();
|
|
3792
|
+
if (_this.selectedTimeframe === exports.CalendarView.FOR_QUARTERS) {
|
|
3793
|
+
_this.selectedQuarter = moment$1(_this._calendar.activeDate).quarter();
|
|
3794
|
+
}
|
|
3739
3795
|
});
|
|
3740
3796
|
_calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
|
|
3741
3797
|
}
|
|
@@ -3747,7 +3803,7 @@
|
|
|
3747
3803
|
var _this = this;
|
|
3748
3804
|
var currentTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this._calendar.currentView; })[0];
|
|
3749
3805
|
var fullPeriodLabel = currentTimeframeOption.periodLabel();
|
|
3750
|
-
if (this._calendar.currentView ===
|
|
3806
|
+
if (this._calendar.currentView === exports.CalendarView.FOR_DAYS) {
|
|
3751
3807
|
this.periodMonthLabel = fullPeriodLabel.slice(0, 3);
|
|
3752
3808
|
this.periodYearLabel = fullPeriodLabel.slice(4);
|
|
3753
3809
|
}
|
|
@@ -3797,7 +3853,7 @@
|
|
|
3797
3853
|
DrDatePickerCustomHeaderComponent.decorators = [
|
|
3798
3854
|
{ type: i0.Component, args: [{
|
|
3799
3855
|
selector: 'dr-date-picker_custom-header.component',
|
|
3800
|
-
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [(ngModel)]=\"selectedTimeframe\"\n [items]=\"timeframeOptions\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe()\">\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",
|
|
3856
|
+
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\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()\">\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",
|
|
3801
3857
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3802
3858
|
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 8px;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"]
|
|
3803
3859
|
},] }
|
|
@@ -3975,7 +4031,7 @@
|
|
|
3975
4031
|
var DrDatePickerWithTimeframeComponent = /** @class */ (function (_super) {
|
|
3976
4032
|
__extends(DrDatePickerWithTimeframeComponent, _super);
|
|
3977
4033
|
function DrDatePickerWithTimeframeComponent(cdr, dateAdapter, datePickerService) {
|
|
3978
|
-
var
|
|
4034
|
+
var _a;
|
|
3979
4035
|
var _this = _super.call(this, cdr, dateAdapter, datePickerService) || this;
|
|
3980
4036
|
_this.cdr = cdr;
|
|
3981
4037
|
_this.dateAdapter = dateAdapter;
|
|
@@ -3983,12 +4039,13 @@
|
|
|
3983
4039
|
_this.isDashboardDatepicker = false;
|
|
3984
4040
|
_this.canSelectTimeframe = true;
|
|
3985
4041
|
_this.onChangeFormat = new i0.EventEmitter();
|
|
3986
|
-
_this.pagingSetup = (
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
4042
|
+
_this.pagingSetup = (_a = {},
|
|
4043
|
+
_a[exports.TimeframeOption.YEAR] = function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
|
|
4044
|
+
_a[exports.TimeframeOption.QUARTER] = function (forward) { return _this.pagingDateChange('addCalendarMonths', 3, forward); },
|
|
4045
|
+
_a[exports.TimeframeOption.MONTH] = function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
|
|
4046
|
+
_a[exports.TimeframeOption.DAY] = function (forward) { return _this.pagingDateChange('addCalendarDays', 1, forward); },
|
|
4047
|
+
_a[exports.TimeframeOption.WEEK] = function (forward) { return _this.pagingDateChange('addCalendarDays', 7, forward); },
|
|
4048
|
+
_a);
|
|
3992
4049
|
datePickerService.isTimeframeSelectionEnabled = true;
|
|
3993
4050
|
datePickerService.format$
|
|
3994
4051
|
.pipe(operators.takeUntil(_this.destroyed$))
|
|
@@ -4015,23 +4072,27 @@
|
|
|
4015
4072
|
enumerable: false,
|
|
4016
4073
|
configurable: true
|
|
4017
4074
|
});
|
|
4075
|
+
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "availableTimeframes", {
|
|
4076
|
+
set: function (value) {
|
|
4077
|
+
if (value && value.length) {
|
|
4078
|
+
this.datePickerService.availableTimeframes = value;
|
|
4079
|
+
}
|
|
4080
|
+
},
|
|
4081
|
+
enumerable: false,
|
|
4082
|
+
configurable: true
|
|
4083
|
+
});
|
|
4018
4084
|
Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "displayedFormattedValue", {
|
|
4019
4085
|
get: function () {
|
|
4020
|
-
var _a;
|
|
4021
4086
|
if (!this.value) {
|
|
4022
4087
|
return this.placeholder;
|
|
4023
4088
|
}
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
: this.value.format(this.datePickerService.format$.getValue());
|
|
4089
|
+
var formatCached = this.datePickerService.format$.getValue();
|
|
4090
|
+
return this.datePickerService.getDisplayPrefix() + this.value.format(formatCached);
|
|
4027
4091
|
},
|
|
4028
4092
|
enumerable: false,
|
|
4029
4093
|
configurable: true
|
|
4030
4094
|
});
|
|
4031
4095
|
DrDatePickerWithTimeframeComponent.prototype.ngOnInit = function () {
|
|
4032
|
-
if (this.dateFormatConfig) {
|
|
4033
|
-
this.datePickerService.formatConfig = Object.assign(Object.assign({}, this.datePickerService.formatConfig), this.dateFormatConfig);
|
|
4034
|
-
}
|
|
4035
4096
|
this.datePickerService.isTimeframeSelectionEnabled = this.canSelectTimeframe;
|
|
4036
4097
|
this.cdr.markForCheck();
|
|
4037
4098
|
};
|
|
@@ -4067,6 +4128,7 @@
|
|
|
4067
4128
|
isDashboardDatepicker: [{ type: i0.Input }],
|
|
4068
4129
|
dateFormatConfig: [{ type: i0.Input }],
|
|
4069
4130
|
canSelectTimeframe: [{ type: i0.Input }],
|
|
4131
|
+
availableTimeframes: [{ type: i0.Input }],
|
|
4070
4132
|
onChangeFormat: [{ type: i0.Output }]
|
|
4071
4133
|
};
|
|
4072
4134
|
|
|
@@ -4117,6 +4179,20 @@
|
|
|
4117
4179
|
datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
|
|
4118
4180
|
};
|
|
4119
4181
|
|
|
4182
|
+
var DrShowTimeframePipe = /** @class */ (function () {
|
|
4183
|
+
function DrShowTimeframePipe() {
|
|
4184
|
+
}
|
|
4185
|
+
DrShowTimeframePipe.prototype.transform = function (arr, showOptions) {
|
|
4186
|
+
return arr.filter(function (item) { return showOptions.includes(item.timeframe); });
|
|
4187
|
+
};
|
|
4188
|
+
return DrShowTimeframePipe;
|
|
4189
|
+
}());
|
|
4190
|
+
DrShowTimeframePipe.decorators = [
|
|
4191
|
+
{ type: i0.Pipe, args: [{
|
|
4192
|
+
name: 'drShowTimeframePipe'
|
|
4193
|
+
},] }
|
|
4194
|
+
];
|
|
4195
|
+
|
|
4120
4196
|
// !!! Please do not use such approach in other places
|
|
4121
4197
|
// Hard fix for 'none' calendar view selection
|
|
4122
4198
|
datepicker.MatCalendar.prototype.focusActiveCell = function () {
|
|
@@ -4136,7 +4212,8 @@
|
|
|
4136
4212
|
DrDatePickerWithTimeframeComponent,
|
|
4137
4213
|
DrDatePickerFormatDirective,
|
|
4138
4214
|
DrDatePickerCustomHeaderComponent,
|
|
4139
|
-
DrModelDebounceChangeDirective
|
|
4215
|
+
DrModelDebounceChangeDirective,
|
|
4216
|
+
DrShowTimeframePipe
|
|
4140
4217
|
];
|
|
4141
4218
|
var DrInputsModule = /** @class */ (function () {
|
|
4142
4219
|
function DrInputsModule() {
|
|
@@ -4382,6 +4459,7 @@
|
|
|
4382
4459
|
exports["ɵe"] = DrDatePickerWithTimeframeComponent;
|
|
4383
4460
|
exports["ɵf"] = DrDatePickerFormatDirective;
|
|
4384
4461
|
exports["ɵg"] = DrDatePickerCustomHeaderComponent;
|
|
4462
|
+
exports["ɵh"] = DrShowTimeframePipe;
|
|
4385
4463
|
|
|
4386
4464
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4387
4465
|
|