UNPKG

3.71 kBTypeScriptView Raw
1import { ChangeDetectorRef, OnChanges, SimpleChanges } from '@angular/core';
2import { ControlValueAccessor } from '@angular/forms';
3import { NgbTime } from './ngb-time';
4import { NgbTimepickerConfig } from './timepicker-config';
5import { NgbTimeAdapter } from './ngb-time-adapter';
6import { NgbTimepickerI18n } from './timepicker-i18n';
7import * as i0 from "@angular/core";
8/**
9 * A directive that helps with wth picking hours, minutes and seconds.
10 */
11export declare class NgbTimepicker implements ControlValueAccessor, OnChanges {
12 private readonly _config;
13 private _ngbTimeAdapter;
14 private _cd;
15 i18n: NgbTimepickerI18n;
16 static ngAcceptInputType_size: string;
17 disabled: boolean;
18 model?: NgbTime;
19 private _hourStep;
20 private _minuteStep;
21 private _secondStep;
22 /**
23 * Whether to display 12H or 24H mode.
24 */
25 meridian: boolean;
26 /**
27 * If `true`, the spinners above and below inputs are visible.
28 */
29 spinners: boolean;
30 /**
31 * If `true`, it is possible to select seconds.
32 */
33 seconds: boolean;
34 /**
35 * The number of hours to add/subtract when clicking hour spinners.
36 */
37 set hourStep(step: number);
38 get hourStep(): number;
39 /**
40 * The number of minutes to add/subtract when clicking minute spinners.
41 */
42 set minuteStep(step: number);
43 get minuteStep(): number;
44 /**
45 * The number of seconds to add/subtract when clicking second spinners.
46 */
47 set secondStep(step: number);
48 get secondStep(): number;
49 /**
50 * If `true`, the timepicker is readonly and can't be changed.
51 */
52 readonlyInputs: boolean;
53 /**
54 * The size of inputs and buttons.
55 */
56 size: 'small' | 'medium' | 'large';
57 constructor(_config: NgbTimepickerConfig, _ngbTimeAdapter: NgbTimeAdapter<any>, _cd: ChangeDetectorRef, i18n: NgbTimepickerI18n);
58 onChange: (_: any) => void;
59 onTouched: () => void;
60 writeValue(value: any): void;
61 registerOnChange(fn: (value: any) => any): void;
62 registerOnTouched(fn: () => any): void;
63 setDisabledState(isDisabled: boolean): void;
64 /**
65 * Increments the hours by the given step.
66 */
67 changeHour(step: number): void;
68 /**
69 * Increments the minutes by the given step.
70 */
71 changeMinute(step: number): void;
72 /**
73 * Increments the seconds by the given step.
74 */
75 changeSecond(step: number): void;
76 /**
77 * Update hours with the new value.
78 */
79 updateHour(newVal: string): void;
80 /**
81 * Update minutes with the new value.
82 */
83 updateMinute(newVal: string): void;
84 /**
85 * Update seconds with the new value.
86 */
87 updateSecond(newVal: string): void;
88 toggleMeridian(): void;
89 formatInput(input: HTMLInputElement): void;
90 formatHour(value?: number): string;
91 formatMinSec(value?: number): string;
92 handleBlur(): void;
93 get isSmallSize(): boolean;
94 get isLargeSize(): boolean;
95 ngOnChanges(changes: SimpleChanges): void;
96 private propagateModelChange;
97 static ɵfac: i0.ɵɵFactoryDeclaration<NgbTimepicker, never>;
98 static ɵcmp: i0.ɵɵComponentDeclaration<NgbTimepicker, "ngb-timepicker", ["ngbTimepicker"], { "meridian": { "alias": "meridian"; "required": false; }; "spinners": { "alias": "spinners"; "required": false; }; "seconds": { "alias": "seconds"; "required": false; }; "hourStep": { "alias": "hourStep"; "required": false; }; "minuteStep": { "alias": "minuteStep"; "required": false; }; "secondStep": { "alias": "secondStep"; "required": false; }; "readonlyInputs": { "alias": "readonlyInputs"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
99}