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

atinc / ngx-tethys / 68ef226c-f83e-44c1-b8ed-e420a83c5d84

28 May 2025 10:31AM UTC coverage: 10.352% (-80.0%) from 90.316%
68ef226c-f83e-44c1-b8ed-e420a83c5d84

Pull #3460

circleci

pubuzhixing8
chore: xxx
Pull Request #3460: refactor(icon): migrate signal input #TINFR-1476

132 of 6823 branches covered (1.93%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 1 file covered. (71.43%)

11648 existing lines in 344 files now uncovered.

2078 of 14525 relevant lines covered (14.31%)

6.69 hits per line

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

6.12
/src/date-picker/lib/calendar/calendar-footer.component.ts
1
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, Signal, SimpleChanges } from '@angular/core';
2

3
import { FormsModule } from '@angular/forms';
4
import { ThyButton } from 'ngx-tethys/button';
5
import { injectLocale, ThyDatePickerLocale } from 'ngx-tethys/i18n';
6
import { ThyIcon } from 'ngx-tethys/icon';
7
import { ThyInnerTimePicker } from 'ngx-tethys/time-picker';
8
import { coerceBooleanProperty, TinyDate } from 'ngx-tethys/util';
9

10
/**
11
 * @private
12
 */
13
@Component({
1✔
14
    changeDetection: ChangeDetectionStrategy.OnPush,
UNCOV
15
    // eslint-disable-next-line @angular-eslint/component-selector
×
UNCOV
16
    selector: 'calendar-footer',
×
UNCOV
17
    exportAs: 'calendarFooter',
×
UNCOV
18
    templateUrl: 'calendar-footer.component.html',
×
UNCOV
19
    imports: [ThyIcon, ThyInnerTimePicker, FormsModule, ThyButton]
×
UNCOV
20
})
×
UNCOV
21
export class CalendarFooter implements OnInit, OnChanges {
×
UNCOV
22
    @Input() showTime = false;
×
UNCOV
23
    @Input() mustShowTime = false;
×
UNCOV
24
    @Input() value: TinyDate;
×
25
    @Input() timeZone: string;
26
    @Input({ transform: coerceBooleanProperty }) disableTimeConfirm = false;
UNCOV
27
    @Output() readonly selectTime = new EventEmitter<TinyDate>();
×
UNCOV
28
    @Output() readonly clickOk = new EventEmitter<void>();
×
UNCOV
29
    @Output() readonly clickRemove = new EventEmitter<void>();
×
30
    @Output() readonly showTimePickerChange = new EventEmitter<boolean>();
31
    isShowTime = false;
32
    isCanTime = false;
UNCOV
33
    locale: Signal<ThyDatePickerLocale> = injectLocale('datePicker');
×
UNCOV
34

×
35
    ngOnInit() {
36
        this._initTimeShowMode();
37
        if (!this.value) {
UNCOV
38
            this.value = new TinyDate(undefined, this.timeZone);
×
39
        }
40
    }
UNCOV
41

×
UNCOV
42
    ngOnChanges(changes: SimpleChanges): void {
×
43
        if (changes.mustShowTime) {
UNCOV
44
            this._initTimeShowMode();
×
UNCOV
45
        }
×
46
    }
47

UNCOV
48
    onSelectTime(date: Date): void {
×
UNCOV
49
        this.selectTime.emit(new TinyDate(date, this.timeZone));
×
50
    }
51

UNCOV
52
    onTimeOk() {
×
53
        if (this.disableTimeConfirm) {
UNCOV
54
            return;
×
UNCOV
55
        }
×
UNCOV
56
        this.selectTime.emit(this.value);
×
57
        this.clickOk.emit();
UNCOV
58
    }
×
UNCOV
59

×
UNCOV
60
    onClear() {
×
61
        this.value = null;
UNCOV
62
        this.clickRemove.emit();
×
63
    }
64

UNCOV
65
    changeTimeShowMode(type: string) {
×
UNCOV
66
        switch (type) {
×
67
            case 'can':
68
                this.isCanTime = true;
UNCOV
69
                this.isShowTime = false;
×
UNCOV
70
                break;
×
71
            case 'show':
72
                this.isCanTime = false;
73
                this.isShowTime = true;
74
                break;
1✔
75
        }
76
        this.showTimePickerChange.emit(this.isShowTime);
77
    }
78

79
    private _initTimeShowMode() {
80
        if (this.mustShowTime) {
81
            this.changeTimeShowMode('show');
82
        } else {
83
            if (this.showTime) {
84
                this.changeTimeShowMode('can');
85
            }
86
        }
1✔
87
    }
88
}
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