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

IgniteUI / igniteui-angular / 16053471080

03 Jul 2025 02:41PM UTC coverage: 4.981% (-86.4%) from 91.409%
16053471080

Pull #16021

github

web-flow
Merge 7c49966eb into 7e40671a1
Pull Request #16021: fix(radio-group): dynamically added radio buttons do not initialize

178 of 15753 branches covered (1.13%)

13 of 14 new or added lines in 2 files covered. (92.86%)

25644 existing lines in 324 files now uncovered.

1478 of 29670 relevant lines covered (4.98%)

0.51 hits per line

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

5.26
/projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.ts
1
import {
2
    ChangeDetectionStrategy,
3
    ChangeDetectorRef,
4
    Component,
5
    ElementRef,
6
    Inject,
7
    Input,
8
    NgZone,
9
    OnInit,
10
    TemplateRef,
11
    ViewChild,
12
    DOCUMENT
13
} from '@angular/core';
14
import { IgxGridCellComponent } from '../cell.component';
15
import { PlatformUtil } from '../../core/utils';
16
import { NgClass, NgTemplateOutlet, DecimalPipe, PercentPipe, CurrencyPipe, DatePipe } from '@angular/common';
17
import { IgxGridSelectionService } from '../selection/selection.service';
18
import { HammerGesturesManager } from '../../core/touch';
19
import { GridType, IGX_GRID_BASE } from '../common/grid.interface';
20
import { IgxOverlayService } from '../../services/public_api';
21
import { IgxGridCellImageAltPipe, IgxStringReplacePipe, IgxColumnFormatterPipe } from '../common/pipes';
22
import { IgxTooltipDirective } from '../../directives/tooltip/tooltip.directive';
23
import { IgxTooltipTargetDirective } from '../../directives/tooltip/tooltip-target.directive';
24
import { IgxSuffixDirective } from '../../directives/suffix/suffix.directive';
25
import { IgxPrefixDirective } from '../../directives/prefix/prefix.directive';
26
import { IgxDateTimeEditorDirective } from '../../directives/date-time-editor/date-time-editor.directive';
27
import { IgxTimePickerComponent } from '../../time-picker/time-picker.component';
28
import { IgxDatePickerComponent } from '../../date-picker/date-picker.component';
29
import { IgxCheckboxComponent } from '../../checkbox/checkbox.component';
30
import { IgxFocusDirective } from '../../directives/focus/focus.directive';
31
import { IgxInputDirective } from '../../directives/input/input.directive';
32
import { IgxInputGroupComponent } from '../../input-group/input-group.component';
33
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
34
import { IgxIconComponent } from '../../icon/icon.component';
35
import { IgxTextHighlightDirective } from '../../directives/text-highlight/text-highlight.directive';
36
import { IgxChipComponent } from '../../chips/chip.component';
37

38
@Component({
39
    changeDetection: ChangeDetectionStrategy.OnPush,
40
    selector: 'igx-expandable-grid-cell',
41
    templateUrl: 'expandable-cell.component.html',
42
    providers: [HammerGesturesManager],
43
    imports: [IgxChipComponent, IgxTextHighlightDirective, IgxIconComponent, NgClass, FormsModule, ReactiveFormsModule, IgxInputGroupComponent, IgxInputDirective, IgxFocusDirective, IgxCheckboxComponent, IgxDatePickerComponent, IgxTimePickerComponent, IgxDateTimeEditorDirective, IgxPrefixDirective, IgxSuffixDirective, NgTemplateOutlet, IgxTooltipTargetDirective, IgxTooltipDirective, IgxGridCellImageAltPipe, IgxStringReplacePipe, IgxColumnFormatterPipe, DecimalPipe, PercentPipe, CurrencyPipe, DatePipe]
44
})
45
export class IgxGridExpandableCellComponent extends IgxGridCellComponent implements OnInit {
3✔
46
    /**
47
     * @hidden
48
     */
49
    @Input()
UNCOV
50
    public expanded = false;
×
51

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

55
    @ViewChild('indentationDiv', { read: ElementRef })
56
    public indentationDiv: ElementRef;
57

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

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

70
    constructor(selectionService: IgxGridSelectionService,
71
                @Inject(IGX_GRID_BASE) grid: GridType,
72
                @Inject(IgxOverlayService) overlayService: IgxOverlayService,
73
                cdr: ChangeDetectorRef,
74
                element: ElementRef,
75
                zone: NgZone,
76
                touchManager: HammerGesturesManager,
UNCOV
77
                @Inject(DOCUMENT) public document,
×
78
                platformUtil: PlatformUtil) {
UNCOV
79
        super(selectionService, grid, overlayService, cdr, element, zone, touchManager, platformUtil);
×
80
    }
81

82
    /**
83
     * @hidden
84
     */
85
    public toggle(event: Event) {
UNCOV
86
        event.stopPropagation();
×
UNCOV
87
        const expansionState = this.grid.gridAPI.get_row_expansion_state(this.intRow.data);
×
UNCOV
88
        this.grid.gridAPI.set_row_expansion_state(this.intRow.key, !expansionState, event);
×
89
    }
90

91
    /**
92
     * @hidden
93
     */
94
    public onIndicatorFocus() {
95
        this.grid.gridAPI.update_cell(this.grid.crudService.cell);
×
96
    }
97

98
    /**
99
     * @hidden
100
     */
101
    public override calculateSizeToFit(range: any): number {
UNCOV
102
        let leftPadding = 0;
×
UNCOV
103
        if (this.indentationDiv) {
×
UNCOV
104
            const indentationStyle = this.document.defaultView.getComputedStyle(this.indentationDiv.nativeElement);
×
UNCOV
105
            leftPadding = parseFloat(indentationStyle.paddingLeft);
×
106
        }
UNCOV
107
        const contentWidth = this.platformUtil.getNodeSizeViaRange(range, this.nativeElement);
×
UNCOV
108
        return contentWidth + leftPadding;
×
109
    }
110

111
    /**
112
     * @hidden
113
     */
114
    public get iconTemplate() {
UNCOV
115
        if (this.expanded) {
×
UNCOV
116
            return this.grid.rowExpandedIndicatorTemplate || this.defaultExpandedTemplate;
×
117
        } else {
UNCOV
118
            return this.grid.rowCollapsedIndicatorTemplate || this.defaultCollapsedTemplate;
×
119
        }
120
    }
121

122
    /**
123
     * @hidden
124
     */
125
    public get showExpanderIndicator() {
UNCOV
126
        const isGhost = this.intRow.pinned && this.intRow.disabled;
×
UNCOV
127
        return !this.editMode && (!this.intRow.pinned || isGhost);
×
128
    }
129
}
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