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

IgniteUI / igniteui-angular / 13416627295

19 Feb 2025 03:46PM CUT coverage: 91.615% (+0.02%) from 91.595%
13416627295

Pull #15246

github

web-flow
Merge 2a114cdda into 10ddb05cf
Pull Request #15246: fix(excel-export): Get correct grid column collection from row island…

12987 of 15218 branches covered (85.34%)

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

380 existing lines in 31 files now uncovered.

26385 of 28800 relevant lines covered (91.61%)

34358.69 hits per line

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

66.67
/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
    imports: [NgIf, IgxCheckboxComponent]
22
})
23
export class IgxComboItemComponent extends IgxDropDownItemComponent {
2✔
24

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

33
    /** @hidden @internal */
34
    @HostBinding('style.height.rem')
35
    public get _itemHeightToRem() {
36
        if (this.itemHeight) {
18,339✔
37
            return rem(this.itemHeight);
1,398✔
38
        }
39
    }
40

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

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

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

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

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

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

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

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

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

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

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