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 | number;
|
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 _controlValue;
|
130 | private _publicState;
|
131 | |
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | contentTemplate: TemplateRef<ContentTemplateContext>;
|
142 | contentTemplateFromContent?: NgbDatepickerContent;
|
143 | |
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 | dayTemplate: TemplateRef<DayTemplateContext>;
|
151 | |
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | dayTemplateData: (date: NgbDateStruct, current?: {
|
160 | year: number;
|
161 | month: number;
|
162 | } | undefined) => any;
|
163 | |
164 |
|
165 |
|
166 | displayMonths: number;
|
167 | |
168 |
|
169 |
|
170 |
|
171 |
|
172 | firstDayOfWeek: number;
|
173 | |
174 |
|
175 |
|
176 |
|
177 |
|
178 | footerTemplate: TemplateRef<any>;
|
179 | |
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 | markDisabled: (date: NgbDateStruct, current?: {
|
187 | year: number;
|
188 | month: number;
|
189 | } | undefined) => boolean;
|
190 | |
191 |
|
192 |
|
193 |
|
194 |
|
195 | maxDate: NgbDateStruct;
|
196 | |
197 |
|
198 |
|
199 |
|
200 |
|
201 | minDate: NgbDateStruct;
|
202 | |
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 | navigation: "select" | "none" | "arrows";
|
210 | |
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | outsideDays: "visible" | "collapsed" | "hidden";
|
220 | |
221 |
|
222 |
|
223 | showWeekNumbers: boolean;
|
224 | |
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 | startDate: {
|
233 | year: number;
|
234 | month: number;
|
235 | day?: number | undefined;
|
236 | };
|
237 | |
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 | weekdays: boolean | import("@angular/common").TranslationWidth;
|
247 | |
248 |
|
249 |
|
250 |
|
251 |
|
252 | navigate: EventEmitter<NgbDatepickerNavigateEvent>;
|
253 | |
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 | dateSelect: EventEmitter<NgbDate>;
|
261 | onChange: (_: any) => void;
|
262 | onTouched: () => void;
|
263 | constructor();
|
264 | /**
|
265 | * Returns the readonly public state of the datepicker
|
266 | *
|
267 | * @since 5.2.0
|
268 | */
|
269 | get state(): NgbDatepickerState;
|
270 | /**
|
271 | * Returns the calendar service used in the specific datepicker instance.
|
272 | *
|
273 | * @since 5.3.0
|
274 | */
|
275 | get calendar(): NgbCalendar;
|
276 | /**
|
277 | * Returns the i18n service used in the specific datepicker instance.
|
278 | *
|
279 | * @since 14.2.0
|
280 | */
|
281 | get i18n(): NgbDatepickerI18n;
|
282 | /**
|
283 | * Focuses on given date.
|
284 | */
|
285 | focusDate(date?: NgbDateStruct | null): void;
|
286 | /**
|
287 | * Selects focused date.
|
288 | */
|
289 | focusSelect(): void;
|
290 | focus(): void;
|
291 | /**
|
292 | * Navigates to the provided date.
|
293 | *
|
294 | * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
|
295 | * If nothing or invalid date provided calendar will open current month.
|
296 | *
|
297 | * Use the `[startDate]` input as an alternative.
|
298 | */
|
299 | navigateTo(date?: {
|
300 | year: number;
|
301 | month: number;
|
302 | day?: number;
|
303 | }): void;
|
304 | ngAfterViewInit(): void;
|
305 | ngOnInit(): void;
|
306 | ngOnChanges(changes: SimpleChanges): void;
|
307 | onDateSelect(date: NgbDate): void;
|
308 | onNavigateDateSelect(date: NgbDate): void;
|
309 | onNavigateEvent(event: NavigationEvent): void;
|
310 | registerOnChange(fn: (value: any) => any): void;
|
311 | registerOnTouched(fn: () => any): void;
|
312 | setDisabledState(disabled: boolean): void;
|
313 | writeValue(value: any): void;
|
314 | static ɵfac: i0.ɵɵFactoryDeclaration<NgbDatepicker, never>;
|
315 | 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>;
|
316 | }
|