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

IgniteUI / igniteui-angular / 23353730325

20 Mar 2026 05:03PM UTC coverage: 9.784% (-79.5%) from 89.264%
23353730325

Pull #17069

github

web-flow
Merge cfa7e86d1 into a4dc50177
Pull Request #17069: fix(IgxGrid): Do not apply width constraint to groups.

921 of 16963 branches covered (5.43%)

Branch coverage included in aggregate %.

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

25213 existing lines in 340 files now uncovered.

3842 of 31721 relevant lines covered (12.11%)

6.13 hits per line

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

3.33
/projects/igniteui-angular/grids/grid/src/expandable-cell.component.ts
1
import {
2
    ChangeDetectionStrategy,
3
    Component,
4
    ElementRef,
5
    Input,
6
    OnInit,
7
    TemplateRef,
8
    ViewChild,
9
    DOCUMENT,
10
    inject
11
} from '@angular/core';
12
import { NgClass, NgTemplateOutlet } from '@angular/common';
13
import {
14
    IgxColumnFormatterPipe,
15
    IgxGridCellComponent,
16
    IgxGridCellImageAltPipe,
17
    IgxStringReplacePipe
18
} from 'igniteui-angular/grids/core';
19
import { HammerGesturesManager, IgxNumberFormatterPipe, IgxDateFormatterPipe, IgxCurrencyFormatterPipe, IgxPercentFormatterPipe } from 'igniteui-angular/core';
20
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
21
import { IgxChipComponent } from 'igniteui-angular/chips';
22
import { IgxDateTimeEditorDirective, IgxFocusDirective, IgxTextHighlightDirective, IgxTooltipDirective, IgxTooltipTargetDirective } from 'igniteui-angular/directives';
23
import { IgxIconComponent } from 'igniteui-angular/icon';
24
import { IgxInputDirective, IgxInputGroupComponent, IgxPrefixDirective, IgxSuffixDirective } from 'igniteui-angular/input-group';
25
import { IgxCheckboxComponent } from 'igniteui-angular/checkbox';
26
import { IgxDatePickerComponent } from 'igniteui-angular/date-picker';
27
import { IgxTimePickerComponent } from 'igniteui-angular/time-picker';
28

29
@Component({
30
    changeDetection: ChangeDetectionStrategy.OnPush,
31
    selector: 'igx-expandable-grid-cell',
32
    templateUrl: 'expandable-cell.component.html',
33
    providers: [HammerGesturesManager],
34
    imports: [IgxChipComponent, IgxTextHighlightDirective, IgxIconComponent, NgClass, FormsModule, ReactiveFormsModule,
35
        IgxInputGroupComponent, IgxInputDirective, IgxFocusDirective, IgxCheckboxComponent, IgxDatePickerComponent,
36
        IgxTimePickerComponent, IgxDateTimeEditorDirective, IgxPrefixDirective, IgxSuffixDirective, NgTemplateOutlet,
37
        IgxTooltipTargetDirective, IgxTooltipDirective, IgxGridCellImageAltPipe, IgxStringReplacePipe,
38
        IgxColumnFormatterPipe, IgxNumberFormatterPipe, IgxPercentFormatterPipe, IgxCurrencyFormatterPipe, IgxDateFormatterPipe]
39
})
40
export class IgxGridExpandableCellComponent extends IgxGridCellComponent implements OnInit {
3✔
UNCOV
41
    public document = inject(DOCUMENT);
×
42

43
    /**
44
     * @hidden
45
     */
46
    @Input()
UNCOV
47
    public expanded = false;
×
48

49
    @ViewChild('indicator', { read: ElementRef })
50
    public indicator: ElementRef;
51

52
    @ViewChild('indentationDiv', { read: ElementRef })
53
    public indentationDiv: ElementRef;
54

55
    /**
56
     * @hidden
57
     */
58
    @ViewChild('defaultExpandedTemplate', { read: TemplateRef, static: true })
59
    protected defaultExpandedTemplate: TemplateRef<any>;
60

61
    /**
62
     * @hidden
63
     */
64
    @ViewChild('defaultCollapsedTemplate', { read: TemplateRef, static: true })
65
    protected defaultCollapsedTemplate: TemplateRef<any>;
66

67
    /**
68
     * @hidden
69
     */
70
    public toggle(event: Event) {
UNCOV
71
        event.stopPropagation();
×
UNCOV
72
        const expansionState = this.grid.gridAPI.get_row_expansion_state(this.intRow.data);
×
UNCOV
73
        this.grid.gridAPI.set_row_expansion_state(this.intRow.key, !expansionState, event);
×
74
    }
75

76
    /**
77
     * @hidden
78
     */
79
    public onIndicatorFocus() {
80
        this.grid.gridAPI.update_cell(this.grid.crudService.cell);
×
81
    }
82

83
    /**
84
     * @hidden
85
     */
86
    public override calculateSizeToFit(range: any): number {
UNCOV
87
        let leftPadding = 0;
×
UNCOV
88
        if (this.indentationDiv) {
×
UNCOV
89
            const indentationStyle = this.document.defaultView.getComputedStyle(this.indentationDiv.nativeElement);
×
UNCOV
90
            leftPadding = parseFloat(indentationStyle.paddingLeft);
×
91
        }
UNCOV
92
        const contentWidth = this.platformUtil.getNodeSizeViaRange(range, this.nativeElement);
×
UNCOV
93
        return contentWidth + leftPadding;
×
94
    }
95

96
    /**
97
     * @hidden
98
     */
99
    public get iconTemplate() {
UNCOV
100
        if (this.expanded) {
×
UNCOV
101
            return this.grid.rowExpandedIndicatorTemplate || this.defaultExpandedTemplate;
×
102
        } else {
UNCOV
103
            return this.grid.rowCollapsedIndicatorTemplate || this.defaultCollapsedTemplate;
×
104
        }
105
    }
106

107
    /**
108
     * @hidden
109
     */
110
    public get showExpanderIndicator() {
UNCOV
111
        const isGhost = this.intRow.pinned && this.intRow.disabled;
×
UNCOV
112
        return !this.editMode && (!this.intRow.pinned || isGhost);
×
113
    }
114
}
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