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

IgniteUI / igniteui-angular / 12910003674

22 Jan 2025 02:10PM CUT coverage: 91.609% (+0.01%) from 91.597%
12910003674

push

github

web-flow
Merge pull request #15285 from IgniteUI/mvenkov/use-passed-overlay-settings-18.2

Use provided in show method overlay settings - 18.2

12988 of 15222 branches covered (85.32%)

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

46 existing lines in 9 files now uncovered.

26321 of 28732 relevant lines covered (91.61%)

33978.84 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
    standalone: true,
35
    imports: [NgFor, IgxPivotRowDimensionContentComponent, IgxPivotGridHorizontalRowCellMerging]
36
})
37
export class IgxPivotRowDimensionMrlRowComponent extends IgxGridHeaderRowComponent {
2✔
38

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

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

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

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

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

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

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

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

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

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

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

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