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

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

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

4.17
/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')
UNCOV
39
    public pivotDim = true;
×
40

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

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

49
    @HostBinding('style.grid-template-columns')
50
    public get colsTemplate(): string {
UNCOV
51
        return this.getRowMRLTemplate(false, this.rowGroup);
×
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(
UNCOV
79
        @Inject(IGX_GRID_BASE) public override grid: PivotGridType,
×
80
        ref: ElementRef<HTMLElement>,
UNCOV
81
        protected injector: Injector,
×
UNCOV
82
        protected envInjector: EnvironmentInjector,
×
83
        cdr: ChangeDetectorRef,
UNCOV
84
        protected viewRef: ViewContainerRef
×
85
    ) {
UNCOV
86
        super(ref, cdr);
×
87
    }
88

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

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

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