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

IgniteUI / igniteui-angular / 13287444581

12 Feb 2025 02:18PM UTC coverage: 10.56% (-81.0%) from 91.606%
13287444581

Pull #15359

github

web-flow
Merge a24969adb into 32cfe83f6
Pull Request #15359: fix(time-picker): exclude from SSR toggle events #15135

933 of 15233 branches covered (6.12%)

3037 of 28759 relevant lines covered (10.56%)

352.42 hits per line

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

78.57
/projects/igniteui-angular/src/lib/directives/button/button-base.ts
1
import { Directive, ElementRef, EventEmitter, HostBinding, HostListener, Input, Output, booleanAttribute } from '@angular/core';
2
import { mkenum } from '../../core/utils';
3

4
export const IgxBaseButtonType = /*@__PURE__*/mkenum({
2✔
5
    Flat: 'flat',
6
    Contained: 'contained',
7
    Outlined: 'outlined'
8
});
9

10
@Directive()
11
export abstract class IgxButtonBaseDirective {
2✔
12
    /**
13
     * Emitted when the button is clicked.
14
     */
15
    @Output()
16
    public buttonClick = new EventEmitter<any>();
98✔
17

18
    /**
19
     * Sets/gets the `role` attribute.
20
     *
21
     * @example
22
     * ```typescript
23
     * this.button.role = 'navbutton';
24
     * let buttonRole = this.button.role;
25
     * ```
26
     */
27
    @HostBinding('attr.role')
28
    public role = 'button';
98✔
29

30
    /**
31
     * @hidden
32
     * @internal
33
     */
34
    @HostListener('click', ['$event'])
35
    public onClick(ev: MouseEvent) {
36
        this.buttonClick.emit(ev);
2✔
37
        this.focused = false;
2✔
38
    }
39

40
    /**
41
     * @hidden
42
     * @internal
43
     */
44
    @HostListener('blur')
45
    protected onBlur() {
46
        this.focused = false;
×
47
    }
48

49
    /**
50
     * Sets/gets whether the button component is on focus.
51
     * Default value is `false`.
52
     * ```typescript
53
     * this.button.focus = true;
54
     * ```
55
     * ```typescript
56
     * let isFocused =  this.button.focused;
57
     * ```
58
     */
59
    @HostBinding('class.igx-button--focused')
60
    protected focused = false;
98✔
61

62
    /**
63
      * Enables/disables the button.
64
      *
65
      * @example
66
      * ```html
67
      * <button igxButton="fab" disabled></button>
68
      * ```
69
      */
70
    @Input({ transform: booleanAttribute })
71
    @HostBinding('class.igx-button--disabled')
72
    public disabled = false;
98✔
73

74
    /**
75
     * @hidden
76
     * @internal
77
     */
78
    @HostBinding('attr.disabled')
79
    public get disabledAttribute() {
80
        return this.disabled || null;
990✔
81
    }
82

83
    constructor(public element: ElementRef) { }
98✔
84

85
    /**
86
     * @hidden
87
     * @internal
88
     */
89
    @HostListener('keyup', ['$event'])
90
    protected updateOnKeyUp(event: KeyboardEvent) {
91
        if (event.key === "Tab") {
×
92
            this.focused = true;
×
93
        }
94
    }
95

96
    /**
97
     * Returns the underlying DOM element.
98
     */
99
    public get nativeElement() {
100
        return this.element.nativeElement;
196✔
101
    }
102
}
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