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

IgniteUI / igniteui-angular / 12072443768

28 Nov 2024 04:16PM UTC coverage: 91.621%. Remained the same
12072443768

Pull #15120

github

web-flow
fix(excel-style-filtering): reset filter value (#15090)

* fix(esf): show filters based on column name

* fix(esf-custom-dialog): filter expressionsList by column name

* chore(*): revert changes after branch retarget

---------

Co-authored-by: RadoMirchev <radoslav.p.mirchev@gmail.com>
Co-authored-by: Konstantin Dinev <kdinev@mail.bw.edu>
Co-authored-by: Galina Edinakova <gedinakova@infragistics.com>
Pull Request #15120: Mass Merge 19.0.x to master

12969 of 15202 branches covered (85.31%)

54 of 65 new or added lines in 14 files covered. (83.08%)

111 existing lines in 6 files now uncovered.

26309 of 28715 relevant lines covered (91.62%)

34021.05 hits per line

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

97.56
/projects/igniteui-angular/src/lib/icon/icon.component.ts
1
import {
2
    Component,
3
    ElementRef,
4
    HostBinding,
5
    Input,
6
    OnInit,
7
    OnDestroy,
8
    OnChanges,
9
    ChangeDetectorRef,
10
    booleanAttribute,
11
} from "@angular/core";
12
import { IgxIconService } from "./icon.service";
13
import type { IconReference } from "./types";
14
import { filter, takeUntil } from "rxjs/operators";
15
import { Subject } from "rxjs";
16
import { SafeHtml } from "@angular/platform-browser";
17
import { NgIf, NgTemplateOutlet } from "@angular/common";
18
import { ThemeService } from "../services/theme/theme.service";
19

20
/**
21
 * Icon provides a way to include material icons to markup
22
 *
23
 * @igxModule IgxIconModule
24
 *
25
 * @igxTheme igx-icon-theme
26
 *
27
 * @igxKeywords icon, picture
28
 *
29
 * @igxGroup Display
30
 *
31
 * @remarks
32
 *
33
 * The Ignite UI Icon makes it easy for developers to include material design icons directly in their markup. The icons
34
 * support different icon families and can be marked as active or disabled using the `active` property. This will change the appearance
35
 * of the icon.
36
 *
37
 * @example
38
 * ```html
39
 * <igx-icon family="filter-icons" active="true">home</igx-icon>
40
 * ```
41
 */
42
@Component({
43
    selector: "igx-icon",
44
    templateUrl: "icon.component.html",
45
    imports: [NgTemplateOutlet, NgIf]
46
})
47
export class IgxIconComponent implements OnInit, OnChanges, OnDestroy {
2✔
48
    private _iconRef: IconReference;
49
    private _destroy$ = new Subject<void>();
64,008✔
50
    private _userClasses = new Set<string>();
64,008✔
51
    private _iconClasses = new Set<string>();
64,008✔
52

53
    @HostBinding("class")
54
    protected get elementClasses() {
55
        const icon = Array.from(this._iconClasses).join(" ");
364,335✔
56
        const user = Array.from(this._userClasses).join(" ");
364,335✔
57

58
        return `igx-icon ${icon} ${user}`.trim();
364,335✔
59
    }
60

61
    private addIconClass(className: string) {
62
        this._iconClasses.add(className);
128,263✔
63
    }
64

65
    private clearIconClasses() {
66
        this._iconClasses.clear();
128,257✔
67
    }
68

69
    /**
70
     *  This allows you to disable the `aria-hidden` attribute. By default it's applied.
71
     *
72
     * @example
73
     * ```typescript
74
     * @ViewChild("MyIcon") public icon: IgxIconComponent;
75
     * constructor(private cdRef:ChangeDetectorRef) {}
76
     * ngAfterViewInit() {
77
     *     this.icon.ariaHidden = false;
78
     *     this.cdRef.detectChanges();
79
     * }
80
     * ```
81
     */
82
    @HostBinding("attr.aria-hidden")
83
    public ariaHidden = true;
64,008✔
84

85
    /**
86
     *  An accessor that returns inactive property.
87
     *
88
     * @example
89
     * ```typescript
90
     * @ViewChild("MyIcon")
91
     * public icon: IgxIconComponent;
92
     * ngAfterViewInit() {
93
     *    let iconActive = this.icon.getInactive;
94
     * }
95
     * ```
96
     */
97
    @HostBinding("class.igx-icon--inactive")
98
    public get getInactive(): boolean {
99
        return !this.active;
364,335✔
100
    }
101

102
    /**
103
     * An @Input property that sets the value of the `family`. By default it's "material".
104
     *
105
     * @example
106
     * ```html
107
     * <igx-icon family="material">settings</igx-icon>
108
     * ```
109
     */
110
    @Input()
111
    public family: string;
112

113
    /**
114
     *  Set the `name` of the icon.
115
     *
116
     *  @example
117
     * ```html
118
     * <igx-icon name="contains" family="filter-icons"></igx-icon>
119
     * ```
120
     */
121
    @Input()
122
    public name: string;
123

124
    /**
125
     * An @Input property that allows you to disable the `active` property. By default it's applied.
126
     *
127
     * @example
128
     * ```html
129
     * <igx-icon [active]="false">settings</igx-icon>
130
     * ```
131
     */
132
    @Input({ transform: booleanAttribute })
133
    public active = true;
64,008✔
134

135
    constructor(
136
        public el: ElementRef,
64,008✔
137
        private iconService: IgxIconService,
64,008✔
138
        private themeService: ThemeService,
64,008✔
139
        private ref: ChangeDetectorRef,
64,008✔
140
    ) {
141
        this.family = this.iconService.defaultFamily.name;
64,008✔
142
        this.iconService.setRefsByTheme(this.themeService.globalTheme);
64,008✔
143

144
        this.iconService.iconLoaded
64,008✔
145
            .pipe(
146
                filter((e) => e.name === this.name && e.family === this.family),
48,196✔
147
                takeUntil(this._destroy$),
148
            )
149
            .subscribe(() => {
150
                this.setIcon();
2✔
151
                this.ref.detectChanges()
2✔
152
            });
153
    }
154

155
    /**
156
     * @hidden
157
     * @internal
158
     */
159
    public ngOnInit() {
160
        this.setIcon();
64,008✔
161
    }
162

163
    /**
164
     * @hidden
165
     * @internal
166
     */
167
    public ngOnChanges() {
168
        this.setIcon();
64,247✔
169
    }
170

171
    /**
172
     * @hidden
173
     * @internal
174
     */
175
    public ngOnDestroy() {
176
        this._destroy$.next();
63,688✔
177
        this._destroy$.complete();
63,688✔
178
    }
179

180
    protected get iconRef() {
181
        return this._iconRef;
1,221,201✔
182
    }
183

184
    protected set iconRef(ref: IconReference) {
185
        this._iconRef = ref;
128,257✔
186
    }
187

188
    /**
189
     *  An accessor that returns the value of the family property.
190
     *
191
     * @example
192
     * ```typescript
193
     *  @ViewChild("MyIcon")
194
     * public icon: IgxIconComponent;
195
     * ngAfterViewInit() {
196
     *    let iconFamily = this.icon.getFamily;
197
     * }
198
     * ```
199
     */
200
    public get getFamily(): string {
201
        return this.iconRef.family;
3✔
202
    }
203

204
    /**
205
     *  An accessor that returns the value of the active property.
206
     *
207
     * @example
208
     * ```typescript
209
     * @ViewChild("MyIcon")
210
     * public icon: IgxIconComponent;
211
     * ngAfterViewInit() {
212
     *    let iconActive = this.icon.getActive;
213
     * }
214
     * ```
215
     */
216
    public get getActive(): boolean {
217
        return this.active;
5✔
218
    }
219

220
    /**
221
     * An accessor that returns the value of the iconName property.
222
     *
223
     * @example
224
     * ```typescript
225
     * @ViewChild("MyIcon")
226
     * public icon: IgxIconComponent;
227
     * ngAfterViewInit() {
228
     *    let name = this.icon.getName;
229
     * }
230
     * ```
231
     */
232
    public get getName(): string {
233
        return this.iconRef.name;
2✔
234
    }
235

236
    /**
237
     *  An accessor that returns the underlying SVG image as SafeHtml.
238
     *
239
     * @example
240
     * ```typescript
241
     * @ViewChild("MyIcon")
242
     * public icon: IgxIconComponent;
243
     * ngAfterViewInit() {
244
     *    let svg: SafeHtml = this.icon.getSvg;
245
     * }
246
     * ```
247
     */
248
    public get getSvg(): SafeHtml {
249
        const { name, family } = this.iconRef;
31,399✔
250

251
        if (this.iconService.isSvgIconCached(name, family)) {
31,399✔
252
            return this.iconService.getSvgIcon(name, family);
31,399✔
253
        }
254

UNCOV
255
        return null;
×
256
    }
257

258
    /**
259
     * @hidden
260
     * @internal
261
     */
262
    private setIcon() {
263
        this.iconRef = this.iconService.getIconRef(this.name, this.family);
128,257✔
264
        this.clearIconClasses();
128,257✔
265

266
        const { name, type, className } = this.iconRef;
128,257✔
267

268
        if (name && type === "font") {
128,257✔
269
            this.addIconClass(name);
6✔
270
        }
271

272
        this.addIconClass(className);
128,257✔
273
    }
274
}
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

© 2026 Coveralls, Inc