• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13679189163

05 Mar 2025 03:13PM UTC coverage: 91.647% (+0.002%) from 91.645%
13679189163

Pull #15376

github

web-flow
Merge 4e8f64a84 into eda67f4e5
Pull Request #15376: feat(pivotGrid): Improve PivotGrid visually when there's no data or has empty area at the bottom.

13334 of 15604 branches covered (85.45%)

4 of 4 new or added lines in 2 files covered. (100.0%)

60 existing lines in 2 files now uncovered.

26893 of 29344 relevant lines covered (91.65%)

33698.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.18
/projects/igniteui-angular/src/lib/calendar/days-view/day-item.component.ts
1
import { Component, Input, Output, EventEmitter, HostBinding, ElementRef, booleanAttribute, ChangeDetectionStrategy } from '@angular/core';
2
import { CalendarSelection } from '../calendar';
3
import { DateRangeDescriptor } from '../../core/dates';
4
import { CalendarDay } from '../common/model'
5
import { areSameMonth, isNextMonth, isPreviousMonth, isDateInRanges } from '../common/helpers';
6

7
/**
8
 * @hidden
9
 */
10
@Component({
11
    selector: 'igx-day-item',
12
    templateUrl: 'day-item.component.html',
13
    changeDetection: ChangeDetectionStrategy.OnPush,
14
    standalone: true
15
})
16
export class IgxDayItemComponent {
2✔
17
    @Input()
18
    public date: CalendarDay;
19

20
    @Input()
21
    public viewDate: Date;
22

23
    @Input()
24
    public selection: string;
25

26
    /**
27
     * Returns boolean indicating if the day is selected
28
     *
29
     */
30
    @Input()
31
    public get selected(): any {
32
        return this._selected;
60,202✔
33
    }
34

35
    /**
36
     * Selects the day
37
     */
38
    public set selected(value: any) {
39
        this._selected = value;
30,945✔
40
    }
41

42
    @Input()
43
    public disabledDates: DateRangeDescriptor[];
44

45
    @Input()
46
    public specialDates: DateRangeDescriptor[];
47

48
    @Input({ transform: booleanAttribute })
49
    public hideOutsideDays = false;
25,663✔
50

51
    @Input({ transform: booleanAttribute })
52
    @HostBinding('class.igx-days-view__date--last')
53
    public isLastInRange = false;
25,663✔
54

55
    @Input({ transform: booleanAttribute })
56
    @HostBinding('class.igx-days-view__date--first')
57
    public isFirstInRange = false;
25,663✔
58

59
    @Input({ transform: booleanAttribute })
60
    public isWithinRange = false;
25,663✔
61

62
    @Input({ transform: booleanAttribute })
63
    public isWithinPreviewRange = false;
25,663✔
64

65
    @Input({ transform: booleanAttribute })
66
    public hideLeadingDays = false;
25,663✔
67

68
    @Input({ transform: booleanAttribute })
69
    public hideTrailingDays = false;
25,663✔
70

71
    private get hideLeading() {
72
        return this.hideLeadingDays && this.isPreviousMonth;
175,071✔
73
    }
74

75
    private get hideTrailing() {
76
        return this.hideTrailingDays && this.isNextMonth;
170,589✔
77
    }
78

79
    @Output()
80
    public dateSelection = new EventEmitter<CalendarDay>();
25,663✔
81

82
    @Output()
83
    public mouseEnter = new EventEmitter<void>();
25,663✔
84

85
    @Output()
86
    public mouseLeave = new EventEmitter<void>();
25,663✔
87

88
    @Output()
89
    public mouseDown = new EventEmitter<void>();
25,663✔
90

91
    public get isCurrentMonth(): boolean {
92
        return areSameMonth(this.date, this.viewDate);
457,142✔
93
    }
94

95
    public get isPreviousMonth(): boolean {
96
        return isPreviousMonth(this.date, this.viewDate);
68,035✔
97
    }
98

99
    public get isNextMonth(): boolean {
100
        return isNextMonth(this.date, this.viewDate);
54,781✔
101
    }
102

103
    public get nativeElement() {
104
        return this.elementRef.nativeElement;
21✔
105
    }
106

107
    @Input({ transform: booleanAttribute })
108
    @HostBinding('class.igx-days-view__date--active')
109
    public isActive = false;
25,663✔
110

111
    @HostBinding('class.igx-days-view__date--selected')
112
    public get isSelectedCSS(): boolean {
113
    const selectable =
114
        !this.isInactive || this.isWithinPreviewRange ||
86,730✔
115
        (this.isWithinRange && this.selection === "range");
116
    return !this.isDisabled && selectable && this.selected;
86,730✔
117
    }
118

119
    @HostBinding('class.igx-days-view__date--inactive')
120
    public get isInactive(): boolean {
121
        return !this.isCurrentMonth;
354,863✔
122
    }
123

124
    @HostBinding('class.igx-days-view__date--hidden')
125
    public get isHidden(): boolean {
126
        return (this.hideLeading || this.hideTrailing) && this.isInactive;
175,071✔
127
    }
128

129
    @HostBinding('class.igx-days-view__date--current')
130
    public get isToday(): boolean {
131
        return !this.isInactive && this.date.equalTo(CalendarDay.today);
86,730✔
132
    }
133

134
    @HostBinding('class.igx-days-view__date--weekend')
135
    public get isWeekend(): boolean {
136
        return this.date.weekend;
86,730✔
137
    }
138

139
    public get isDisabled(): boolean {
140
        if (!this.disabledDates) {
167,843!
UNCOV
141
            return false;
×
142
        }
143

144
        return isDateInRanges(this.date, this.disabledDates);
167,843✔
145
    }
146

147
    public get isFocusable(): boolean {
148
        return this.isCurrentMonth && !this.isHidden && !this.isDisabled;
1,185✔
149
    }
150

151
    protected onMouseEnter() {
UNCOV
152
        this.mouseEnter.emit();
×
153
    }
154

155
    protected onMouseLeave() {
UNCOV
156
        this.mouseLeave.emit();
×
157
    }
158

159
    protected onMouseDown(event: MouseEvent) {
160
        event.preventDefault();
14✔
161
        this.mouseDown.emit();
14✔
162
    }
163

164
    @HostBinding('class.igx-days-view__date--range')
165
    public get isWithinRangeCSS(): boolean {
166
        return !this.isSingleSelection && this.isWithinRange;
86,730✔
167
    }
168

169
    @HostBinding('class.igx-days-view__date--range-preview')
170
    public get isWithinPreviewRangeCSS(): boolean {
171
        return !this.isSingleSelection && this.isWithinPreviewRange;
86,730✔
172
    }
173

174
    @HostBinding('class.igx-days-view__date--special')
175
    public get isSpecial(): boolean {
176
        if (!this.specialDates) {
87,046✔
177
            return false;
8,106✔
178
        }
179

180
        return !this.isInactive && isDateInRanges(this.date, this.specialDates);
78,940✔
181
    }
182

183
    @HostBinding('class.igx-days-view__date--disabled')
184
    public get isDisabledCSS(): boolean {
185
        return this.isHidden || this.isDisabled;
87,156✔
186
    }
187

188
    @HostBinding('class.igx-days-view__date--single')
189
    public get isSingleSelection(): boolean {
190
        return this.selection !== CalendarSelection.RANGE;
260,190✔
191
    }
192

193
    private _selected = false;
25,663✔
194

195
    constructor(private elementRef: ElementRef) { }
25,663✔
196
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc