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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

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

22.22
/src/date-picker/range-picker.component.ts
1
import { ThyPanelMode, ThyShortcutPreset, ThyShortcutRange } from './standard-types';
2
import { forwardRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit, Input } from '@angular/core';
3
import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
import { useHostRenderer } from '@tethys/cdk/dom';
5

6
import { NgIf } from '@angular/common';
7
import { BasePickerComponent } from './base-picker.component';
8
import { DatePopupComponent } from './lib/popups/date-popup.component';
9
import { ThyPickerComponent } from './picker.component';
10
import { helpers } from 'ngx-tethys/util';
11

12
/**
13
 * 日期范围选择组件
14
 * @name thy-range-picker
15
 * @order 60
16
 */
17
@Component({
1✔
18
    changeDetection: ChangeDetectionStrategy.OnPush,
19
    selector: 'thy-range-picker',
×
20
    exportAs: 'thyRangePicker',
×
21
    templateUrl: './base-picker.component.html',
×
22
    providers: [
23
        {
24
            provide: NG_VALUE_ACCESSOR,
25
            multi: true,
×
26
            useExisting: forwardRef(() => ThyRangePickerComponent)
×
27
        }
×
28
    ],
×
29
    standalone: true,
×
30
    imports: [ThyPickerComponent, NgIf, DatePopupComponent]
×
31
})
32
export class ThyRangePickerComponent extends BasePickerComponent implements OnInit {
1✔
33
    isRange = true;
34

35
    private hostRenderer = useHostRenderer();
36

1✔
37
    /**
38
     * 支持的选区间模式
39
     * @type  year | month | date
40
     */
41
    @Input() thyMode: ThyPanelMode = 'date';
1✔
42

43
    /**
44
     * 已废弃,请使用 thyShortcutPresets
45
     * @deprecated
46
     * @type ThyShortcutRange[]
47
     */
48
    @Input() set thyShortcutRanges(ranges: ThyShortcutRange[]) {
49
        if (ranges && helpers.isArray(ranges)) {
50
            const presets: ThyShortcutPreset[] = ranges.map(range => ({ title: range.title, value: [range.begin, range.end] }));
51
            this.shortcutPresets = [...presets];
×
52
        }
53
    }
54

55
    constructor(cdr: ChangeDetectorRef, protected elementRef: ElementRef) {
56
        super(cdr, elementRef);
57
        this.hostRenderer.addClass('thy-calendar-picker');
58
    }
59
}
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