• 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

97.73
/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-row-dimension-header-group.component.ts
1
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, HostListener, Inject, Input, NgZone, ViewChild } from '@angular/core';
2
import { PlatformUtil } from '../../core/utils';
3
import { IgxColumnComponent } from '../columns/column.component';
4
import { IGX_GRID_BASE, PivotGridType } from '../common/grid.interface';
5
import { IgxFilteringService } from '../filtering/grid-filtering.service';
6
import { IgxGridHeaderGroupComponent } from '../headers/grid-header-group.component';
7
import { IgxPivotColumnResizingService } from '../resizing/pivot-grid/pivot-resizing.service';
8
import { IPivotDimension, PivotRowHeaderGroupType } from './pivot-grid.interface';
9
import { IgxPivotRowDimensionHeaderComponent } from './pivot-row-dimension-header.component';
10
import { IgxHeaderGroupStylePipe } from '../headers/pipes';
11
import { IgxPivotResizeHandleDirective } from '../resizing/pivot-grid/pivot-resize-handle.directive';
12
import { IgxColumnMovingDropDirective } from '../moving/moving.drop.directive';
13
import { IgxColumnMovingDragDirective } from '../moving/moving.drag.directive';
14
import { NgIf, NgClass, NgStyle } from '@angular/common';
15
import { IgxIconComponent } from '../../icon/icon.component';
16
import { IMultiRowLayoutNode } from '../common/types';
17

18
/**
19
 * @hidden
20
 */
21
@Component({
22
    changeDetection: ChangeDetectionStrategy.OnPush,
23
    selector: 'igx-pivot-row-dimension-header-group',
24
    templateUrl: './pivot-row-dimension-header-group.component.html',
25
    standalone: true,
26
    imports: [IgxIconComponent, NgIf, IgxPivotRowDimensionHeaderComponent, NgClass, NgStyle, IgxColumnMovingDragDirective, IgxColumnMovingDropDirective, IgxPivotResizeHandleDirective, IgxHeaderGroupStylePipe]
27
})
28
export class IgxPivotRowDimensionHeaderGroupComponent extends IgxGridHeaderGroupComponent implements PivotRowHeaderGroupType {
2✔
29

30
    /**
31
     * @hidden
32
     */
33
    @HostBinding('style.user-select')
34
    public userSelect = 'none';
1,677✔
35

36
    constructor(private cdRef: ChangeDetectorRef,
1,677✔
37
        @Inject(IGX_GRID_BASE) public override grid: PivotGridType,
1,677✔
38
        private elementRef: ElementRef<HTMLElement>,
1,677✔
39
        public override colResizingService: IgxPivotColumnResizingService,
1,677✔
40
        filteringService: IgxFilteringService,
41
        platform: PlatformUtil,
42
        protected zone: NgZone) {
1,677✔
43
        super(cdRef, grid, elementRef, colResizingService, filteringService, platform);
1,677✔
44
    }
45

46
    /**
47
     * @hidden
48
     * @internal
49
     */
50
    @Input()
51
    public rowIndex: number;
52

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

60

61
    /**
62
     * @hidden
63
     * @internal
64
     */
65
    @Input()
66
    public layout: IMultiRowLayoutNode;
67

68
    /**
69
    * @hidden
70
    * @internal
71
    */
72
    @Input()
73
    public parent: any;
74

75
    @ViewChild(IgxPivotRowDimensionHeaderComponent)
76
    public override header: IgxPivotRowDimensionHeaderComponent;
77

78
    @HostBinding('attr.id')
79
    public override get headerID() {
80
        return `${this.grid.id}_-2_${this.rowIndex}_${this.visibleIndex}`;
30,482✔
81
    }
82

83
    @HostBinding('attr.title')
84
    public override get title() {
85
        return this.column.header;
15,241✔
86
    }
87

88
    /**
89
     * @hidden @internal
90
     */
91
    @HostListener('click', ['$event'])
92
    public onClick(event: MouseEvent) {
93
        if (this.grid.rowSelection === 'none') {
19✔
94
            return;
9✔
95
        }
96
        event?.stopPropagation();
10✔
97
        const key = this.parent.getRowDimensionKey(this.column as IgxColumnComponent);
10✔
98
        if (this.grid.selectionService.isRowSelected(key)) {
10✔
99
            this.grid.selectionService.deselectRow(key, event);
3✔
100
        } else {
101
            this.grid.selectionService.selectRowById(key, true, event);
7✔
102
        }
103

104
        this.zone.run(() => {});
10✔
105
    }
106

107
    /**
108
     * @hidden
109
     * @internal
110
     */
111
    public get visibleIndex(): number {
112
        if (this.grid.hasHorizontalLayout) {
31,673✔
113
            return this.colIndex;
5,138✔
114
        }
115

116
        const field = this.column.field;
26,535✔
117
        const rows = this.grid.rowDimensions;
26,535✔
118
        const rootDimension = this.findRootDimension(field);
26,535✔
119
        return rows.indexOf(rootDimension);
26,535✔
120
    }
121

122
    @HostBinding('class.igx-grid-th--active')
123
    public override get active() {
124
        const nav = this.grid.navigation;
30,482✔
125
        const node = nav.activeNode;
30,482✔
126
        return node && !this.column.columnGroup ?
30,482!
127
            nav.isRowHeaderActive &&
34,228✔
128
            node.row === this.rowIndex &&
129
            node.column === this.visibleIndex :
130
            false;
131
    }
132

133
    protected override get activeNode() {
134
        this.grid.navigation.isRowHeaderActive = true;
21✔
135
        this.grid.navigation.isRowDimensionHeaderActive = false;
21✔
136
        return {
21✔
137
            row: this.rowIndex, column: this.visibleIndex, level: null,
138
            mchCache: null,
139
            layout: this.layout || null
38✔
140
        };
141
    }
142

143
    private findRootDimension(field: string): IPivotDimension {
144
        const rows = this.grid.rowDimensions;
26,535✔
145
        let tempRow;
146
        let result = null;
26,535✔
147
        rows.forEach(row => {
26,535✔
148
            tempRow = row;
46,003✔
149
            do {
46,003✔
150
                if (tempRow.memberName === field) {
77,011✔
151
                    result = row;
26,455✔
152
                }
153
                tempRow = tempRow.childLevel;
77,011✔
154
            } while (tempRow)
155
        });
156
        return result;
26,535✔
157
    }
158

159

160
    public override activate() {
161
        this.grid.navigation.isRowHeader = true;
21✔
162
        this.grid.navigation.setActiveNode(this.activeNode);
21✔
163
    }
164

165
    /**
166
     * @hidden @internal
167
     */
168
    public override pointerdown(_event: PointerEvent): void {
169
        this.activate();
16✔
170
    }
171

172
    /**
173
     * @hidden @internal
174
     */
175
    public override onMouseDown(_event: MouseEvent): void {
176
        this.activate();
5✔
177
    }
178

179
    public override get selectable(): boolean {
UNCOV
180
        return false;
×
181
    }
182
}
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