@odx/angular 5.5.6 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/components/calendar/lib/calendar.component.d.ts +9 -3
- package/components/calendar/lib/calendar.config.d.ts +11 -0
- package/components/calendar/lib/calendar.service.d.ts +10 -4
- package/components/calendar/lib/components/calendar-month/calendar-month.component.d.ts +1 -3
- package/components/calendar/lib/daterange.service.d.ts +14 -0
- package/components/calendar/lib/directives/calendar-cell.directive.d.ts +19 -4
- package/components/calendar/lib/directives/calendar-view.directive.d.ts +5 -2
- package/components/calendar/lib/models/date-range.d.ts +18 -0
- package/components/calendar/lib/models/index.d.ts +3 -0
- package/components/calendar/lib/models/selected-date.d.ts +9 -0
- package/components/calendar/lib/models/selection-mode.d.ts +4 -0
- package/components/calendar/lib/pipes/date-label.pipe.d.ts +1 -0
- package/components/calendar/lib/utils/check-cell-in-range.d.ts +7 -0
- package/components/calendar/lib/utils/index.d.ts +1 -0
- package/components/calendar/lib/utils/validate-daterange.d.ts +1 -0
- package/components/daterangepicker/README.md +3 -0
- package/components/daterangepicker/index.d.ts +7 -0
- package/components/daterangepicker/lib/daterangepicker.component.d.ts +40 -0
- package/components/daterangepicker/lib/daterangepicker.config.d.ts +29 -0
- package/components/daterangepicker/lib/daterangepicker.module.d.ts +11 -0
- package/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.d.ts +25 -0
- package/components/daterangepicker/lib/directives/index.d.ts +1 -0
- package/components/daterangepicker/lib/models/daterangepicker-input-date-order.d.ts +1 -0
- package/components/daterangepicker/lib/models/daterangepicker-input-pattern.d.ts +1 -0
- package/components/daterangepicker/lib/models/index.d.ts +2 -0
- package/components/daterangepicker/lib/range.validator.d.ts +10 -0
- package/components/daterangepicker/lib/required.validator.d.ts +10 -0
- package/components/daterangepicker/lib/utils/get-daterangepicker-input-pattern.d.ts +3 -0
- package/components/daterangepicker/lib/utils/get-daterangepicker-input-value-as-date.d.ts +2 -0
- package/components/daterangepicker/lib/utils/index.d.ts +2 -0
- package/components/list/index.d.ts +1 -0
- package/components/list/lib/components/list-item/list-item.component.d.ts +6 -1
- package/components/list/lib/models/index.d.ts +1 -0
- package/components/list/lib/models/list-item-variant.d.ts +6 -0
- package/esm2022/cdk/active-indicator/lib/active-indicator.directive.mjs +2 -2
- package/esm2022/components/calendar/lib/calendar.component.mjs +25 -11
- package/esm2022/components/calendar/lib/calendar.config.mjs +3 -1
- package/esm2022/components/calendar/lib/calendar.service.mjs +28 -13
- package/esm2022/components/calendar/lib/components/calendar-month/calendar-month.component.mjs +6 -10
- package/esm2022/components/calendar/lib/components/calendar-year/calendar-year.component.mjs +4 -4
- package/esm2022/components/calendar/lib/components/calendar-years/calendar-years.component.mjs +4 -4
- package/esm2022/components/calendar/lib/daterange.service.mjs +57 -0
- package/esm2022/components/calendar/lib/directives/calendar-cell.directive.mjs +85 -5
- package/esm2022/components/calendar/lib/directives/calendar-view.directive.mjs +8 -2
- package/esm2022/components/calendar/lib/models/date-range.mjs +7 -0
- package/esm2022/components/calendar/lib/models/index.mjs +4 -1
- package/esm2022/components/calendar/lib/models/selected-date.mjs +5 -0
- package/esm2022/components/calendar/lib/models/selection-mode.mjs +6 -0
- package/esm2022/components/calendar/lib/services/calendar-month.service.mjs +1 -1
- package/esm2022/components/calendar/lib/utils/check-cell-in-range.mjs +28 -0
- package/esm2022/components/calendar/lib/utils/index.mjs +2 -1
- package/esm2022/components/calendar/lib/utils/validate-daterange.mjs +5 -0
- package/esm2022/components/datepicker/lib/datepicker.component.mjs +2 -2
- package/esm2022/components/daterangepicker/index.mjs +8 -0
- package/esm2022/components/daterangepicker/lib/daterangepicker.component.mjs +174 -0
- package/esm2022/components/daterangepicker/lib/daterangepicker.config.mjs +7 -0
- package/esm2022/components/daterangepicker/lib/daterangepicker.module.mjs +21 -0
- package/esm2022/components/daterangepicker/lib/directives/daterangepicker-input-control.directive.mjs +65 -0
- package/esm2022/components/daterangepicker/lib/directives/index.mjs +2 -0
- package/esm2022/components/daterangepicker/lib/models/daterangepicker-input-date-order.mjs +2 -0
- package/esm2022/components/daterangepicker/lib/models/daterangepicker-input-pattern.mjs +2 -0
- package/esm2022/components/daterangepicker/lib/models/index.mjs +3 -0
- package/esm2022/components/daterangepicker/lib/range.validator.mjs +37 -0
- package/esm2022/components/daterangepicker/lib/required.validator.mjs +34 -0
- package/esm2022/components/daterangepicker/lib/utils/get-daterangepicker-input-pattern.mjs +16 -0
- package/esm2022/components/daterangepicker/lib/utils/get-daterangepicker-input-value-as-date.mjs +30 -0
- package/esm2022/components/daterangepicker/lib/utils/index.mjs +3 -0
- package/esm2022/components/daterangepicker/odx-angular-components-daterangepicker.mjs +5 -0
- package/esm2022/components/list/index.mjs +2 -1
- package/esm2022/components/list/lib/components/list-item/list-item.component.mjs +13 -2
- package/esm2022/components/list/lib/models/index.mjs +2 -0
- package/esm2022/components/list/lib/models/list-item-variant.mjs +6 -0
- package/esm2022/components/notification/lib/components/notification-center/notification-center.component.mjs +2 -2
- package/esm2022/utils/lib/helpers/event-manager.mjs +27 -8
- package/fesm2022/odx-angular-cdk-active-indicator.mjs.map +1 -1
- package/fesm2022/odx-angular-components-calendar.mjs +261 -56
- package/fesm2022/odx-angular-components-calendar.mjs.map +1 -1
- package/fesm2022/odx-angular-components-datepicker.mjs +1 -1
- package/fesm2022/odx-angular-components-datepicker.mjs.map +1 -1
- package/fesm2022/odx-angular-components-daterangepicker.mjs +364 -0
- package/fesm2022/odx-angular-components-daterangepicker.mjs.map +1 -0
- package/fesm2022/odx-angular-components-list.mjs +18 -2
- package/fesm2022/odx-angular-components-list.mjs.map +1 -1
- package/fesm2022/odx-angular-components-notification.mjs +1 -1
- package/fesm2022/odx-angular-components-notification.mjs.map +1 -1
- package/fesm2022/odx-angular-utils.mjs +33 -16
- package/fesm2022/odx-angular-utils.mjs.map +1 -1
- package/package.json +7 -1
- package/utils/lib/helpers/event-manager.d.ts +3 -1
|
@@ -1,21 +1,48 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { EventEmitter, Injectable, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, Pipe, inject, Directive } from '@angular/core';
|
|
5
5
|
import * as i2 from '@odx/angular';
|
|
6
6
|
import { CoreModule, DisabledController } from '@odx/angular';
|
|
7
7
|
import { CSSComponent, CSSModifier } from '@odx/angular/internal';
|
|
8
|
-
import { isString, isPresent, injectElement, hasChanged,
|
|
9
|
-
import {
|
|
10
|
-
import { BehaviorSubject,
|
|
8
|
+
import { createConfigTokens, isString, isPresent, injectElement, hasChanged, EventManager, deferFn, untilDestroyed, trackByIndex, isFunction } from '@odx/angular/utils';
|
|
9
|
+
import { enGB } from 'date-fns/locale';
|
|
10
|
+
import { BehaviorSubject, shareReplay, map, filter, distinctUntilChanged, merge, defer, of, withLatestFrom } from 'rxjs';
|
|
11
|
+
import { isSameDay, isSameMonth, isSameYear, endOfDay, endOfMonth, endOfYear, startOfDay, startOfMonth, startOfYear, isValid, toDate, isBefore, isEqual, addMonths, subMonths, format, isWithinInterval, startOfWeek, addDays, endOfWeek, eachMonthOfInterval, addYears, getYear, setYear, subDays, subWeeks, addWeeks, setMonth, getMonth } from 'date-fns';
|
|
11
12
|
import { ActionGroupComponent } from '@odx/angular/components/action-group';
|
|
12
13
|
import { ButtonComponent } from '@odx/angular/components/button';
|
|
13
14
|
import { IconComponent } from '@odx/angular/components/icon';
|
|
14
|
-
import { enGB } from 'date-fns/locale';
|
|
15
15
|
import * as i1 from '@angular/common';
|
|
16
16
|
import { DOCUMENT } from '@angular/common';
|
|
17
17
|
import * as i3 from '@ngrx/component';
|
|
18
18
|
|
|
19
|
+
var CalendarSelectionMode;
|
|
20
|
+
(function (CalendarSelectionMode) {
|
|
21
|
+
CalendarSelectionMode[CalendarSelectionMode["Date"] = 0] = "Date";
|
|
22
|
+
CalendarSelectionMode[CalendarSelectionMode["DateRange"] = 1] = "DateRange";
|
|
23
|
+
})(CalendarSelectionMode || (CalendarSelectionMode = {}));
|
|
24
|
+
|
|
25
|
+
const { CalendarConfig, CalendarDefaultConfig, injectCalendarConfig, provideCalendarConfig } = createConfigTokens('Calendar', '@odx/angular/components/calendar', {
|
|
26
|
+
monthYearLabel: 'LLLL yyyy',
|
|
27
|
+
monthLabel: 'LLL',
|
|
28
|
+
weekLabel: 'EEEEE',
|
|
29
|
+
dayLabel: 'd',
|
|
30
|
+
yearLabel: 'yyyy',
|
|
31
|
+
dayA11yLabel: 'MMMM dd, yyyy',
|
|
32
|
+
monthA11yLabel: 'MMMM, yyyy',
|
|
33
|
+
yearA11yLabel: 'yyyy',
|
|
34
|
+
displayAdjacentDays: true,
|
|
35
|
+
locale: new BehaviorSubject(enGB),
|
|
36
|
+
selectionMode: CalendarSelectionMode.Date,
|
|
37
|
+
yearView: {
|
|
38
|
+
itemsPerRow: 3,
|
|
39
|
+
},
|
|
40
|
+
yearsView: {
|
|
41
|
+
itemsPerRow: 3,
|
|
42
|
+
padding: 100,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
19
46
|
var CalendarView;
|
|
20
47
|
(function (CalendarView) {
|
|
21
48
|
CalendarView["Month"] = "month";
|
|
@@ -23,6 +50,18 @@ var CalendarView;
|
|
|
23
50
|
CalendarView["Years"] = "years";
|
|
24
51
|
})(CalendarView || (CalendarView = {}));
|
|
25
52
|
|
|
53
|
+
var DateRangeSelectionState;
|
|
54
|
+
(function (DateRangeSelectionState) {
|
|
55
|
+
DateRangeSelectionState["NothingSelected"] = "NothingSelected";
|
|
56
|
+
DateRangeSelectionState["StartSelected"] = "StartSelected";
|
|
57
|
+
DateRangeSelectionState["EndSelected"] = "EndSelected";
|
|
58
|
+
})(DateRangeSelectionState || (DateRangeSelectionState = {}));
|
|
59
|
+
|
|
60
|
+
const dateSelectOptionsDefaults = {
|
|
61
|
+
skipDaterangeUpdate: false,
|
|
62
|
+
emitOutside: false,
|
|
63
|
+
};
|
|
64
|
+
|
|
26
65
|
const dateValidators$4 = {
|
|
27
66
|
[CalendarView.Month]: (currentDate, date) => isSameDay(currentDate, date),
|
|
28
67
|
[CalendarView.Year]: (currentDate, date) => isSameMonth(currentDate, date),
|
|
@@ -79,6 +118,10 @@ function parseDate(value) {
|
|
|
79
118
|
}
|
|
80
119
|
}
|
|
81
120
|
|
|
121
|
+
function validateDaterange(start, end) {
|
|
122
|
+
return isBefore(start, end) || isEqual(start, end);
|
|
123
|
+
}
|
|
124
|
+
|
|
82
125
|
const dateValidators$1 = {
|
|
83
126
|
[CalendarView.Month]: (maxDate, date) => maxDate < startOfMonth(addMonths(date, 1)),
|
|
84
127
|
[CalendarView.Year]: (maxDate, date) => maxDate < startOfYear(addMonths(date, 12)),
|
|
@@ -99,21 +142,36 @@ function validatePreviousDateSet(minDate, date, calendarView) {
|
|
|
99
142
|
|
|
100
143
|
class CalendarService {
|
|
101
144
|
constructor() {
|
|
145
|
+
this.activeDate$$ = new BehaviorSubject(null); // the date that is being focused by click or arrow keys
|
|
146
|
+
this.hoveredDate$$ = new BehaviorSubject(null); // the date that is being hovered by a pointing device
|
|
102
147
|
this.calendarView$$ = new BehaviorSubject(CalendarView.Month);
|
|
103
|
-
this.
|
|
104
|
-
|
|
148
|
+
this.dateSelectEvents$$ = new BehaviorSubject({
|
|
149
|
+
date: null,
|
|
150
|
+
options: dateSelectOptionsDefaults,
|
|
151
|
+
});
|
|
152
|
+
this.outputDate$ = new EventEmitter();
|
|
105
153
|
this.calendarView$ = this.calendarView$$.pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
154
|
+
this.dateSelectEvents$ = this.dateSelectEvents$$.asObservable();
|
|
155
|
+
this.selectedDate$ = this.dateSelectEvents$$.pipe(map((x) => x.date), shareReplay({ bufferSize: 1, refCount: true }));
|
|
156
|
+
this.activeDate$ = this.activeDate$$.pipe(filter(Boolean), distinctUntilChanged((prev, curr) => isEqual(prev, curr)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
157
|
+
this.previewDate$ = merge(this.activeDate$$, this.hoveredDate$$).pipe(filter(Boolean), distinctUntilChanged((prev, curr) => isEqual(prev, curr)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
108
158
|
}
|
|
109
159
|
setActiveDate(value) {
|
|
110
160
|
if (!isPresent(value))
|
|
111
161
|
return;
|
|
112
162
|
this.activeDate$$.next(parseDate(value));
|
|
113
163
|
}
|
|
114
|
-
|
|
164
|
+
setHoveredDate(value) {
|
|
165
|
+
if (!isPresent(value))
|
|
166
|
+
return;
|
|
167
|
+
this.hoveredDate$$.next(parseDate(value));
|
|
168
|
+
}
|
|
169
|
+
selectDate(value, options) {
|
|
115
170
|
const date = isPresent(value) ? startOfDay(parseDate(value)) : null;
|
|
116
|
-
this.
|
|
171
|
+
this.dateSelectEvents$$.next({ date, options: { ...dateSelectOptionsDefaults, ...options } });
|
|
172
|
+
if (options?.emitOutside) {
|
|
173
|
+
this.outputDate$.next(date);
|
|
174
|
+
}
|
|
117
175
|
this.setActiveDate(date);
|
|
118
176
|
}
|
|
119
177
|
changeView(view) {
|
|
@@ -178,26 +236,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
178
236
|
type: Output
|
|
179
237
|
}] } });
|
|
180
238
|
|
|
181
|
-
const { CalendarConfig, CalendarDefaultConfig, injectCalendarConfig, provideCalendarConfig } = createConfigTokens('Calendar', '@odx/angular/components/calendar', {
|
|
182
|
-
monthYearLabel: 'LLLL yyyy',
|
|
183
|
-
monthLabel: 'LLL',
|
|
184
|
-
weekLabel: 'EEEEE',
|
|
185
|
-
dayLabel: 'd',
|
|
186
|
-
yearLabel: 'yyyy',
|
|
187
|
-
dayA11yLabel: 'MMMM dd, yyyy',
|
|
188
|
-
monthA11yLabel: 'MMMM, yyyy',
|
|
189
|
-
yearA11yLabel: 'yyyy',
|
|
190
|
-
displayAdjacentDays: true,
|
|
191
|
-
locale: new BehaviorSubject(enGB),
|
|
192
|
-
yearView: {
|
|
193
|
-
itemsPerRow: 3,
|
|
194
|
-
},
|
|
195
|
-
yearsView: {
|
|
196
|
-
itemsPerRow: 3,
|
|
197
|
-
padding: 100,
|
|
198
|
-
},
|
|
199
|
-
});
|
|
200
|
-
|
|
201
239
|
class DateLabelPipe {
|
|
202
240
|
constructor() {
|
|
203
241
|
this.config = injectCalendarConfig();
|
|
@@ -219,9 +257,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
219
257
|
}]
|
|
220
258
|
}] });
|
|
221
259
|
|
|
260
|
+
function checkCellInRange(date, dateRangeState, calendarView, targetSelectionState) {
|
|
261
|
+
const { start, end } = dateRangeState.dateRange;
|
|
262
|
+
if (calendarView !== CalendarView.Month || dateRangeState.selectionState !== targetSelectionState || (start && end && !validateDaterange(start, end))) {
|
|
263
|
+
return {
|
|
264
|
+
isRangeStart: false,
|
|
265
|
+
isRangeEnd: false,
|
|
266
|
+
isInRange: false,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
const isRangeStart = start ? isSameDay(date, start) : false;
|
|
270
|
+
const isRangeEnd = end ? isSameDay(date, end) : false;
|
|
271
|
+
return {
|
|
272
|
+
isRangeStart,
|
|
273
|
+
isRangeEnd,
|
|
274
|
+
isInRange: isRangeEnd || isRangeStart || isWithinInclusiveRange(date, { start, end }),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function isWithinInclusiveRange(date, dateRange) {
|
|
278
|
+
const { start, end } = dateRange;
|
|
279
|
+
if (!start || !end) {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
return isWithinInterval(date, { start, end });
|
|
283
|
+
}
|
|
284
|
+
|
|
222
285
|
let CalendarCellDirective = class CalendarCellDirective {
|
|
223
286
|
constructor() {
|
|
224
287
|
this.disabledController = DisabledController.inject();
|
|
288
|
+
this.eventManager = inject(EventManager);
|
|
289
|
+
this.calendarService = inject(CalendarService);
|
|
290
|
+
this.registeredEventId = '';
|
|
225
291
|
this.config = injectCalendarConfig();
|
|
226
292
|
this.dateLabelPipe = inject(DateLabelPipe);
|
|
227
293
|
this.isActive = false;
|
|
@@ -230,9 +296,17 @@ let CalendarCellDirective = class CalendarCellDirective {
|
|
|
230
296
|
this.ariaLabel = '';
|
|
231
297
|
this.isCurrent = false;
|
|
232
298
|
this.adjacent = false;
|
|
299
|
+
this.isInRange = false;
|
|
300
|
+
this.isRangeStart = false;
|
|
301
|
+
this.isRangeEnd = false;
|
|
302
|
+
this.isInPreviewRange = false;
|
|
303
|
+
this.isPreviewRangeStart = false;
|
|
304
|
+
this.isPreviewRangeEnd = false;
|
|
233
305
|
this.element = injectElement();
|
|
234
306
|
this.activeDate = null;
|
|
235
307
|
this.selectedDate = null;
|
|
308
|
+
this.selectedDateRange = null;
|
|
309
|
+
this.previewDate = null;
|
|
236
310
|
}
|
|
237
311
|
get isDisabled() {
|
|
238
312
|
return !!this.disabledController?.disabled;
|
|
@@ -252,12 +326,48 @@ let CalendarCellDirective = class CalendarCellDirective {
|
|
|
252
326
|
if (this.selectedDate && hasChanged(changes, ['date', 'selectedDate'], false)) {
|
|
253
327
|
this.isSelected = checkIdenticalDate(this.date, this.selectedDate, this.calendarView);
|
|
254
328
|
}
|
|
329
|
+
if (this.config.selectionMode === CalendarSelectionMode.DateRange && this.selectedDateRange && hasChanged(changes, ['date', 'selectedDateRange'], false)) {
|
|
330
|
+
const start = this.selectedDateRange.dateRange.start;
|
|
331
|
+
this.isSelected = checkIdenticalDate(this.date, start || new Date(), this.calendarView);
|
|
332
|
+
const rangeValidation = checkCellInRange(this.date, this.selectedDateRange, this.calendarView, DateRangeSelectionState.EndSelected);
|
|
333
|
+
this.isRangeStart = rangeValidation.isRangeStart;
|
|
334
|
+
this.isRangeEnd = rangeValidation.isRangeEnd;
|
|
335
|
+
this.isInRange = rangeValidation.isInRange;
|
|
336
|
+
}
|
|
337
|
+
if (this.config.selectionMode === CalendarSelectionMode.DateRange &&
|
|
338
|
+
this.previewDate &&
|
|
339
|
+
this.selectedDateRange &&
|
|
340
|
+
hasChanged(changes, ['date', 'selectedDateRange', 'previewDate'])) {
|
|
341
|
+
const previewRange = {
|
|
342
|
+
selectionState: this.selectedDateRange.selectionState,
|
|
343
|
+
dateRange: { start: this.selectedDateRange.dateRange.start, end: this.previewDate },
|
|
344
|
+
};
|
|
345
|
+
const rangeValidation = checkCellInRange(this.date, previewRange, this.calendarView, DateRangeSelectionState.StartSelected);
|
|
346
|
+
this.isPreviewRangeStart = rangeValidation.isRangeStart;
|
|
347
|
+
this.isPreviewRangeEnd = rangeValidation.isRangeEnd;
|
|
348
|
+
this.isInPreviewRange = rangeValidation.isInRange;
|
|
349
|
+
}
|
|
255
350
|
if (this.isActive) {
|
|
256
351
|
deferFn(() => this.element.nativeElement.focus());
|
|
257
352
|
}
|
|
258
353
|
}
|
|
354
|
+
ngOnInit() {
|
|
355
|
+
if (this.config.selectionMode === CalendarSelectionMode.DateRange && this.calendarView === CalendarView.Month) {
|
|
356
|
+
this.registerEvents();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
ngOnDestroy() {
|
|
360
|
+
this.eventManager.destroyListener(this.registeredEventId);
|
|
361
|
+
}
|
|
362
|
+
registerEvents() {
|
|
363
|
+
this.registeredEventId = this.eventManager.register(['mouseover'], (event) => {
|
|
364
|
+
event?.preventDefault();
|
|
365
|
+
event?.stopPropagation();
|
|
366
|
+
this.calendarService.setHoveredDate(this.date);
|
|
367
|
+
}, this.element.nativeElement)[0];
|
|
368
|
+
}
|
|
259
369
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
260
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CalendarCellDirective, isStandalone: true, selector: "[odxCalendarCell]", inputs: { date: ["odxCalendarCell", "date"], calendarView: ["odxCalendarCellCalendarView", "calendarView"], activeDate: ["odxCalendarCellActiveDate", "activeDate"], selectedDate: ["odxCalendarCellSelectedDate", "selectedDate"] }, host: { properties: { "class.is-disabled": "isDisabled", "class.is-selected": "isSelected", "attr.hidden": "isHidden || null", "tabindex": "isActive ? 0 : -1", "attr.aria-label": "ariaLabel", "attr.aria-disabled": "isDisabled", "attr.type": "\"button\"" } }, providers: [DisabledController.connect(), DateLabelPipe], usesOnChanges: true, ngImport: i0 }); }
|
|
370
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CalendarCellDirective, isStandalone: true, selector: "[odxCalendarCell]", inputs: { date: ["odxCalendarCell", "date"], calendarView: ["odxCalendarCellCalendarView", "calendarView"], activeDate: ["odxCalendarCellActiveDate", "activeDate"], selectedDate: ["odxCalendarCellSelectedDate", "selectedDate"], selectedDateRange: ["odxCalendarCellSelectedDateRange", "selectedDateRange"], previewDate: ["odxCalendarCellPreviewDate", "previewDate"] }, host: { properties: { "class.is-disabled": "isDisabled", "class.is-selected": "isSelected", "class.is-in-any-range": "isInRange || isInPreviewRange", "attr.hidden": "isHidden || null", "tabindex": "isActive ? 0 : -1", "attr.aria-label": "ariaLabel", "attr.aria-disabled": "isDisabled", "attr.type": "\"button\"" } }, providers: [DisabledController.connect(), DateLabelPipe], usesOnChanges: true, ngImport: i0 }); }
|
|
261
371
|
};
|
|
262
372
|
__decorate([
|
|
263
373
|
CSSModifier(),
|
|
@@ -267,6 +377,30 @@ __decorate([
|
|
|
267
377
|
CSSModifier(),
|
|
268
378
|
__metadata("design:type", Object)
|
|
269
379
|
], CalendarCellDirective.prototype, "adjacent", void 0);
|
|
380
|
+
__decorate([
|
|
381
|
+
CSSModifier(),
|
|
382
|
+
__metadata("design:type", Object)
|
|
383
|
+
], CalendarCellDirective.prototype, "isInRange", void 0);
|
|
384
|
+
__decorate([
|
|
385
|
+
CSSModifier(),
|
|
386
|
+
__metadata("design:type", Object)
|
|
387
|
+
], CalendarCellDirective.prototype, "isRangeStart", void 0);
|
|
388
|
+
__decorate([
|
|
389
|
+
CSSModifier(),
|
|
390
|
+
__metadata("design:type", Object)
|
|
391
|
+
], CalendarCellDirective.prototype, "isRangeEnd", void 0);
|
|
392
|
+
__decorate([
|
|
393
|
+
CSSModifier(),
|
|
394
|
+
__metadata("design:type", Object)
|
|
395
|
+
], CalendarCellDirective.prototype, "isInPreviewRange", void 0);
|
|
396
|
+
__decorate([
|
|
397
|
+
CSSModifier(),
|
|
398
|
+
__metadata("design:type", Object)
|
|
399
|
+
], CalendarCellDirective.prototype, "isPreviewRangeStart", void 0);
|
|
400
|
+
__decorate([
|
|
401
|
+
CSSModifier(),
|
|
402
|
+
__metadata("design:type", Object)
|
|
403
|
+
], CalendarCellDirective.prototype, "isPreviewRangeEnd", void 0);
|
|
270
404
|
CalendarCellDirective = __decorate([
|
|
271
405
|
CSSComponent('calendar-cell')
|
|
272
406
|
], CalendarCellDirective);
|
|
@@ -279,6 +413,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
279
413
|
host: {
|
|
280
414
|
'[class.is-disabled]': 'isDisabled',
|
|
281
415
|
'[class.is-selected]': 'isSelected',
|
|
416
|
+
'[class.is-in-any-range]': 'isInRange || isInPreviewRange',
|
|
282
417
|
'[attr.hidden]': 'isHidden || null',
|
|
283
418
|
'[tabindex]': 'isActive ? 0 : -1',
|
|
284
419
|
'[attr.aria-label]': 'ariaLabel',
|
|
@@ -286,7 +421,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
286
421
|
'[attr.type]': '"button"',
|
|
287
422
|
},
|
|
288
423
|
}]
|
|
289
|
-
}], propDecorators: { isCurrent: [], adjacent: [], date: [{
|
|
424
|
+
}], propDecorators: { isCurrent: [], adjacent: [], isInRange: [], isRangeStart: [], isRangeEnd: [], isInPreviewRange: [], isPreviewRangeStart: [], isPreviewRangeEnd: [], date: [{
|
|
290
425
|
type: Input,
|
|
291
426
|
args: ['odxCalendarCell']
|
|
292
427
|
}], calendarView: [{
|
|
@@ -298,6 +433,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
298
433
|
}], selectedDate: [{
|
|
299
434
|
type: Input,
|
|
300
435
|
args: ['odxCalendarCellSelectedDate']
|
|
436
|
+
}], selectedDateRange: [{
|
|
437
|
+
type: Input,
|
|
438
|
+
args: ['odxCalendarCellSelectedDateRange']
|
|
439
|
+
}], previewDate: [{
|
|
440
|
+
type: Input,
|
|
441
|
+
args: ['odxCalendarCellPreviewDate']
|
|
301
442
|
}] } });
|
|
302
443
|
|
|
303
444
|
class CalendarViewDirective {
|
|
@@ -308,6 +449,8 @@ class CalendarViewDirective {
|
|
|
308
449
|
this.trackByIndex = trackByIndex;
|
|
309
450
|
this.element = injectElement();
|
|
310
451
|
this.selectedDate = null;
|
|
452
|
+
this.selectedDateRange = null;
|
|
453
|
+
this.previewDate = null;
|
|
311
454
|
this.minDate = null;
|
|
312
455
|
this.maxDate = null;
|
|
313
456
|
this.filterFn = null;
|
|
@@ -324,7 +467,7 @@ class CalendarViewDirective {
|
|
|
324
467
|
this.calendar.setActiveDate(date);
|
|
325
468
|
}
|
|
326
469
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
327
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CalendarViewDirective, isStandalone: true, inputs: { activeDate: "activeDate", selectedDate: "selectedDate", minDate: "minDate", maxDate: "maxDate", filterFn: "filterFn" }, ngImport: i0 }); }
|
|
470
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CalendarViewDirective, isStandalone: true, inputs: { activeDate: "activeDate", selectedDate: "selectedDate", selectedDateRange: "selectedDateRange", previewDate: "previewDate", minDate: "minDate", maxDate: "maxDate", filterFn: "filterFn" }, ngImport: i0 }); }
|
|
328
471
|
}
|
|
329
472
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarViewDirective, decorators: [{
|
|
330
473
|
type: Directive,
|
|
@@ -335,6 +478,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
335
478
|
type: Input
|
|
336
479
|
}], selectedDate: [{
|
|
337
480
|
type: Input
|
|
481
|
+
}], selectedDateRange: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], previewDate: [{
|
|
484
|
+
type: Input
|
|
338
485
|
}], minDate: [{
|
|
339
486
|
type: Input
|
|
340
487
|
}], maxDate: [{
|
|
@@ -440,7 +587,6 @@ let CalendarMonthComponent = class CalendarMonthComponent extends CalendarViewDi
|
|
|
440
587
|
this.calendarMonth = inject(CalendarMonthService);
|
|
441
588
|
this.nextView = CalendarView.Years;
|
|
442
589
|
this.currentView = CalendarView.Month;
|
|
443
|
-
this.selectedChange = new EventEmitter();
|
|
444
590
|
}
|
|
445
591
|
previousDay(event) {
|
|
446
592
|
this.updateActiveDate(event, subDays(this.activeDate, 1));
|
|
@@ -463,21 +609,18 @@ let CalendarMonthComponent = class CalendarMonthComponent extends CalendarViewDi
|
|
|
463
609
|
selectDate(value) {
|
|
464
610
|
if (this.isDateDisabled(value))
|
|
465
611
|
return;
|
|
466
|
-
this.calendar.selectDate(value);
|
|
467
|
-
this.selectedChange.emit(value);
|
|
612
|
+
this.calendar.selectDate(value, { emitOutside: true });
|
|
468
613
|
}
|
|
469
614
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarMonthComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
470
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarMonthComponent, isStandalone: true, selector: "odx-calendar-month",
|
|
615
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarMonthComponent, isStandalone: true, selector: "odx-calendar-month", providers: [CalendarMonthService], usesInheritance: true, ngImport: i0, template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"7\">\n <odx-calendar-header\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (previous)=\"previousMonth($event)\"\n (next)=\"nextMonth($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.monthYearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n\n <tr class=\"odx-calendar__weekdays\">\n <td *ngFor=\"let day of calendarMonth.weekDays$ | async\">\n {{ day | odxDateLabel: config.weekLabel }}\n </td>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousDay($event)\"\n (keydown.ArrowRight)=\"nextDay($event)\"\n (keydown.ArrowUp)=\"previousWeek($event)\"\n (keydown.ArrowDown)=\"nextWeek($event)\"\n (keydown.PageUp)=\"previousMonth($event)\"\n (keydown.PageDown)=\"nextMonth($event)\"\n >\n <tr *ngFor=\"let week of calendarMonth.weeks$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let day of week; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(day)\"\n [odxCalendarCell]=\"day\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n [odxCalendarCellSelectedDateRange]=\"selectedDateRange\"\n [odxCalendarCellPreviewDate]=\"previewDate\"\n (click)=\"selectDate(day)\"\n >\n {{ day | odxDateLabel: config.dayLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i2.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: CalendarCellDirective, selector: "[odxCalendarCell]", inputs: ["odxCalendarCell", "odxCalendarCellCalendarView", "odxCalendarCellActiveDate", "odxCalendarCellSelectedDate", "odxCalendarCellSelectedDateRange", "odxCalendarCellPreviewDate"] }, { kind: "component", type: CalendarHeaderComponent, selector: "odx-calendar-header", inputs: ["activeDate", "calendarView", "minDate", "maxDate"], outputs: ["previous", "next", "changeView"] }, { kind: "pipe", type: DateLabelPipe, name: "odxDateLabel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
471
616
|
};
|
|
472
617
|
CalendarMonthComponent = __decorate([
|
|
473
618
|
CSSComponent('calendar-month')
|
|
474
619
|
], CalendarMonthComponent);
|
|
475
620
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarMonthComponent, decorators: [{
|
|
476
621
|
type: Component,
|
|
477
|
-
args: [{ selector: 'odx-calendar-month', standalone: true, imports: [CoreModule, CalendarCellDirective, CalendarHeaderComponent, DateLabelPipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarMonthService], template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"7\">\n <odx-calendar-header\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (previous)=\"previousMonth($event)\"\n (next)=\"nextMonth($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.monthYearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n\n <tr class=\"odx-calendar__weekdays\">\n <td *ngFor=\"let day of calendarMonth.weekDays$ | async\">\n {{ day | odxDateLabel: config.weekLabel }}\n </td>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousDay($event)\"\n (keydown.ArrowRight)=\"nextDay($event)\"\n (keydown.ArrowUp)=\"previousWeek($event)\"\n (keydown.ArrowDown)=\"nextWeek($event)\"\n (keydown.PageUp)=\"previousMonth($event)\"\n (keydown.PageDown)=\"nextMonth($event)\"\n >\n <tr *ngFor=\"let week of calendarMonth.weeks$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let day of week; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(day)\"\n [odxCalendarCell]=\"day\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n (click)=\"selectDate(day)\"\n >\n {{ day | odxDateLabel: config.dayLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
|
|
478
|
-
}]
|
|
479
|
-
type: Output
|
|
480
|
-
}] } });
|
|
622
|
+
args: [{ selector: 'odx-calendar-month', standalone: true, imports: [CoreModule, CalendarCellDirective, CalendarHeaderComponent, DateLabelPipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarMonthService], template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"7\">\n <odx-calendar-header\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (previous)=\"previousMonth($event)\"\n (next)=\"nextMonth($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.monthYearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n\n <tr class=\"odx-calendar__weekdays\">\n <td *ngFor=\"let day of calendarMonth.weekDays$ | async\">\n {{ day | odxDateLabel: config.weekLabel }}\n </td>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousDay($event)\"\n (keydown.ArrowRight)=\"nextDay($event)\"\n (keydown.ArrowUp)=\"previousWeek($event)\"\n (keydown.ArrowDown)=\"nextWeek($event)\"\n (keydown.PageUp)=\"previousMonth($event)\"\n (keydown.PageDown)=\"nextMonth($event)\"\n >\n <tr *ngFor=\"let week of calendarMonth.weeks$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let day of week; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(day)\"\n [odxCalendarCell]=\"day\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n [odxCalendarCellSelectedDateRange]=\"selectedDateRange\"\n [odxCalendarCellPreviewDate]=\"previewDate\"\n (click)=\"selectDate(day)\"\n >\n {{ day | odxDateLabel: config.dayLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
|
|
623
|
+
}] });
|
|
481
624
|
|
|
482
625
|
let CalendarYearComponent = class CalendarYearComponent extends CalendarViewDirective {
|
|
483
626
|
constructor() {
|
|
@@ -508,18 +651,18 @@ let CalendarYearComponent = class CalendarYearComponent extends CalendarViewDire
|
|
|
508
651
|
if (this.isDateDisabled(value))
|
|
509
652
|
return;
|
|
510
653
|
const date = setMonth(this.activeDate, getMonth(value));
|
|
511
|
-
this.calendar.selectDate(date);
|
|
654
|
+
this.calendar.selectDate(date, { skipDaterangeUpdate: true });
|
|
512
655
|
this.changeView();
|
|
513
656
|
}
|
|
514
657
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarYearComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
515
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarYearComponent, isStandalone: true, selector: "odx-calendar-year", providers: [CalendarYearService], usesInheritance: true, ngImport: i0, template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"3\">\n <odx-calendar-header\n (previous)=\"previousYear($event)\"\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (next)=\"nextYear($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.yearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousMonth($event)\"\n (keydown.ArrowRight)=\"nextMonth($event)\"\n (keydown.ArrowUp)=\"previousSeason($event)\"\n (keydown.ArrowDown)=\"nextSeason($event)\"\n (keydown.PageDown)=\"nextYear($event)\"\n (keydown.PageUp)=\"previousYear($event)\"\n >\n <tr class=\"odx-calendar__season\" *ngFor=\"let season of calendarYear.seasons$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let month of season; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(month)\"\n [odxCalendarCell]=\"month\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n (click)=\"selectDate(month)\"\n >\n {{ month | odxDateLabel: config.monthLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i2.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: CalendarCellDirective, selector: "[odxCalendarCell]", inputs: ["odxCalendarCell", "odxCalendarCellCalendarView", "odxCalendarCellActiveDate", "odxCalendarCellSelectedDate"] }, { kind: "component", type: CalendarHeaderComponent, selector: "odx-calendar-header", inputs: ["activeDate", "calendarView", "minDate", "maxDate"], outputs: ["previous", "next", "changeView"] }, { kind: "pipe", type: DateLabelPipe, name: "odxDateLabel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
658
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarYearComponent, isStandalone: true, selector: "odx-calendar-year", providers: [CalendarYearService], usesInheritance: true, ngImport: i0, template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"3\">\n <odx-calendar-header\n (previous)=\"previousYear($event)\"\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (next)=\"nextYear($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.yearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousMonth($event)\"\n (keydown.ArrowRight)=\"nextMonth($event)\"\n (keydown.ArrowUp)=\"previousSeason($event)\"\n (keydown.ArrowDown)=\"nextSeason($event)\"\n (keydown.PageDown)=\"nextYear($event)\"\n (keydown.PageUp)=\"previousYear($event)\"\n >\n <tr class=\"odx-calendar__season\" *ngFor=\"let season of calendarYear.seasons$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let month of season; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(month)\"\n [odxCalendarCell]=\"month\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n [odxCalendarCellSelectedDateRange]=\"selectedDateRange\"\n (click)=\"selectDate(month)\"\n >\n {{ month | odxDateLabel: config.monthLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i2.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: CalendarCellDirective, selector: "[odxCalendarCell]", inputs: ["odxCalendarCell", "odxCalendarCellCalendarView", "odxCalendarCellActiveDate", "odxCalendarCellSelectedDate", "odxCalendarCellSelectedDateRange", "odxCalendarCellPreviewDate"] }, { kind: "component", type: CalendarHeaderComponent, selector: "odx-calendar-header", inputs: ["activeDate", "calendarView", "minDate", "maxDate"], outputs: ["previous", "next", "changeView"] }, { kind: "pipe", type: DateLabelPipe, name: "odxDateLabel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
516
659
|
};
|
|
517
660
|
CalendarYearComponent = __decorate([
|
|
518
661
|
CSSComponent('calendar-year')
|
|
519
662
|
], CalendarYearComponent);
|
|
520
663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarYearComponent, decorators: [{
|
|
521
664
|
type: Component,
|
|
522
|
-
args: [{ selector: 'odx-calendar-year', standalone: true, imports: [CoreModule, CalendarCellDirective, CalendarHeaderComponent, DateLabelPipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarYearService], template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"3\">\n <odx-calendar-header\n (previous)=\"previousYear($event)\"\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (next)=\"nextYear($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.yearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousMonth($event)\"\n (keydown.ArrowRight)=\"nextMonth($event)\"\n (keydown.ArrowUp)=\"previousSeason($event)\"\n (keydown.ArrowDown)=\"nextSeason($event)\"\n (keydown.PageDown)=\"nextYear($event)\"\n (keydown.PageUp)=\"previousYear($event)\"\n >\n <tr class=\"odx-calendar__season\" *ngFor=\"let season of calendarYear.seasons$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let month of season; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(month)\"\n [odxCalendarCell]=\"month\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n (click)=\"selectDate(month)\"\n >\n {{ month | odxDateLabel: config.monthLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
|
|
665
|
+
args: [{ selector: 'odx-calendar-year', standalone: true, imports: [CoreModule, CalendarCellDirective, CalendarHeaderComponent, DateLabelPipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarYearService], template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\">\n <thead>\n <tr>\n <th colspan=\"3\">\n <odx-calendar-header\n (previous)=\"previousYear($event)\"\n [calendarView]=\"currentView\"\n [activeDate]=\"activeDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (next)=\"nextYear($event)\"\n (changeView)=\"changeView()\"\n >\n {{ activeDate | odxDateLabel: config.yearLabel }}\n </odx-calendar-header>\n </th>\n </tr>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousMonth($event)\"\n (keydown.ArrowRight)=\"nextMonth($event)\"\n (keydown.ArrowUp)=\"previousSeason($event)\"\n (keydown.ArrowDown)=\"nextSeason($event)\"\n (keydown.PageDown)=\"nextYear($event)\"\n (keydown.PageUp)=\"previousYear($event)\"\n >\n <tr class=\"odx-calendar__season\" *ngFor=\"let season of calendarYear.seasons$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let month of season; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(month)\"\n [odxCalendarCell]=\"month\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n [odxCalendarCellSelectedDateRange]=\"selectedDateRange\"\n (click)=\"selectDate(month)\"\n >\n {{ month | odxDateLabel: config.monthLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
|
|
523
666
|
}] });
|
|
524
667
|
|
|
525
668
|
let CalendarYearsComponent = class CalendarYearsComponent extends CalendarViewDirective {
|
|
@@ -549,7 +692,7 @@ let CalendarYearsComponent = class CalendarYearsComponent extends CalendarViewDi
|
|
|
549
692
|
if (this.isDateDisabled(value))
|
|
550
693
|
return;
|
|
551
694
|
const date = setYear(this.activeDate, getYear(value));
|
|
552
|
-
this.calendar.selectDate(date);
|
|
695
|
+
this.calendar.selectDate(date, { skipDaterangeUpdate: true });
|
|
553
696
|
this.changeView();
|
|
554
697
|
}
|
|
555
698
|
scrollCurrentYearIntoView() {
|
|
@@ -561,42 +704,102 @@ let CalendarYearsComponent = class CalendarYearsComponent extends CalendarViewDi
|
|
|
561
704
|
}
|
|
562
705
|
}
|
|
563
706
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarYearsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
564
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarYearsComponent, isStandalone: true, selector: "odx-calendar-years", providers: [CalendarYearsService], usesInheritance: true, ngImport: i0, template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\" *ngrxLet=\"calendar.activeDate$ as activeDate\">\n <thead aria-hidden=\"true\">\n <th></th>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousYear($event)\"\n (keydown.ArrowRight)=\"nextYear($event)\"\n (keydown.ArrowUp)=\"previousRow($event)\"\n (keydown.ArrowDown)=\"nextRow($event)\"\n >\n <tr class=\"odx-calendar__year-row\" *ngFor=\"let yearRow of calendarYears.years$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let year of yearRow; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(year)\"\n [odxCalendarCell]=\"year\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"
|
|
707
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarYearsComponent, isStandalone: true, selector: "odx-calendar-years", providers: [CalendarYearsService], usesInheritance: true, ngImport: i0, template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\" *ngrxLet=\"calendar.activeDate$ as activeDate\">\n <thead aria-hidden=\"true\">\n <th></th>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousYear($event)\"\n (keydown.ArrowRight)=\"nextYear($event)\"\n (keydown.ArrowUp)=\"previousRow($event)\"\n (keydown.ArrowDown)=\"nextRow($event)\"\n >\n <tr class=\"odx-calendar__year-row\" *ngFor=\"let yearRow of calendarYears.years$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let year of yearRow; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(year)\"\n [odxCalendarCell]=\"year\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n [odxCalendarCellSelectedDateRange]=\"selectedDateRange\"\n (click)=\"selectDate(year)\"\n >\n {{ year | odxDateLabel: config.yearLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i2.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: i3.LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { kind: "directive", type: CalendarCellDirective, selector: "[odxCalendarCell]", inputs: ["odxCalendarCell", "odxCalendarCellCalendarView", "odxCalendarCellActiveDate", "odxCalendarCellSelectedDate", "odxCalendarCellSelectedDateRange", "odxCalendarCellPreviewDate"] }, { kind: "pipe", type: DateLabelPipe, name: "odxDateLabel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
565
708
|
};
|
|
566
709
|
CalendarYearsComponent = __decorate([
|
|
567
710
|
CSSComponent('calendar-years')
|
|
568
711
|
], CalendarYearsComponent);
|
|
569
712
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarYearsComponent, decorators: [{
|
|
570
713
|
type: Component,
|
|
571
|
-
args: [{ selector: 'odx-calendar-years', standalone: true, imports: [CoreModule, CalendarCellDirective, CalendarHeaderComponent, DateLabelPipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarYearsService], template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\" *ngrxLet=\"calendar.activeDate$ as activeDate\">\n <thead aria-hidden=\"true\">\n <th></th>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousYear($event)\"\n (keydown.ArrowRight)=\"nextYear($event)\"\n (keydown.ArrowUp)=\"previousRow($event)\"\n (keydown.ArrowDown)=\"nextRow($event)\"\n >\n <tr class=\"odx-calendar__year-row\" *ngFor=\"let yearRow of calendarYears.years$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let year of yearRow; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(year)\"\n [odxCalendarCell]=\"year\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"
|
|
714
|
+
args: [{ selector: 'odx-calendar-years', standalone: true, imports: [CoreModule, CalendarCellDirective, CalendarHeaderComponent, DateLabelPipe], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarYearsService], template: "<table class=\"odx-calendar__table\" role=\"grid\" aria-describedby=\"odx-calendar\" *ngrxLet=\"calendar.activeDate$ as activeDate\">\n <thead aria-hidden=\"true\">\n <th></th>\n </thead>\n\n <tbody\n class=\"odx-calendar__body\"\n (keydown.ArrowLeft)=\"previousYear($event)\"\n (keydown.ArrowRight)=\"nextYear($event)\"\n (keydown.ArrowUp)=\"previousRow($event)\"\n (keydown.ArrowDown)=\"nextRow($event)\"\n >\n <tr class=\"odx-calendar__year-row\" *ngFor=\"let yearRow of calendarYears.years$ | async; trackBy: trackByIndex\">\n <td role=\"gridcell\" *ngFor=\"let year of yearRow; trackBy: trackByIndex\">\n <button\n [disabled]=\"isDateDisabled(year)\"\n [odxCalendarCell]=\"year\"\n [odxCalendarCellActiveDate]=\"activeDate\"\n [odxCalendarCellCalendarView]=\"currentView\"\n [odxCalendarCellSelectedDate]=\"selectedDate\"\n [odxCalendarCellSelectedDateRange]=\"selectedDateRange\"\n (click)=\"selectDate(year)\"\n >\n {{ year | odxDateLabel: config.yearLabel }}\n </button>\n </td>\n </tr>\n </tbody>\n</table>\n" }]
|
|
715
|
+
}] });
|
|
716
|
+
|
|
717
|
+
class DaterangeService {
|
|
718
|
+
constructor() {
|
|
719
|
+
this.calendar = inject(CalendarService);
|
|
720
|
+
this.dateRangeState$$ = new BehaviorSubject({
|
|
721
|
+
selectionState: DateRangeSelectionState.NothingSelected,
|
|
722
|
+
dateRange: { start: null, end: null },
|
|
723
|
+
});
|
|
724
|
+
this.outputDateRange$ = new EventEmitter();
|
|
725
|
+
this.dateRangeState$ = this.calendar.dateSelectEvents$.pipe(filter((newSelectedDate) => Boolean(newSelectedDate.date)), withLatestFrom(this.dateRangeState$$), map(([newSelectedDate, currentDateRangeState]) => {
|
|
726
|
+
const newDate = newSelectedDate.date;
|
|
727
|
+
const currentStart = currentDateRangeState.dateRange.start;
|
|
728
|
+
const newDateRangeState = {
|
|
729
|
+
selectionState: DateRangeSelectionState.NothingSelected,
|
|
730
|
+
dateRange: { start: null, end: null },
|
|
731
|
+
};
|
|
732
|
+
if (newSelectedDate.options.skipDaterangeUpdate) {
|
|
733
|
+
return currentDateRangeState;
|
|
734
|
+
}
|
|
735
|
+
if (currentStart &&
|
|
736
|
+
newDate &&
|
|
737
|
+
currentDateRangeState.selectionState === DateRangeSelectionState.StartSelected &&
|
|
738
|
+
validateDaterange(currentStart, newDate)) {
|
|
739
|
+
newDateRangeState.dateRange = { start: currentStart, end: newDate };
|
|
740
|
+
newDateRangeState.selectionState = DateRangeSelectionState.EndSelected;
|
|
741
|
+
}
|
|
742
|
+
else {
|
|
743
|
+
newDateRangeState.dateRange = { start: newDate, end: null };
|
|
744
|
+
newDateRangeState.selectionState = DateRangeSelectionState.StartSelected;
|
|
745
|
+
}
|
|
746
|
+
this.dateRangeState$$.next(newDateRangeState);
|
|
747
|
+
if (newSelectedDate.options?.emitOutside) {
|
|
748
|
+
this.outputDateRange$.next(newDateRangeState.dateRange);
|
|
749
|
+
}
|
|
750
|
+
return newDateRangeState;
|
|
751
|
+
}), distinctUntilChanged((prev, curr) => JSON.stringify(prev) === JSON.stringify(curr)), shareReplay({ refCount: true }));
|
|
752
|
+
}
|
|
753
|
+
setDateRange(value) {
|
|
754
|
+
deferFn(() => {
|
|
755
|
+
this.calendar.selectDate(value.start);
|
|
756
|
+
this.calendar.selectDate(value.end);
|
|
757
|
+
this.calendar.setActiveDate(value.start);
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DaterangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
761
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DaterangeService }); }
|
|
762
|
+
}
|
|
763
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DaterangeService, decorators: [{
|
|
764
|
+
type: Injectable
|
|
572
765
|
}] });
|
|
573
766
|
|
|
574
767
|
let CalendarComponent = class CalendarComponent {
|
|
575
768
|
constructor() {
|
|
576
|
-
this.
|
|
769
|
+
this.config = injectCalendarConfig();
|
|
577
770
|
this.calendar = inject(CalendarService);
|
|
771
|
+
this.daterange = inject(DaterangeService);
|
|
772
|
+
this.CalendarView = CalendarView;
|
|
578
773
|
this.element = injectElement();
|
|
579
774
|
this.selectedDate = null;
|
|
775
|
+
this.selectedDateRange = null;
|
|
580
776
|
this.minDate = null;
|
|
581
777
|
this.maxDate = null;
|
|
582
778
|
this.filterFn = null;
|
|
583
|
-
this.selectedDateChange =
|
|
779
|
+
this.selectedDateChange = this.calendar.outputDate$;
|
|
780
|
+
this.selectedDateRangeChange = this.daterange.outputDateRange$;
|
|
584
781
|
}
|
|
585
782
|
ngOnChanges(changes) {
|
|
586
783
|
if (hasChanged(changes, 'selectedDate', false)) {
|
|
587
|
-
this.calendar.selectDate(this.selectedDate);
|
|
784
|
+
this.calendar.selectDate(this.selectedDate, { skipDaterangeUpdate: true });
|
|
785
|
+
}
|
|
786
|
+
if (this.selectedDateRange && hasChanged(changes, 'selectedDateRange', false) && this.config.selectionMode === CalendarSelectionMode.DateRange) {
|
|
787
|
+
this.daterange.setDateRange(this.selectedDateRange);
|
|
588
788
|
}
|
|
589
789
|
}
|
|
590
790
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
591
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarComponent, isStandalone: true, selector: "odx-calendar", inputs: { selectedDate: "selectedDate", minDate: "minDate", maxDate: "maxDate", filterFn: "filterFn" }, outputs: { selectedDateChange: "selectedDateChange" }, providers: [CalendarService], usesOnChanges: true, ngImport: i0, template: "<ng-template
|
|
791
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarComponent, isStandalone: true, selector: "odx-calendar", inputs: { selectedDate: "selectedDate", selectedDateRange: "selectedDateRange", minDate: "minDate", maxDate: "maxDate", filterFn: "filterFn" }, outputs: { selectedDateChange: "selectedDateChange", selectedDateRangeChange: "selectedDateRangeChange" }, providers: [CalendarService, EventManager, DaterangeService], usesOnChanges: true, ngImport: i0, template: "<ng-template\n [ngrxLet]=\"{\n activeDate: calendar.activeDate$,\n calendarView: calendar.calendarView$,\n selectedDate: calendar.selectedDate$,\n selectedDateRange: daterange.dateRangeState$,\n previewDate: calendar.previewDate$\n }\"\n let-vm\n>\n <ng-container [ngSwitch]=\"vm.calendarView\">\n <odx-calendar-year\n [activeDate]=\"vm.activeDate\"\n [selectedDate]=\"vm.selectedDate\"\n [selectedDateRange]=\"vm.selectedDateRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [filterFn]=\"filterFn\"\n *ngSwitchCase=\"CalendarView.Year\"\n ></odx-calendar-year>\n <odx-calendar-years\n [activeDate]=\"vm.activeDate\"\n [selectedDate]=\"vm.selectedDate\"\n [selectedDateRange]=\"vm.selectedDateRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [filterFn]=\"filterFn\"\n *ngSwitchCase=\"CalendarView.Years\"\n ></odx-calendar-years>\n <odx-calendar-month\n [activeDate]=\"vm.activeDate\"\n [selectedDate]=\"vm.selectedDate\"\n [selectedDateRange]=\"vm.selectedDateRange\"\n [previewDate]=\"vm.previewDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [filterFn]=\"filterFn\"\n *ngSwitchDefault\n ></odx-calendar-month>\n </ng-container>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.LetDirective, selector: "[ngrxLet]", inputs: ["ngrxLet", "ngrxLetSuspenseTpl"] }, { kind: "ngmodule", type: A11yModule }, { kind: "component", type: CalendarMonthComponent, selector: "odx-calendar-month" }, { kind: "component", type: CalendarYearComponent, selector: "odx-calendar-year" }, { kind: "component", type: CalendarYearsComponent, selector: "odx-calendar-years" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
592
792
|
};
|
|
593
793
|
CalendarComponent = __decorate([
|
|
594
|
-
CSSComponent('calendar')
|
|
794
|
+
CSSComponent('calendar'),
|
|
795
|
+
__metadata("design:paramtypes", [])
|
|
595
796
|
], CalendarComponent);
|
|
596
797
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
597
798
|
type: Component,
|
|
598
|
-
args: [{ selector: 'odx-calendar', standalone: true, imports: [CoreModule, A11yModule, CalendarMonthComponent, CalendarYearComponent, CalendarYearsComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarService], template: "<ng-template
|
|
599
|
-
}], propDecorators: { selectedDate: [{
|
|
799
|
+
args: [{ selector: 'odx-calendar', standalone: true, imports: [CoreModule, A11yModule, CalendarMonthComponent, CalendarYearComponent, CalendarYearsComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [CalendarService, EventManager, DaterangeService], template: "<ng-template\n [ngrxLet]=\"{\n activeDate: calendar.activeDate$,\n calendarView: calendar.calendarView$,\n selectedDate: calendar.selectedDate$,\n selectedDateRange: daterange.dateRangeState$,\n previewDate: calendar.previewDate$\n }\"\n let-vm\n>\n <ng-container [ngSwitch]=\"vm.calendarView\">\n <odx-calendar-year\n [activeDate]=\"vm.activeDate\"\n [selectedDate]=\"vm.selectedDate\"\n [selectedDateRange]=\"vm.selectedDateRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [filterFn]=\"filterFn\"\n *ngSwitchCase=\"CalendarView.Year\"\n ></odx-calendar-year>\n <odx-calendar-years\n [activeDate]=\"vm.activeDate\"\n [selectedDate]=\"vm.selectedDate\"\n [selectedDateRange]=\"vm.selectedDateRange\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [filterFn]=\"filterFn\"\n *ngSwitchCase=\"CalendarView.Years\"\n ></odx-calendar-years>\n <odx-calendar-month\n [activeDate]=\"vm.activeDate\"\n [selectedDate]=\"vm.selectedDate\"\n [selectedDateRange]=\"vm.selectedDateRange\"\n [previewDate]=\"vm.previewDate\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n [filterFn]=\"filterFn\"\n *ngSwitchDefault\n ></odx-calendar-month>\n </ng-container>\n</ng-template>\n" }]
|
|
800
|
+
}], ctorParameters: function () { return []; }, propDecorators: { selectedDate: [{
|
|
801
|
+
type: Input
|
|
802
|
+
}], selectedDateRange: [{
|
|
600
803
|
type: Input
|
|
601
804
|
}], minDate: [{
|
|
602
805
|
type: Input
|
|
@@ -606,11 +809,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
606
809
|
type: Input
|
|
607
810
|
}], selectedDateChange: [{
|
|
608
811
|
type: Output
|
|
812
|
+
}], selectedDateRangeChange: [{
|
|
813
|
+
type: Output
|
|
609
814
|
}] } });
|
|
610
815
|
|
|
611
816
|
/**
|
|
612
817
|
* Generated bundle index. Do not edit.
|
|
613
818
|
*/
|
|
614
819
|
|
|
615
|
-
export { CalendarCellDirective, CalendarComponent, CalendarConfig, CalendarDefaultConfig, CalendarHeaderComponent, CalendarMonthComponent, CalendarMonthService, CalendarService, CalendarView, CalendarViewDirective, CalendarYearComponent, CalendarYearService, CalendarYearsComponent, CalendarYearsService, DateLabelPipe, checkIdenticalDate, getA11yLabel, injectCalendarConfig, isDateDisabled, parseDate, provideCalendarConfig, validateMaxDate, validateMinDate, validateNextDateSet, validatePreviousDateSet };
|
|
820
|
+
export { CalendarCellDirective, CalendarComponent, CalendarConfig, CalendarDefaultConfig, CalendarHeaderComponent, CalendarMonthComponent, CalendarMonthService, CalendarSelectionMode, CalendarService, CalendarView, CalendarViewDirective, CalendarYearComponent, CalendarYearService, CalendarYearsComponent, CalendarYearsService, DateLabelPipe, DateRangeSelectionState, checkIdenticalDate, dateSelectOptionsDefaults, getA11yLabel, injectCalendarConfig, isDateDisabled, parseDate, provideCalendarConfig, validateDaterange, validateMaxDate, validateMinDate, validateNextDateSet, validatePreviousDateSet };
|
|
616
821
|
//# sourceMappingURL=odx-angular-components-calendar.mjs.map
|