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

IgniteUI / igniteui-angular / 12887111410

21 Jan 2025 12:38PM CUT coverage: 91.61% (+0.004%) from 91.606%
12887111410

Pull #15276

github

web-flow
Merge 39636a89e into 1a19cdebd
Pull Request #15276: fix(input-group): fix helper text spacing in material theme

12992 of 15230 branches covered (85.31%)

26335 of 28747 relevant lines covered (91.61%)

34039.27 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
    imports: [IgxIconComponent, NgIf, IgxPivotRowDimensionHeaderComponent, NgClass, NgStyle, IgxColumnMovingDragDirective, IgxColumnMovingDropDirective, IgxPivotResizeHandleDirective, IgxHeaderGroupStylePipe]
26
})
27
export class IgxPivotRowDimensionHeaderGroupComponent extends IgxGridHeaderGroupComponent implements PivotRowHeaderGroupType {
2✔
28

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

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

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

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

59

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

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

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

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

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

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

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

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

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

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

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

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

158

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

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

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

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