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

IgniteUI / igniteui-angular / 6797384210

08 Nov 2023 11:09AM UTC coverage: 91.853% (-0.3%) from 92.123%
6797384210

push

github

web-flow
Merge pull request #13613 from IgniteUI/mkirova/fix-empty-pivot

fix(igxPivotGrid): Add check in case data is empty due to removing al…

12459 of 14514 branches covered (0.0%)

1 of 1 new or added line in 1 file covered. (100.0%)

2127 existing lines in 217 files now uncovered.

25413 of 27667 relevant lines covered (91.85%)

31122.38 hits per line

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

65.38
/projects/igniteui-angular/src/lib/combo/combo-item.component.ts
1
import {
2
    Component,
3
    ElementRef,
4
    HostBinding,
5
    Inject,
6
    Input,
7
    booleanAttribute
8
} from '@angular/core';
9
import { IgxDropDownItemComponent } from '../drop-down/drop-down-item.component';
10
import { IGX_DROPDOWN_BASE, IDropDownBase, Navigate } from '../drop-down/drop-down.common';
11
import { IgxComboAPIService } from './combo.api';
12
import { IgxSelectionAPIService } from '../core/selection';
13
import { rem } from '../core/utils';
14
import { IgxCheckboxComponent } from '../checkbox/checkbox.component';
15
import { NgIf } from '@angular/common';
16

17
/** @hidden */
18
@Component({
19
    selector: 'igx-combo-item',
20
    templateUrl: 'combo-item.component.html',
21
    standalone: true,
22
    imports: [NgIf, IgxCheckboxComponent]
23
})
24
export class IgxComboItemComponent extends IgxDropDownItemComponent {
2✔
25

26
    /**
27
     * Gets the height of a list item
28
     *
29
     * @hidden
30
     */
31
    @Input()
32
    public itemHeight: string | number = '';
1,931✔
33

34
    /** @hidden @internal */
35
    @HostBinding('style.height.rem')
36
    public get _itemHeightToRem() {
37
        return rem(this.itemHeight);
16,457✔
38
    }
39

40
    @HostBinding('attr.aria-label')
41
    @Input()
42
    public override get ariaLabel(): string {
43
        const valueKey = this.comboAPI.valueKey;
32,914✔
44
        return (valueKey !== null && this.value != null) ? this.value[valueKey] : this.value;
32,914✔
45
    }
46

47
    /** @hidden @internal */
48
    @Input({ transform: booleanAttribute })
49
    public singleMode: boolean;
50

51
    /**
52
     * @hidden
53
     */
54
    public override get itemID() {
55
        const valueKey = this.comboAPI.valueKey;
42,255✔
56
        return valueKey !== null ? this.value[valueKey] : this.value;
42,255✔
57
    }
58

59
    /**
60
     * @hidden
61
     */
62
    public get comboID() {
63
        return this.comboAPI.comboID;
×
64
    }
65

66
    /**
67
     * @hidden
68
     * @internal
69
     */
70
    public get disableTransitions() {
71
        return this.comboAPI.disableTransitions;
9,349✔
72
    }
73

74
    constructor(
75
        protected comboAPI: IgxComboAPIService,
1,931✔
76
        @Inject(IGX_DROPDOWN_BASE) dropDown: IDropDownBase,
77
        elementRef: ElementRef,
78
        @Inject(IgxSelectionAPIService) selection: IgxSelectionAPIService
79
    ) {
80
        super(dropDown, elementRef, null, selection);
1,931✔
81
    }
82

83
    /**
84
     * @hidden
85
     */
86
    public override get selected(): boolean {
87
        return this.comboAPI.is_item_selected(this.itemID);
42,206✔
88
    }
89

90
    public override set selected(value: boolean) {
UNCOV
91
        if (this.isHeader) {
×
UNCOV
92
            return;
×
93
        }
UNCOV
94
        this._selected = value;
×
95
    }
96

97
    /**
98
     * @hidden
99
     */
100
    public isVisible(direction: Navigate): boolean {
UNCOV
101
        const rect = this.element.nativeElement.getBoundingClientRect();
×
UNCOV
102
        const parentDiv = this.element.nativeElement.parentElement.parentElement.getBoundingClientRect();
×
UNCOV
103
        if (direction === Navigate.Down) {
×
UNCOV
104
            return rect.y + rect.height <= parentDiv.y + parentDiv.height;
×
105
        }
UNCOV
106
        return rect.y >= parentDiv.y;
×
107
    }
108

109
    public override clicked(event): void {
110
        this.comboAPI.disableTransitions = false;
43✔
111
        if (!this.isSelectable) {
43✔
112
            return;
3✔
113
        }
114
        this.dropDown.navigateItem(this.index);
40✔
115
        this.comboAPI.set_selected_item(this.itemID, event);
40✔
116
    }
117

118
    /**
119
     * @hidden
120
     * @internal
121
     * The event that is prevented is the click on the checkbox label element.
122
     * That is the only visible element that a user can interact with.
123
     * The click propagates to the host and the preventDefault is to stop it from
124
     * switching focus to the input it's base on.
125
     * The toggle happens in an internal handler in the drop-down on the next task queue cycle.
126
     */
127
    public disableCheck(event: MouseEvent) {
128
        event.preventDefault();
1✔
129
    }
130
}
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

© 2026 Coveralls, Inc