• 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

2.08
/projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component.ts
1
import { Component, HostBinding } from '@angular/core';
2
import { IgxGridActionsBaseDirective } from './grid-actions-base.directive';
3
import { pinLeft, unpinLeft, jumpDown, jumpUp } from '@igniteui/material-icons-extended';
4
import { IgxGridActionButtonComponent } from './grid-action-button.component';
5
import { NgIf } from '@angular/common';
6

7
/* blazorElement */
8
/* wcElementTag: igc-grid-pinning-actions */
9
/* blazorIndirectRender */
10
/* singleInstanceIdentifier */
11
/**
12
 * Grid Pinning Actions for the Action Strip
13
 *
14
 * @igxParent IgxActionStripComponent
15
 */
16
@Component({
17
    selector: 'igx-grid-pinning-actions',
18
    templateUrl: 'grid-pinning-actions.component.html',
19
    providers: [{ provide: IgxGridActionsBaseDirective, useExisting: IgxGridPinningActionsComponent }],
20
    imports: [NgIf, IgxGridActionButtonComponent]
21
})
22

23
export class IgxGridPinningActionsComponent extends IgxGridActionsBaseDirective {
2✔
24
    /**
25
     * Host `class.igx-action-strip` binding.
26
     *
27
     * @hidden
28
     * @internal
29
     */
30
    @HostBinding('class.igx-action-strip__pinning-actions')
UNCOV
31
    public cssClass = 'igx-action-strip__pinning-actions';
×
32

UNCOV
33
    private iconsRendered = false;
×
34

35
    /**
36
     * Getter to know if the row is pinned
37
     *
38
     * @hidden
39
     * @internal
40
     */
41
    public get pinned(): boolean {
UNCOV
42
        if (!this.isRow(this.strip.context)) {
×
43
            return;
×
44
        }
UNCOV
45
        const context = this.strip.context;
×
UNCOV
46
        if (context && !this.iconsRendered) {
×
UNCOV
47
            this.registerSVGIcons();
×
UNCOV
48
            this.iconsRendered = true;
×
49
        }
UNCOV
50
        return context && context.pinned;
×
51
    }
52

53
    /**
54
     * Getter to know if the row is in pinned and ghost
55
     *
56
     * @hidden
57
     * @internal
58
     */
59
    public get inPinnedArea(): boolean {
UNCOV
60
        if (!this.isRow(this.strip.context)) {
×
61
            return;
×
62
        }
UNCOV
63
        const context = this.strip.context;
×
UNCOV
64
        return this.pinned && !context.disabled;
×
65
    }
66

67
    /**
68
     * Getter to know if the row pinning is set to top or bottom
69
     *
70
     * @hidden
71
     * @internal
72
     */
73
    public get pinnedTop(): boolean {
UNCOV
74
        if (!this.isRow(this.strip.context)) {
×
75
            return;
×
76
        }
UNCOV
77
        return this.strip.context.grid.isRowPinningToTop;
×
78
    }
79

80
    /**
81
     * Pin the row according to the context.
82
     *
83
     * @example
84
     * ```typescript
85
     * this.gridPinningActions.pin();
86
     * ```
87
     */
88
    public pin(event?): void {
UNCOV
89
        if (event) {
×
UNCOV
90
            event.stopPropagation();
×
91
        }
UNCOV
92
        if (!this.isRow(this.strip.context)) {
×
93
            return;
×
94
        }
UNCOV
95
        const row = this.strip.context;
×
UNCOV
96
        const grid = row.grid;
×
UNCOV
97
        grid.pinRow(row.key, grid.pinnedRecords.length);
×
UNCOV
98
        this.strip.hide();
×
99
    }
100

101
    /**
102
     * Unpin the row according to the context.
103
     *
104
     * @example
105
     * ```typescript
106
     * this.gridPinningActions.unpin();
107
     * ```
108
     */
109
    public unpin(event?): void {
UNCOV
110
        if (event) {
×
UNCOV
111
            event.stopPropagation();
×
112
        }
UNCOV
113
        if (!this.isRow(this.strip.context)) {
×
114
            return;
×
115
        }
UNCOV
116
        const row = this.strip.context;
×
UNCOV
117
        const grid = row.grid;
×
UNCOV
118
        grid.unpinRow(row.key);
×
UNCOV
119
        this.strip.hide();
×
120
    }
121

122
    public scrollToRow(event) {
UNCOV
123
        if (event) {
×
UNCOV
124
            event.stopPropagation();
×
125
        }
UNCOV
126
        const context = this.strip.context;
×
UNCOV
127
        const grid = context.grid;
×
UNCOV
128
        grid.scrollTo(context.data, 0);
×
UNCOV
129
        this.strip.hide();
×
130
    }
131

132
    private registerSVGIcons(): void {
UNCOV
133
        if (!this.isRow(this.strip.context)) {
×
134
            return;
×
135
        }
UNCOV
136
        const context = this.strip.context;
×
UNCOV
137
        const grid = context.grid;
×
UNCOV
138
        if (grid) {
×
UNCOV
139
            this.iconService.addSvgIconFromText(pinLeft.name, pinLeft.value, 'imx-icons', true);
×
UNCOV
140
            this.iconService.addSvgIconFromText(unpinLeft.name, unpinLeft.value, 'imx-icons', true);
×
UNCOV
141
            this.iconService.addSvgIconFromText(jumpDown.name, jumpDown.value, 'imx-icons', true);
×
UNCOV
142
            this.iconService.addSvgIconFromText(jumpUp.name, jumpUp.value, 'imx-icons', true);
×
143
        }
144
    }
145
}
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