• 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

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

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

28
    /**
29
     * @hidden
30
     */
31
    @HostBinding('style.user-select')
UNCOV
32
    public userSelect = 'none';
×
33

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

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

51
    @Input()
52
    public set dimWidth(value: number) {
UNCOV
53
        this.column.width = value + 'px';
×
54
    }
55
    public get dimWidth() {
56
        return parseFloat(this.column.width);
×
57
    }
58

59
    public get parent() {
60
        return this;
×
61
    };
62

63
    @Input()
64
    public rootDimension: IPivotDimension;
65

66
    @ViewChild(IgxPivotRowDimensionHeaderComponent)
67
    public override header: IgxPivotRowDimensionHeaderComponent;
68

69
    @HostBinding('attr.id')
70
    public override get headerID() {
UNCOV
71
        return `${this.grid.id}_-2_${this.rootDimension.memberName}_${this.visibleIndex}`;
×
72
    }
73

74
    @HostBinding('attr.title')
75
    public override get title() {
UNCOV
76
        return this.rootDimension.displayName;
×
77
    }
78

79
    /**
80
     * @hidden
81
     * @internal
82
     */
83
    public get visibleIndex(): number {
UNCOV
84
        const rows = this.grid.visibleRowDimensions;
×
UNCOV
85
        return rows.indexOf(this.rootDimension);
×
86
    }
87

88
    @HostBinding('class.igx-grid-th--active')
89
    public override get active() {
UNCOV
90
        const nav = this.grid.navigation;
×
UNCOV
91
        const node = nav.activeNode;
×
UNCOV
92
        return node && !this.column.columnGroup ?
×
93
            nav.isRowDimensionHeaderActive &&
×
94
            node.row === this.rowIndex &&
95
            node.column === this.visibleIndex :
96
            false;
97
    }
98

99
    @HostBinding('class.asc')
100
    public get sortAscendingStyle() {
UNCOV
101
        return this.rootDimension.sortDirection === SortingDirection.Asc;
×
102
    }
103

104
    @HostBinding('class.desc')
105
    public get sortDescendingStyle() {
UNCOV
106
        return this.rootDimension.sortDirection === SortingDirection.Desc;
×
107
    }
108

109
    @HostBinding('class.igx-grid-th--sortable')
110
    public get sortableStyle() {
UNCOV
111
        return true;
×
112
    }
113

114
    @HostBinding('class.igx-grid-th--sorted')
115
    public get sortedStyle() {
UNCOV
116
        return this.rootDimension.sortDirection !== undefined && this.rootDimension.sortDirection !== SortingDirection.None;
×
117
    }
118

119
    protected override get activeNode() {
120
        this.grid.navigation.isRowDimensionHeaderActive = true;
×
121
        this.grid.navigation.isRowHeaderActive = false;
×
122
        return {
×
123
            row: this.rowIndex, column: this.visibleIndex, level: null,
124
            mchCache: {
125
                level: 0,
126
                visibleIndex:  this.visibleIndex
127
            },
128
            layout: null
129
        };
130
    }
131

132
    public override activate() {
133
        this.grid.navigation.setActiveNode(this.activeNode);
×
134
    }
135

136
    /**
137
     * @hidden @internal
138
     */
139
    public override pointerdown(_event: PointerEvent): void {
140
        this.activate();
×
141
    }
142

143
    /**
144
     * @hidden @internal
145
     */
146
    public override onMouseDown(_event: MouseEvent): void {
147
        this.activate();
×
148
    }
149

150
    public override get selectable(): boolean {
151
        return false;
×
152
    }
153
}
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