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

IgniteUI / igniteui-angular / 13013818259

28 Jan 2025 03:27PM CUT coverage: 91.561% (-0.04%) from 91.599%
13013818259

Pull #15223

github

web-flow
Merge 2c7faa429 into 0e6186987
Pull Request #15223: Ttonev/fix 14970 19.0

12990 of 15240 branches covered (85.24%)

0 of 14 new or added lines in 2 files covered. (0.0%)

86 existing lines in 17 files now uncovered.

26342 of 28770 relevant lines covered (91.56%)

34016.46 hits per line

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

68.97
/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')
32
    public userSelect = 'none';
61✔
33

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

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

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

59
    public get parent() {
UNCOV
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() {
71
        return `${this.grid.id}_-2_${this.rootDimension.memberName}_${this.visibleIndex}`;
1,286✔
72
    }
73

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

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

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

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

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

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

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

119
    protected override get activeNode() {
UNCOV
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() {
UNCOV
133
        this.grid.navigation.setActiveNode(this.activeNode);
×
134
    }
135

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

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

150
    public override get selectable(): boolean {
UNCOV
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