• 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

95.83
/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-row-dimension-mrl-row.component.ts
1
import {
2
    ChangeDetectionStrategy,
3
    ChangeDetectorRef,
4
    Component,
5
    ElementRef,
6
    EnvironmentInjector,
7
    HostBinding,
8
    Inject,
9
    Injector,
10
    Input,
11
    QueryList,
12
    ViewChildren,
13
    ViewContainerRef
14
} from '@angular/core';
15
import { IGX_GRID_BASE, PivotGridType } from '../common/grid.interface';
16
import { IgxGridHeaderRowComponent } from '../headers/grid-header-row.component';
17
import { IPivotDimension, IPivotDimensionData, IPivotGridRecord } from './pivot-grid.interface';
18
import { NgFor } from '@angular/common';
19
import { IgxPivotRowDimensionContentComponent } from './pivot-row-dimension-content.component';
20
import { IgxPivotGridHorizontalRowCellMerging } from './pivot-grid.pipes';
21

22
/**
23
 *
24
 * For all intents & purposes treat this component as what a <thead> usually is in the default <table> element.
25
 *
26
 * This container holds the pivot grid header elements and their behavior/interactions.
27
 *
28
 * @hidden @internal
29
 */
30
@Component({
31
    changeDetection: ChangeDetectionStrategy.OnPush,
32
    selector: 'igx-pivot-row-dimension-mrl-row',
33
    templateUrl: './pivot-row-dimension-mrl-row.component.html',
34
    imports: [NgFor, IgxPivotRowDimensionContentComponent, IgxPivotGridHorizontalRowCellMerging]
35
})
36
export class IgxPivotRowDimensionMrlRowComponent extends IgxGridHeaderRowComponent {
2✔
37

38
    @HostBinding('class.igx-grid__tbody-pivot-dimension')
39
    public pivotDim = true;
19✔
40

41
    @HostBinding('class.igx-grid__mrl-block')
42
    public mrlBlock =  true;
19✔
43

44
    @HostBinding('style.grid-template-rows')
45
    public get rowsTemplate(): string {
46
        return this.getRowMRLTemplate(true, this.rowGroup);
203✔
47
    }
48

49
    @HostBinding('style.grid-template-columns')
50
    public get colsTemplate(): string {
51
        return this.getRowMRLTemplate(false, this.rowGroup);
203✔
52
    }
53

54
    /**
55
     * @hidden @internal
56
     */
57
    @Input()
58
    public rowIndex: number;
59

60
    /**
61
     * @hidden @internal
62
     */
63
    @Input()
64
    public rowGroup: IPivotGridRecord[];
65

66
    /**
67
     * @hidden @internal
68
     */
69
    @Input()
70
    public groupedData: IPivotGridRecord[][];
71

72
    /**
73
     * @hidden @internal
74
     */
75
    @ViewChildren(IgxPivotRowDimensionContentComponent)
76
    public contentCells: QueryList<IgxPivotRowDimensionContentComponent>
77

78
    constructor(
79
        @Inject(IGX_GRID_BASE) public override grid: PivotGridType,
19✔
80
        ref: ElementRef<HTMLElement>,
81
        protected injector: Injector,
19✔
82
        protected envInjector: EnvironmentInjector,
19✔
83
        cdr: ChangeDetectorRef,
84
        protected viewRef: ViewContainerRef
19✔
85
    ) {
86
        super(ref, cdr);
19✔
87
    }
88

89
    /**
90
     * @hidden @internal
91
     */
92
    public rowDimensionData: IPivotDimensionData;
93

94
    protected getRowMRLTemplate(forRows: boolean, rows: IPivotGridRecord[]) {
95
        if (forRows) {
406✔
96
            return `repeat(${rows.length},1fr)`;
203✔
97
        } else if (this.grid.visibleRowDimensions && this.grid.dimensionDataColumns) {
203✔
98
            const res = [];
203✔
99
            this.grid.visibleRowDimensions.forEach(dim => {
203✔
100
                res.push(this.grid.rowDimensionWidth(dim));
632✔
101
            });
102
            return  res.join(' ');
203✔
103
        }
104
    }
105

106
    public rowDimensionWidthCombined(dims: IPivotDimension[]) {
107
        let resWidth = 0;
2,117✔
108
        for (const dim of (dims || [])) {
2,117!
109
            const rowDimWidth = this.grid.rowDimensionWidth(dim);
2,156✔
110
            if (rowDimWidth === 'fit-content') {
2,156!
UNCOV
111
                return -1;
×
112
            } else {
113
                resWidth += parseFloat(rowDimWidth);
2,156✔
114
            }
115
        }
116
        return resWidth;
2,117✔
117
    }
118
}
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