1 | import { AfterViewInit, EventEmitter, Injector, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
|
2 | import { ControlValueAccessor } from '@angular/forms';
|
3 | import { NgbCalendar } from './ngb-calendar';
|
4 | import { NgbDate } from './ngb-date';
|
5 | import { DatepickerViewModel, DayViewModel, MonthViewModel, NavigationEvent } from './datepicker-view-model';
|
6 | import { DayTemplateContext } from './datepicker-day-template-context';
|
7 | import { NgbDateStruct } from './ngb-date-struct';
|
8 | import { NgbDatepickerI18n } from './datepicker-i18n';
|
9 | import { ContentTemplateContext } from './datepicker-content-template-context';
|
10 | import * as i0 from "@angular/core";
|
11 |
|
12 |
|
13 |
|
14 | export interface NgbDatepickerNavigateEvent {
|
15 | |
16 |
|
17 |
|
18 | current: {
|
19 | year: number;
|
20 | month: number;
|
21 | } | null;
|
22 | |
23 |
|
24 |
|
25 | next: {
|
26 | year: number;
|
27 | month: number;
|
28 | };
|
29 | |
30 |
|
31 |
|
32 |
|
33 |
|
34 | preventDefault: () => void;
|
35 | }
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export interface NgbDatepickerState {
|
44 | |
45 |
|
46 |
|
47 | readonly minDate: NgbDate | null;
|
48 | |
49 |
|
50 |
|
51 | readonly maxDate: NgbDate | null;
|
52 | |
53 |
|
54 |
|
55 | readonly firstDate: NgbDate;
|
56 | |
57 |
|
58 |
|
59 | readonly lastDate: NgbDate;
|
60 | |
61 |
|
62 |
|
63 | readonly focusedDate: NgbDate;
|
64 | |
65 |
|
66 |
|
67 |
|
68 |
|
69 | readonly months: NgbDate[];
|
70 | }
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | export declare class NgbDatepickerContent {
|
77 | templateRef: TemplateRef<any>;
|
78 | static ɵfac: i0.ɵɵFactoryDeclaration<NgbDatepickerContent, never>;
|
79 | static ɵdir: i0.ɵɵDirectiveDeclaration<NgbDatepickerContent, "ng-template[ngbDatepickerContent]", never, {}, {}, never, never, true, never>;
|
80 | }
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | export declare class NgbDatepickerMonth {
|
90 | private _keyboardService;
|
91 | private _service;
|
92 | i18n: NgbDatepickerI18n;
|
93 | datepicker: NgbDatepicker;
|
94 | viewModel: MonthViewModel;
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | set month(month: NgbDateStruct);
|
102 | onKeyDown(event: KeyboardEvent): void;
|
103 | doSelect(day: DayViewModel): void;
|
104 | static ɵfac: i0.ɵɵFactoryDeclaration<NgbDatepickerMonth, never>;
|
105 | static ɵcmp: i0.ɵɵComponentDeclaration<NgbDatepickerMonth, "ngb-datepicker-month", never, { "month": { "alias": "month"; "required": false; }; }, {}, never, never, true, never>;
|
106 | }
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | export declare class NgbDatepicker implements AfterViewInit, OnChanges, OnInit, ControlValueAccessor {
|
113 | static ngAcceptInputType_autoClose: boolean | string;
|
114 | static ngAcceptInputType_navigation: string;
|
115 | static ngAcceptInputType_outsideDays: string;
|
116 | static ngAcceptInputType_weekdays: boolean | string;
|
117 | model: DatepickerViewModel;
|
118 | private _defaultDayTemplate;
|
119 | private _contentEl;
|
120 | protected injector: Injector;
|
121 | private _service;
|
122 | private _calendar;
|
123 | private _i18n;
|
124 | private _config;
|
125 | private _nativeElement;
|
126 | private _ngbDateAdapter;
|
127 | private _ngZone;
|
128 | private _destroyRef;
|
129 | private _injector;
|
130 | private _controlValue;
|
131 | private _publicState;
|
132 | private _initialized;
|
133 | |
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | contentTemplate: TemplateRef<ContentTemplateContext>;
|
144 | contentTemplateFromContent?: NgbDatepickerContent;
|
145 | |
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 | dayTemplate: TemplateRef<DayTemplateContext>;
|
153 | |
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 | dayTemplateData: (date: NgbDateStruct, current?: {
|
162 | year: number;
|
163 | month: number;
|
164 | } | undefined) => any;
|
165 | |
166 |
|
167 |
|
168 | displayMonths: number;
|
169 | |
170 |
|
171 |
|
172 |
|
173 |
|
174 | firstDayOfWeek: number;
|
175 | |
176 |
|
177 |
|
178 |
|
179 |
|
180 | footerTemplate: TemplateRef<any>;
|
181 | |
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 | markDisabled: (date: NgbDateStruct, current?: {
|
189 | year: number;
|
190 | month: number;
|
191 | } | undefined) => boolean;
|
192 | |
193 |
|
194 |
|
195 |
|
196 |
|
197 | maxDate: NgbDateStruct;
|
198 | |
199 |
|
200 |
|
201 |
|
202 |
|
203 | minDate: NgbDateStruct;
|
204 | |
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | navigation: "select" | "none" | "arrows";
|
212 | |
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 | outsideDays: "visible" | "collapsed" | "hidden";
|
222 | |
223 |
|
224 |
|
225 | showWeekNumbers: boolean;
|
226 | |
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 | startDate: {
|
235 | year: number;
|
236 | month: number;
|
237 | day?: number | undefined;
|
238 | };
|
239 | |
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 | weekdays: boolean | "narrow" | "long" | "short";
|
249 | |
250 |
|
251 |
|
252 |
|
253 |
|
254 | navigate: EventEmitter<NgbDatepickerNavigateEvent>;
|
255 | |
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 | dateSelect: EventEmitter<NgbDate>;
|
263 | onChange: (_: any) => void;
|
264 | onTouched: () => void;
|
265 | constructor();
|
266 | /**
|
267 | * Returns the readonly public state of the datepicker
|
268 | *
|
269 | * @since 5.2.0
|
270 | */
|
271 | get state(): NgbDatepickerState;
|
272 | /**
|
273 | * Returns the calendar service used in the specific datepicker instance.
|
274 | *
|
275 | * @since 5.3.0
|
276 | */
|
277 | get calendar(): NgbCalendar;
|
278 | /**
|
279 | * Returns the i18n service used in the specific datepicker instance.
|
280 | *
|
281 | * @since 14.2.0
|
282 | */
|
283 | get i18n(): NgbDatepickerI18n;
|
284 | /**
|
285 | * Focuses on given date.
|
286 | */
|
287 | focusDate(date?: NgbDateStruct | null): void;
|
288 | /**
|
289 | * Selects focused date.
|
290 | */
|
291 | focusSelect(): void;
|
292 | focus(): void;
|
293 | /**
|
294 | * Navigates to the provided date.
|
295 | *
|
296 | * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
|
297 | * If nothing or invalid date provided calendar will open current month.
|
298 | *
|
299 | * Use the `[startDate]` input as an alternative.
|
300 | */
|
301 | navigateTo(date?: {
|
302 | year: number;
|
303 | month: number;
|
304 | day?: number;
|
305 | }): void;
|
306 | ngAfterViewInit(): void;
|
307 | ngOnInit(): void;
|
308 | ngOnChanges(changes: SimpleChanges): void;
|
309 | onDateSelect(date: NgbDate): void;
|
310 | onNavigateDateSelect(date: NgbDate): void;
|
311 | onNavigateEvent(event: NavigationEvent): void;
|
312 | registerOnChange(fn: (value: any) => any): void;
|
313 | registerOnTouched(fn: () => any): void;
|
314 | setDisabledState(disabled: boolean): void;
|
315 | writeValue(value: any): void;
|
316 | static ɵfac: i0.ɵɵFactoryDeclaration<NgbDatepicker, never>;
|
317 | static ɵcmp: i0.ɵɵComponentDeclaration<NgbDatepicker, "ngb-datepicker", ["ngbDatepicker"], { "contentTemplate": { "alias": "contentTemplate"; "required": false; }; "dayTemplate": { "alias": "dayTemplate"; "required": false; }; "dayTemplateData": { "alias": "dayTemplateData"; "required": false; }; "displayMonths": { "alias": "displayMonths"; "required": false; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; }; "markDisabled": { "alias": "markDisabled"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "navigation": { "alias": "navigation"; "required": false; }; "outsideDays": { "alias": "outsideDays"; "required": false; }; "showWeekNumbers": { "alias": "showWeekNumbers"; "required": false; }; "startDate": { "alias": "startDate"; "required": false; }; "weekdays": { "alias": "weekdays"; "required": false; }; }, { "navigate": "navigate"; "dateSelect": "dateSelect"; }, ["contentTemplateFromContent"], never, true, never>;
|
318 | }
|