igniteui-angular 21.0.3 → 21.1.0-alpha.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/LICENSE +1 -0
- package/README.md +5 -6
- package/fesm2022/igniteui-angular-action-strip.mjs +39 -34
- package/fesm2022/igniteui-angular-action-strip.mjs.map +1 -1
- package/fesm2022/igniteui-angular-banner.mjs +64 -59
- package/fesm2022/igniteui-angular-banner.mjs.map +1 -1
- package/fesm2022/igniteui-angular-calendar.mjs +182 -161
- package/fesm2022/igniteui-angular-calendar.mjs.map +1 -1
- package/fesm2022/igniteui-angular-carousel.mjs +7 -3
- package/fesm2022/igniteui-angular-carousel.mjs.map +1 -1
- package/fesm2022/igniteui-angular-chips.mjs +140 -136
- package/fesm2022/igniteui-angular-chips.mjs.map +1 -1
- package/fesm2022/igniteui-angular-combo.mjs +360 -356
- package/fesm2022/igniteui-angular-combo.mjs.map +1 -1
- package/fesm2022/igniteui-angular-core.mjs +420 -618
- package/fesm2022/igniteui-angular-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-date-picker.mjs +124 -32
- package/fesm2022/igniteui-angular-date-picker.mjs.map +1 -1
- package/fesm2022/igniteui-angular-directives.mjs +15 -10
- package/fesm2022/igniteui-angular-directives.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-core.mjs +75 -57
- package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs +71 -62
- package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs +51 -6
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-pivot-grid.mjs +6 -1
- package/fesm2022/igniteui-angular-grids-pivot-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-tree-grid.mjs +8 -8
- package/fesm2022/igniteui-angular-grids-tree-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-input-group.mjs +8 -4
- package/fesm2022/igniteui-angular-input-group.mjs.map +1 -1
- package/fesm2022/igniteui-angular-list.mjs +24 -19
- package/fesm2022/igniteui-angular-list.mjs.map +1 -1
- package/fesm2022/igniteui-angular-paginator.mjs +71 -66
- package/fesm2022/igniteui-angular-paginator.mjs.map +1 -1
- package/fesm2022/igniteui-angular-query-builder.mjs +51 -36
- package/fesm2022/igniteui-angular-query-builder.mjs.map +1 -1
- package/fesm2022/igniteui-angular-time-picker.mjs +50 -8
- package/fesm2022/igniteui-angular-time-picker.mjs.map +1 -1
- package/fesm2022/igniteui-angular-tree.mjs +64 -61
- package/fesm2022/igniteui-angular-tree.mjs.map +1 -1
- package/lib/core/styles/components/calendar/_calendar-theme.scss +2 -0
- package/lib/core/styles/components/grid/_grid-theme.scss +2 -1
- package/lib/core/styles/components/slider/_slider-theme.scss +0 -1
- package/lib/core/styles/components/tabs/_tabs-theme.scss +2 -1
- package/package.json +3 -2
- package/schematics/tsconfig.tsbuildinfo +1 -1
- package/schematics/utils/dependency-handler.js +1 -0
- package/styles/igniteui-angular-dark.css +1 -1
- package/styles/igniteui-angular.css +1 -1
- package/styles/igniteui-bootstrap-dark.css +1 -1
- package/styles/igniteui-bootstrap-light.css +1 -1
- package/styles/igniteui-dark-green.css +1 -1
- package/styles/igniteui-fluent-dark-excel.css +1 -1
- package/styles/igniteui-fluent-dark-word.css +1 -1
- package/styles/igniteui-fluent-dark.css +1 -1
- package/styles/igniteui-fluent-light-excel.css +1 -1
- package/styles/igniteui-fluent-light-word.css +1 -1
- package/styles/igniteui-fluent-light.css +1 -1
- package/styles/igniteui-indigo-dark.css +1 -1
- package/styles/igniteui-indigo-light.css +1 -1
- package/styles/maps/igniteui-angular-dark.css.map +1 -1
- package/styles/maps/igniteui-angular.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
- package/styles/maps/igniteui-dark-green.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-light.css.map +1 -1
- package/styles/maps/igniteui-indigo-dark.css.map +1 -1
- package/styles/maps/igniteui-indigo-light.css.map +1 -1
- package/types/igniteui-angular-action-strip.d.ts +3 -0
- package/types/igniteui-angular-banner.d.ts +3 -0
- package/types/igniteui-angular-calendar.d.ts +37 -47
- package/types/igniteui-angular-carousel.d.ts +1 -0
- package/types/igniteui-angular-chips.d.ts +2 -0
- package/types/igniteui-angular-combo.d.ts +4 -2
- package/types/igniteui-angular-core.d.ts +152 -397
- package/types/igniteui-angular-date-picker.d.ts +22 -4
- package/types/igniteui-angular-directives.d.ts +8 -4
- package/types/igniteui-angular-grids-core.d.ts +18 -8
- package/types/igniteui-angular-grids-grid.d.ts +9 -7
- package/types/igniteui-angular-grids-hierarchical-grid.d.ts +20 -3
- package/types/igniteui-angular-input-group.d.ts +1 -0
- package/types/igniteui-angular-list.d.ts +3 -0
- package/types/igniteui-angular-paginator.d.ts +3 -0
- package/types/igniteui-angular-query-builder.d.ts +8 -0
- package/types/igniteui-angular-time-picker.d.ts +7 -2
- package/types/igniteui-angular-tree.d.ts +2 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ElementRef, EventEmitter, HostListener, Output, Input, Directive, HostBinding, TemplateRef, NgZone, booleanAttribute, ViewChildren, Component, ChangeDetectionStrategy, Injectable, LOCALE_ID, ChangeDetectorRef,
|
|
3
|
-
import { TitleCasePipe,
|
|
2
|
+
import { InjectionToken, inject, ElementRef, EventEmitter, HostListener, Output, Input, Directive, HostBinding, TemplateRef, NgZone, DestroyRef, booleanAttribute, ViewChildren, Component, ChangeDetectionStrategy, Injectable, LOCALE_ID, ChangeDetectorRef, Pipe, forwardRef, ContentChild, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import { TitleCasePipe, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { Subject, fromEvent, interval, noop } from 'rxjs';
|
|
6
6
|
import { debounce, takeUntil, tap, switchMap, skipLast } from 'rxjs/operators';
|
|
7
|
-
import { CalendarDay, PlatformUtil, isDate, getNextActiveDate, isDateInRanges, DateRangeType, calendarRange, areSameMonth, isPreviousMonth, isNextMonth, getYearRange, DateTimeUtil,
|
|
7
|
+
import { CalendarDay, PlatformUtil, isDate, getNextActiveDate, isDateInRanges, DateRangeType, onResourceChangeHandle, calendarRange, areSameMonth, isPreviousMonth, isNextMonth, getCurrentResourceStrings, CalendarResourceStringsEN, getYearRange, DateTimeUtil, I18N_FORMATTER, isEqual, DEFAULT_LOCALE, THEME_TOKEN, getClosestActiveDate, getPreviousActiveDate, generateMonth, intoChunks, formatToParts, IgxDateFormatterPipe } from 'igniteui-angular/core';
|
|
8
|
+
import { getDateFormatter, getCurrentI18n } from 'igniteui-i18n-core';
|
|
8
9
|
import { EventManager } from '@angular/platform-browser';
|
|
9
10
|
import { IgxIconComponent } from 'igniteui-angular/icon';
|
|
10
11
|
|
|
@@ -354,6 +355,12 @@ class IgxCalendarViewDirective {
|
|
|
354
355
|
return;
|
|
355
356
|
return this.date.getTime();
|
|
356
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* @hidden
|
|
360
|
+
*/
|
|
361
|
+
get formatter() {
|
|
362
|
+
return getDateFormatter().getIntlFormatter(this.locale);
|
|
363
|
+
}
|
|
357
364
|
/**
|
|
358
365
|
* Gets/sets the selected date of the view.
|
|
359
366
|
* By default it's the current date.
|
|
@@ -381,7 +388,7 @@ class IgxCalendarViewDirective {
|
|
|
381
388
|
* @memberof IgxCalendarViewDirective
|
|
382
389
|
*/
|
|
383
390
|
get locale() {
|
|
384
|
-
return this._locale;
|
|
391
|
+
return this._locale || this._defaultLocale;
|
|
385
392
|
}
|
|
386
393
|
/**
|
|
387
394
|
* Sets the `locale` of the view.
|
|
@@ -392,7 +399,6 @@ class IgxCalendarViewDirective {
|
|
|
392
399
|
*/
|
|
393
400
|
set locale(value) {
|
|
394
401
|
this._locale = value;
|
|
395
|
-
this.initFormatter();
|
|
396
402
|
}
|
|
397
403
|
constructor() {
|
|
398
404
|
this.dayInterval = inject(DAY_INTERVAL_TOKEN);
|
|
@@ -421,15 +427,8 @@ class IgxCalendarViewDirective {
|
|
|
421
427
|
* @hidden @internal
|
|
422
428
|
*/
|
|
423
429
|
this.activeDateChanged = new EventEmitter();
|
|
424
|
-
/**
|
|
425
|
-
* @hidden
|
|
426
|
-
*/
|
|
427
|
-
this._locale = "en";
|
|
428
|
-
/**
|
|
429
|
-
* @hidden
|
|
430
|
-
* @internal
|
|
431
|
-
*/
|
|
432
430
|
this._date = new Date();
|
|
431
|
+
this._destroyRef = inject(DestroyRef);
|
|
433
432
|
/**
|
|
434
433
|
* @hidden
|
|
435
434
|
*/
|
|
@@ -438,7 +437,7 @@ class IgxCalendarViewDirective {
|
|
|
438
437
|
* @hidden
|
|
439
438
|
*/
|
|
440
439
|
this._onChangeCallback = noop;
|
|
441
|
-
this.
|
|
440
|
+
this.initLocale();
|
|
442
441
|
}
|
|
443
442
|
/**
|
|
444
443
|
* @hidden
|
|
@@ -549,6 +548,12 @@ class IgxCalendarViewDirective {
|
|
|
549
548
|
this.date = date.native;
|
|
550
549
|
this.activeDateChanged.emit(this.date);
|
|
551
550
|
}
|
|
551
|
+
initLocale() {
|
|
552
|
+
this._defaultLocale = getCurrentI18n();
|
|
553
|
+
onResourceChangeHandle(this._destroyRef, (args) => {
|
|
554
|
+
this._defaultLocale = args.detail.newLocale;
|
|
555
|
+
}, this);
|
|
556
|
+
}
|
|
552
557
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxCalendarViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
553
558
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.0.2", type: IgxCalendarViewDirective, isStandalone: true, inputs: { role: "role", tabIndex: "tabIndex", formatView: ["formatView", "formatView", booleanAttribute], showActive: ["showActive", "showActive", booleanAttribute], date: "date", locale: "locale" }, outputs: { selected: "selected", pageChanged: "pageChanged", activeDateChanged: "activeDateChanged" }, host: { listeners: { "keydown.arrowdown": "onKeydownArrowDown($event)", "keydown.arrowup": "onKeydownArrowUp($event)", "keydown.arrowright": "onKeydownArrowRight($event)", "keydown.arrowleft": "onKeydownArrowLeft($event)", "keydown.home": "onKeydownHome($event)", "keydown.end": "onKeydownEnd($event)", "keydown.enter": "onKeydownEnter($event)", "focus": "handleFocus()", "blur": "handleBlur()" }, properties: { "attr.role": "this.role", "attr.tabIndex": "this.tabIndex", "attr.aria-activeDescendant": "this.activeDescendant" } }, providers: [
|
|
554
559
|
{
|
|
@@ -696,7 +701,6 @@ class IgxMonthsViewComponent extends IgxCalendarViewDirective {
|
|
|
696
701
|
*/
|
|
697
702
|
set monthFormat(value) {
|
|
698
703
|
this._monthFormat = value;
|
|
699
|
-
this.initFormatter();
|
|
700
704
|
}
|
|
701
705
|
/**
|
|
702
706
|
* Returns an array of date objects which are then used to
|
|
@@ -711,6 +715,12 @@ class IgxMonthsViewComponent extends IgxCalendarViewDirective {
|
|
|
711
715
|
const end = start.add(this.dayInterval, 12);
|
|
712
716
|
return Array.from(calendarRange({ start, end, unit: this.dayInterval })).map((m) => m.native);
|
|
713
717
|
}
|
|
718
|
+
/**
|
|
719
|
+
* @hidden
|
|
720
|
+
*/
|
|
721
|
+
get formatter() {
|
|
722
|
+
return getDateFormatter().getIntlFormatter(this.locale, { month: this.monthFormat });
|
|
723
|
+
}
|
|
714
724
|
/**
|
|
715
725
|
* @hidden
|
|
716
726
|
*/
|
|
@@ -725,14 +735,14 @@ class IgxMonthsViewComponent extends IgxCalendarViewDirective {
|
|
|
725
735
|
* @hidden
|
|
726
736
|
*/
|
|
727
737
|
formattedMonth(value) {
|
|
728
|
-
const rawFormatter =
|
|
738
|
+
const rawFormatter = getDateFormatter().getIntlFormatter(this.locale, {
|
|
729
739
|
month: "long",
|
|
730
740
|
year: "numeric",
|
|
731
741
|
});
|
|
732
742
|
if (this.formatView) {
|
|
733
743
|
return {
|
|
734
744
|
long: rawFormatter.format(value),
|
|
735
|
-
formatted: this.
|
|
745
|
+
formatted: this.formatter.format(value),
|
|
736
746
|
};
|
|
737
747
|
}
|
|
738
748
|
return {
|
|
@@ -746,14 +756,6 @@ class IgxMonthsViewComponent extends IgxCalendarViewDirective {
|
|
|
746
756
|
monthTracker(_, item) {
|
|
747
757
|
return `${item.getMonth()}}`;
|
|
748
758
|
}
|
|
749
|
-
/**
|
|
750
|
-
* @hidden
|
|
751
|
-
*/
|
|
752
|
-
initFormatter() {
|
|
753
|
-
this._formatter = new Intl.DateTimeFormat(this._locale, {
|
|
754
|
-
month: this.monthFormat,
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
759
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxMonthsViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
758
760
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: IgxMonthsViewComponent, isStandalone: true, selector: "igx-months-view", inputs: { id: "id", standalone: "standalone", monthFormat: "monthFormat", formatView: ["formatView", "formatView", booleanAttribute] }, host: { properties: { "attr.id": "this.id", "class.igx-calendar-view": "this.viewClass", "class.igx-calendar-view--standalone": "this.standalone" } }, providers: [
|
|
759
761
|
{
|
|
@@ -831,6 +833,12 @@ class IgxYearsViewComponent extends IgxCalendarViewDirective {
|
|
|
831
833
|
set standalone(value) {
|
|
832
834
|
this.#standalone = value;
|
|
833
835
|
}
|
|
836
|
+
/**
|
|
837
|
+
* @hidden
|
|
838
|
+
*/
|
|
839
|
+
get formatter() {
|
|
840
|
+
return getDateFormatter().getIntlFormatter(this.locale, { year: this.yearFormat });
|
|
841
|
+
}
|
|
834
842
|
/**
|
|
835
843
|
* Gets the year format option of the years view.
|
|
836
844
|
* ```typescript
|
|
@@ -850,7 +858,6 @@ class IgxYearsViewComponent extends IgxCalendarViewDirective {
|
|
|
850
858
|
*/
|
|
851
859
|
set yearFormat(value) {
|
|
852
860
|
this._yearFormat = value;
|
|
853
|
-
this.initFormatter();
|
|
854
861
|
}
|
|
855
862
|
/**
|
|
856
863
|
* Returns an array of date objects which are then used to properly
|
|
@@ -875,11 +882,11 @@ class IgxYearsViewComponent extends IgxCalendarViewDirective {
|
|
|
875
882
|
* @hidden
|
|
876
883
|
*/
|
|
877
884
|
formattedYear(value) {
|
|
878
|
-
const rawFormatter =
|
|
885
|
+
const rawFormatter = getDateFormatter().getIntlFormatter(this.locale, { year: 'numeric' });
|
|
879
886
|
if (this.formatView) {
|
|
880
887
|
return {
|
|
881
888
|
long: rawFormatter.format(value),
|
|
882
|
-
formatted: this.
|
|
889
|
+
formatted: this.formatter.format(value)
|
|
883
890
|
};
|
|
884
891
|
}
|
|
885
892
|
return {
|
|
@@ -893,14 +900,6 @@ class IgxYearsViewComponent extends IgxCalendarViewDirective {
|
|
|
893
900
|
yearTracker(_, item) {
|
|
894
901
|
return `${item.getFullYear()}}`;
|
|
895
902
|
}
|
|
896
|
-
/**
|
|
897
|
-
* @hidden
|
|
898
|
-
*/
|
|
899
|
-
initFormatter() {
|
|
900
|
-
this._formatter = new Intl.DateTimeFormat(this._locale, {
|
|
901
|
-
year: this.yearFormat,
|
|
902
|
-
});
|
|
903
|
-
}
|
|
904
903
|
/**
|
|
905
904
|
* @hidden
|
|
906
905
|
*/
|
|
@@ -1190,6 +1189,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1190
1189
|
|
|
1191
1190
|
/** @hidden @internal */
|
|
1192
1191
|
class IgxCalendarBaseDirective {
|
|
1192
|
+
/**
|
|
1193
|
+
* @hidden
|
|
1194
|
+
*/
|
|
1195
|
+
get formatterWeekday() {
|
|
1196
|
+
return getDateFormatter().getIntlFormatter(this.locale, { weekday: this._formatOptions.weekday });
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* @hidden
|
|
1200
|
+
*/
|
|
1201
|
+
get formatterDay() {
|
|
1202
|
+
return getDateFormatter().getIntlFormatter(this.locale, { day: this._formatOptions.day });
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* @hidden
|
|
1206
|
+
*/
|
|
1207
|
+
get formatterMonth() {
|
|
1208
|
+
return getDateFormatter().getIntlFormatter(this.locale, { month: this._formatOptions.month });
|
|
1209
|
+
}
|
|
1210
|
+
/**
|
|
1211
|
+
* @hidden
|
|
1212
|
+
*/
|
|
1213
|
+
get formatterYear() {
|
|
1214
|
+
return getDateFormatter().getIntlFormatter(this.locale, { year: this._formatOptions.year });
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* @hidden
|
|
1218
|
+
*/
|
|
1219
|
+
get formatterMonthDay() {
|
|
1220
|
+
return getDateFormatter().getIntlFormatter(this.locale, { month: this._formatOptions.month, day: this._formatOptions.day });
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* @hidden
|
|
1224
|
+
*/
|
|
1225
|
+
get formatterRangeDay() {
|
|
1226
|
+
return getDateFormatter().getIntlFormatter(this.locale, { day: this._formatOptions.day, month: 'short' });
|
|
1227
|
+
}
|
|
1193
1228
|
/**
|
|
1194
1229
|
* An accessor that sets the resource strings.
|
|
1195
1230
|
* By default it uses EN resources.
|
|
@@ -1201,7 +1236,7 @@ class IgxCalendarBaseDirective {
|
|
|
1201
1236
|
* An accessor that returns the resource strings.
|
|
1202
1237
|
*/
|
|
1203
1238
|
get resourceStrings() {
|
|
1204
|
-
return this._resourceStrings;
|
|
1239
|
+
return this._resourceStrings || this._defaultResourceStrings;
|
|
1205
1240
|
}
|
|
1206
1241
|
/**
|
|
1207
1242
|
* Gets the start day of the week.
|
|
@@ -1209,7 +1244,7 @@ class IgxCalendarBaseDirective {
|
|
|
1209
1244
|
* If not set, defaults to the first day of the week for the application locale.
|
|
1210
1245
|
*/
|
|
1211
1246
|
get weekStart() {
|
|
1212
|
-
return this._weekStart;
|
|
1247
|
+
return this._weekStart || this._localeWeekStart;
|
|
1213
1248
|
}
|
|
1214
1249
|
/**
|
|
1215
1250
|
* Sets the start day of the week.
|
|
@@ -1223,26 +1258,17 @@ class IgxCalendarBaseDirective {
|
|
|
1223
1258
|
* If not set, defaults to application's locale.
|
|
1224
1259
|
*/
|
|
1225
1260
|
get locale() {
|
|
1226
|
-
return this._locale;
|
|
1261
|
+
return this._locale || this._defaultLocale;
|
|
1227
1262
|
}
|
|
1228
1263
|
/**
|
|
1229
1264
|
* Sets the `locale` of the calendar.
|
|
1230
1265
|
* Expects a valid BCP 47 language tag.
|
|
1231
1266
|
*/
|
|
1232
1267
|
set locale(value) {
|
|
1233
|
-
this._locale = value;
|
|
1234
|
-
//
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
}
|
|
1238
|
-
catch (e) {
|
|
1239
|
-
this._locale = this._localeId;
|
|
1240
|
-
}
|
|
1241
|
-
// changing locale runtime needs to update the `weekStart` too, if `weekStart` is not explicitly set
|
|
1242
|
-
if (!this.weekStart) {
|
|
1243
|
-
this.weekStart = getLocaleFirstDayOfWeek(this._locale);
|
|
1244
|
-
}
|
|
1245
|
-
this.initFormatters();
|
|
1268
|
+
this._locale = this.i18nFormatter.verifyLocale(value);
|
|
1269
|
+
// changing locale runtime needs to update the `weekStart` too
|
|
1270
|
+
this._localeWeekStart = this.i18nFormatter.getLocaleFirstDayOfWeek(this._locale);
|
|
1271
|
+
this._defaultResourceStrings = getCurrentResourceStrings(CalendarResourceStringsEN, false, this._locale);
|
|
1246
1272
|
}
|
|
1247
1273
|
/**
|
|
1248
1274
|
* Gets the date format options of the views.
|
|
@@ -1256,7 +1282,6 @@ class IgxCalendarBaseDirective {
|
|
|
1256
1282
|
*/
|
|
1257
1283
|
set formatOptions(formatOptions) {
|
|
1258
1284
|
this._formatOptions = { ...this._formatOptions, ...formatOptions };
|
|
1259
|
-
this.initFormatters();
|
|
1260
1285
|
}
|
|
1261
1286
|
/**
|
|
1262
1287
|
* Gets whether the `day`, `month` and `year` should be rendered
|
|
@@ -1531,10 +1556,12 @@ class IgxCalendarBaseDirective {
|
|
|
1531
1556
|
* @hidden
|
|
1532
1557
|
*/
|
|
1533
1558
|
constructor() {
|
|
1559
|
+
this._destroyRef = inject(DestroyRef);
|
|
1534
1560
|
this.platform = inject(PlatformUtil);
|
|
1535
1561
|
this._localeId = inject(LOCALE_ID);
|
|
1536
1562
|
this.keyboardNavigation = inject(KeyboardNavigationService);
|
|
1537
1563
|
this.cdr = inject(ChangeDetectorRef);
|
|
1564
|
+
this.i18nFormatter = inject(I18N_FORMATTER);
|
|
1538
1565
|
/**
|
|
1539
1566
|
* Holds month view index we are operating on.
|
|
1540
1567
|
*/
|
|
@@ -1635,8 +1662,8 @@ class IgxCalendarBaseDirective {
|
|
|
1635
1662
|
* @hidden
|
|
1636
1663
|
*/
|
|
1637
1664
|
this._selection = CalendarSelection.SINGLE;
|
|
1638
|
-
|
|
1639
|
-
this.
|
|
1665
|
+
this._resourceStrings = null;
|
|
1666
|
+
this._defaultResourceStrings = getCurrentResourceStrings(CalendarResourceStringsEN);
|
|
1640
1667
|
/**
|
|
1641
1668
|
* @hidden
|
|
1642
1669
|
*/
|
|
@@ -1654,10 +1681,8 @@ class IgxCalendarBaseDirective {
|
|
|
1654
1681
|
month: true,
|
|
1655
1682
|
year: false
|
|
1656
1683
|
};
|
|
1657
|
-
|
|
1658
|
-
this.locale = _localeId;
|
|
1684
|
+
this.initLocale();
|
|
1659
1685
|
this.viewDate = this.viewDate ? this.viewDate : new Date();
|
|
1660
|
-
this.initFormatters();
|
|
1661
1686
|
}
|
|
1662
1687
|
/**
|
|
1663
1688
|
* Multi/Range selection with shift key
|
|
@@ -1922,17 +1947,6 @@ class IgxCalendarBaseDirective {
|
|
|
1922
1947
|
this._onChangeCallback(this.selectedDates);
|
|
1923
1948
|
}
|
|
1924
1949
|
}
|
|
1925
|
-
/**
|
|
1926
|
-
* @hidden
|
|
1927
|
-
*/
|
|
1928
|
-
initFormatters() {
|
|
1929
|
-
this.formatterDay = new Intl.DateTimeFormat(this._locale, { day: this._formatOptions.day });
|
|
1930
|
-
this.formatterWeekday = new Intl.DateTimeFormat(this._locale, { weekday: this._formatOptions.weekday });
|
|
1931
|
-
this.formatterMonth = new Intl.DateTimeFormat(this._locale, { month: this._formatOptions.month });
|
|
1932
|
-
this.formatterYear = new Intl.DateTimeFormat(this._locale, { year: this._formatOptions.year });
|
|
1933
|
-
this.formatterMonthday = new Intl.DateTimeFormat(this._locale, { month: this._formatOptions.month, day: this._formatOptions.day });
|
|
1934
|
-
this.formatterRangeday = new Intl.DateTimeFormat(this._locale, { day: this._formatOptions.day, month: 'short' });
|
|
1935
|
-
}
|
|
1936
1950
|
/**
|
|
1937
1951
|
* @hidden
|
|
1938
1952
|
*/
|
|
@@ -1962,6 +1976,19 @@ class IgxCalendarBaseDirective {
|
|
|
1962
1976
|
validateDate(value) {
|
|
1963
1977
|
return DateTimeUtil.isValidDate(value) ? value : new Date();
|
|
1964
1978
|
}
|
|
1979
|
+
initLocale() {
|
|
1980
|
+
this._defaultLocale = getCurrentI18n();
|
|
1981
|
+
this._locale = this._localeId !== DEFAULT_LOCALE ? this._localeId : this._locale;
|
|
1982
|
+
this._localeWeekStart = this.i18nFormatter.getLocaleFirstDayOfWeek(this.locale);
|
|
1983
|
+
onResourceChangeHandle(this._destroyRef, this.onResourceChange, this);
|
|
1984
|
+
}
|
|
1985
|
+
onResourceChange(args) {
|
|
1986
|
+
this._defaultLocale = args.detail.newLocale;
|
|
1987
|
+
if (!this._locale) {
|
|
1988
|
+
this._defaultResourceStrings = getCurrentResourceStrings(CalendarResourceStringsEN, false);
|
|
1989
|
+
}
|
|
1990
|
+
this._localeWeekStart = this.i18nFormatter.getLocaleFirstDayOfWeek(this.locale);
|
|
1991
|
+
}
|
|
1965
1992
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxCalendarBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1966
1993
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.0.2", type: IgxCalendarBaseDirective, isStandalone: true, selector: "[igxCalendarBase]", inputs: { hideOutsideDays: ["hideOutsideDays", "hideOutsideDays", booleanAttribute], resourceStrings: "resourceStrings", weekStart: "weekStart", locale: "locale", formatOptions: "formatOptions", formatViews: "formatViews", activeView: "activeView", selection: "selection", viewDate: "viewDate", disabledDates: "disabledDates", specialDates: "specialDates", value: "value" }, outputs: { selected: "selected", viewDateChanged: "viewDateChanged", activeViewChanged: "activeViewChanged" }, host: { listeners: { "pointerdown": "onPointerdown($event)" } }, providers: [KeyboardNavigationService], viewQueries: [{ propertyName: "yearsBtns", predicate: ["yearsBtn"], descendants: true }], ngImport: i0 }); }
|
|
1967
1994
|
}
|
|
@@ -2011,8 +2038,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
2011
2038
|
args: ['pointerdown', ['$event']]
|
|
2012
2039
|
}] } });
|
|
2013
2040
|
|
|
2041
|
+
class DayDigitPipe {
|
|
2042
|
+
transform(value, formatViews) {
|
|
2043
|
+
if (!value) {
|
|
2044
|
+
return '';
|
|
2045
|
+
}
|
|
2046
|
+
// strip non-numeric characters that might have been added by the locale formatter (e.g., "25日" -> "25").
|
|
2047
|
+
if (formatViews.day) {
|
|
2048
|
+
// Use regex to extract the numeric day value.
|
|
2049
|
+
// This handles locales that include non-numeric characters (e.g. '25日' in zh-CN).
|
|
2050
|
+
// match(/\d+/) is preferred over parseInt() as it robustly finds the digits regardless
|
|
2051
|
+
// of their position (prefix/suffix) in the localized string.
|
|
2052
|
+
const match = value.match(/\d+/);
|
|
2053
|
+
return match ? match[0] : value;
|
|
2054
|
+
}
|
|
2055
|
+
return value;
|
|
2056
|
+
}
|
|
2057
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: DayDigitPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2058
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.2", ngImport: i0, type: DayDigitPipe, isStandalone: true, name: "dayDigit" }); }
|
|
2059
|
+
}
|
|
2060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: DayDigitPipe, decorators: [{
|
|
2061
|
+
type: Pipe,
|
|
2062
|
+
args: [{
|
|
2063
|
+
name: 'dayDigit',
|
|
2064
|
+
standalone: true
|
|
2065
|
+
}]
|
|
2066
|
+
}] });
|
|
2067
|
+
|
|
2014
2068
|
let NEXT_ID$2 = 0;
|
|
2015
2069
|
class IgxDaysViewComponent extends IgxCalendarBaseDirective {
|
|
2070
|
+
constructor() {
|
|
2071
|
+
super(...arguments);
|
|
2072
|
+
this.el = inject(ElementRef);
|
|
2073
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
2074
|
+
this.themeToken = inject(THEME_TOKEN);
|
|
2075
|
+
this.#standalone = true;
|
|
2076
|
+
/**
|
|
2077
|
+
* Sets/gets the `id` of the days view.
|
|
2078
|
+
* If not set, the `id` will have value `"igx-days-view-0"`.
|
|
2079
|
+
* ```html
|
|
2080
|
+
* <igx-days-view id="my-days-view"></igx-days-view>
|
|
2081
|
+
* ```
|
|
2082
|
+
* ```typescript
|
|
2083
|
+
* let daysViewId = this.daysView.id;
|
|
2084
|
+
* ```
|
|
2085
|
+
*/
|
|
2086
|
+
this.id = `igx-days-view-${NEXT_ID$2++}`;
|
|
2087
|
+
this.tabIndex = 0;
|
|
2088
|
+
this.role = 'grid';
|
|
2089
|
+
this.viewClass = true;
|
|
2090
|
+
/**
|
|
2091
|
+
* @hidden
|
|
2092
|
+
*/
|
|
2093
|
+
this.dateSelected = new EventEmitter();
|
|
2094
|
+
/**
|
|
2095
|
+
* @hidden
|
|
2096
|
+
*/
|
|
2097
|
+
this.pageChanged = new EventEmitter();
|
|
2098
|
+
/**
|
|
2099
|
+
* @hidden
|
|
2100
|
+
*/
|
|
2101
|
+
this.activeDateChange = new EventEmitter();
|
|
2102
|
+
/**
|
|
2103
|
+
* @hidden
|
|
2104
|
+
*/
|
|
2105
|
+
this.previewRangeDateChange = new EventEmitter();
|
|
2106
|
+
this.defaultClass = true;
|
|
2107
|
+
}
|
|
2016
2108
|
#standalone;
|
|
2017
2109
|
get standalone() {
|
|
2018
2110
|
return this.#standalone;
|
|
@@ -2081,69 +2173,6 @@ class IgxDaysViewComponent extends IgxCalendarBaseDirective {
|
|
|
2081
2173
|
get isIndigo() {
|
|
2082
2174
|
return this._theme === 'indigo';
|
|
2083
2175
|
}
|
|
2084
|
-
/**
|
|
2085
|
-
* @hidden
|
|
2086
|
-
*/
|
|
2087
|
-
constructor() {
|
|
2088
|
-
super();
|
|
2089
|
-
this.el = inject(ElementRef);
|
|
2090
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
2091
|
-
this.themeToken = inject(THEME_TOKEN);
|
|
2092
|
-
this.#standalone = true;
|
|
2093
|
-
/**
|
|
2094
|
-
* Sets/gets the `id` of the days view.
|
|
2095
|
-
* If not set, the `id` will have value `"igx-days-view-0"`.
|
|
2096
|
-
* ```html
|
|
2097
|
-
* <igx-days-view id="my-days-view"></igx-days-view>
|
|
2098
|
-
* ```
|
|
2099
|
-
* ```typescript
|
|
2100
|
-
* let daysViewId = this.daysView.id;
|
|
2101
|
-
* ```
|
|
2102
|
-
*/
|
|
2103
|
-
this.id = `igx-days-view-${NEXT_ID$2++}`;
|
|
2104
|
-
this.tabIndex = 0;
|
|
2105
|
-
this.role = 'grid';
|
|
2106
|
-
this.viewClass = true;
|
|
2107
|
-
/**
|
|
2108
|
-
* @hidden
|
|
2109
|
-
*/
|
|
2110
|
-
this.dateSelected = new EventEmitter();
|
|
2111
|
-
/**
|
|
2112
|
-
* @hidden
|
|
2113
|
-
*/
|
|
2114
|
-
this.pageChanged = new EventEmitter();
|
|
2115
|
-
/**
|
|
2116
|
-
* @hidden
|
|
2117
|
-
*/
|
|
2118
|
-
this.activeDateChange = new EventEmitter();
|
|
2119
|
-
/**
|
|
2120
|
-
* @hidden
|
|
2121
|
-
*/
|
|
2122
|
-
this.previewRangeDateChange = new EventEmitter();
|
|
2123
|
-
this._destroyRef = inject(DestroyRef);
|
|
2124
|
-
this.defaultClass = true;
|
|
2125
|
-
this._theme = this.themeToken.theme;
|
|
2126
|
-
const themeChange = this.themeToken.onChange((theme) => {
|
|
2127
|
-
if (this._theme !== theme) {
|
|
2128
|
-
this._theme = theme;
|
|
2129
|
-
this.cdr.detectChanges();
|
|
2130
|
-
}
|
|
2131
|
-
});
|
|
2132
|
-
this._destroyRef.onDestroy(() => themeChange.unsubscribe());
|
|
2133
|
-
}
|
|
2134
|
-
setComponentTheme() {
|
|
2135
|
-
// allow DOM theme override (same pattern as input-group)
|
|
2136
|
-
if (!this.themeToken.preferToken) {
|
|
2137
|
-
const theme = getComponentTheme(this.el.nativeElement);
|
|
2138
|
-
if (theme && theme !== this._theme) {
|
|
2139
|
-
this._theme = theme;
|
|
2140
|
-
this.cdr.markForCheck();
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
ngAfterContentChecked() {
|
|
2145
|
-
this.setComponentTheme();
|
|
2146
|
-
}
|
|
2147
2176
|
/**
|
|
2148
2177
|
* @hidden
|
|
2149
2178
|
*/
|
|
@@ -2288,7 +2317,7 @@ class IgxDaysViewComponent extends IgxCalendarBaseDirective {
|
|
|
2288
2317
|
*/
|
|
2289
2318
|
get weekHeaderLabels() {
|
|
2290
2319
|
const weekdays = [];
|
|
2291
|
-
const rawFormatter =
|
|
2320
|
+
const rawFormatter = getDateFormatter().getIntlFormatter(this.locale, { weekday: 'long' });
|
|
2292
2321
|
for (const day of this.monthWeeks.at(0)) {
|
|
2293
2322
|
weekdays.push({
|
|
2294
2323
|
long: rawFormatter.format(day.native),
|
|
@@ -2448,7 +2477,7 @@ class IgxDaysViewComponent extends IgxCalendarBaseDirective {
|
|
|
2448
2477
|
setPreviewRangeDate(value) {
|
|
2449
2478
|
this.previewRangeDate = value;
|
|
2450
2479
|
}
|
|
2451
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxDaysViewComponent, deps:
|
|
2480
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxDaysViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2452
2481
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: IgxDaysViewComponent, isStandalone: true, selector: "igx-days-view", inputs: { id: "id", tabIndex: "tabIndex", role: "role", standalone: "standalone", showWeekNumbers: ["showWeekNumbers", "showWeekNumbers", booleanAttribute], activeDate: "activeDate", previewRangeDate: "previewRangeDate", hideLeadingDays: ["hideLeadingDays", "hideLeadingDays", booleanAttribute], hideTrailingDays: ["hideTrailingDays", "hideTrailingDays", booleanAttribute], showActiveDay: ["showActiveDay", "showActiveDay", booleanAttribute] }, outputs: { dateSelected: "dateSelected", pageChanged: "pageChanged", activeDateChange: "activeDateChange", previewRangeDateChange: "previewRangeDateChange" }, host: { listeners: { "keydown.arrowright": "onArrowRight($event)", "keydown.arrowleft": "onArrowLeft($event)", "keydown.arrowup": "onArrowUp($event)", "keydown.arrowdown": "onArrowDown($event)", "keydown.space": "onKeydownEnter($event)", "keydown.enter": "onKeydownEnter($event)", "keydown.home": "onKeydownHome($event)", "keydown.end": "onKeydownEnd($event)", "focus": "handleFocus()", "blur": "handleBlur()" }, properties: { "attr.id": "this.id", "attr.tabIndex": "this.tabIndex", "attr.role": "this.role", "class.igx-days-view": "this.defaultClass", "class.igx-days-view--standalone": "this.standalone", "attr.aria-activeDescendant": "this.activeDescendant", "class.igx-days-view--material": "this.isMaterial", "class.igx-days-view--fluent": "this.isFluent", "class.igx-days-view--bootstrap": "this.isBootstrap", "class.igx-days-view--indigo": "this.isIndigo" } }, providers: [
|
|
2453
2482
|
{
|
|
2454
2483
|
multi: true,
|
|
@@ -2456,7 +2485,7 @@ class IgxDaysViewComponent extends IgxCalendarBaseDirective {
|
|
|
2456
2485
|
useExisting: IgxDaysViewComponent
|
|
2457
2486
|
},
|
|
2458
2487
|
KeyboardNavigationService
|
|
2459
|
-
], viewQueries: [{ propertyName: "dates", predicate: IgxDayItemComponent, descendants: true, read: IgxDayItemComponent }], usesInheritance: true, ngImport: i0, template: "<div\n role=\"row\"\n class=\"igx-days-view__row\"\n [title]=\"weekNumberHeader.long | titlecase\"\n>\n @if (showWeekNumbers) {\n <div\n role=\"columnheader\"\n class=\"igx-days-view__label igx-days-view__label--week-number\"\n >\n <span>\n <i>{{ weekNumberHeader.short | titlecase }}</i>\n </span>\n </div>\n }\n @for (dayName of weekHeaderLabels; track dayName.long) {\n <span\n role=\"columnheader\"\n [attr.aria-label]=\"dayName.long\"\n class=\"igx-days-view__label\"\n >\n <span class=\"igx-days-view__label-inner\">\n {{ dayName.formatted | titlecase }}\n </span>\n </span>\n }\n</div>\n\n@for (\n week of monthWeeks; track rowTracker(i, week);\n let isLast = $last; let i = $index\n) {\n <div\n class=\"igx-days-view__row\"\n role=\"row\"\n >\n @if (showWeekNumbers) {\n <div class=\"igx-days-view__date igx-days-view__date--week-number\">\n <span\n role=\"rowheader\"\n class=\"igx-days-view__date-inner igx-days-view__date-inner--week-number\"\n >\n {{ getWeekNumber(week[0]) }}\n </span>\n </div>\n }\n @for (day of week; track dateTracker($index, day)) {\n <igx-day-item\n #item\n class=\"igx-days-view__date\"\n role=\"gridcell\"\n [attr.id]=\"item.isCurrentMonth && day.timestamp\"\n [attr.aria-selected]=\"isSelected(day)\"\n [attr.aria-disabled]=\"isDateDisabled(day.native)\"\n [attr.aria-label]=\"\n isFirstInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_start\n : isLastInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_end\n : day.native.toDateString()\n \"\n [date]=\"day\"\n [viewDate]=\"viewDate\"\n [selection]=\"selection\"\n [selected]=\"isSelected(day)\"\n [isActive]=\"isActiveDate(day)\"\n [isLastInRange]=\"isLastInRange(day)\"\n [isFirstInRange]=\"isFirstInRange(day)\"\n [isWithinRange]=\"isWithinRange(day.native, true)\"\n [isWithinPreviewRange]=\"isWithinPreviewRange(day.native)\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [hideLeadingDays]=\"hideLeadingDays\"\n [hideTrailingDays]=\"hideTrailingDays\"\n [attr.tabindex]=\"-1\"\n (click)=\"handleDateClick(item)\"\n (mouseEnter)=\"changePreviewRange(day.native)\"\n (mouseLeave)=\"clearPreviewRange()\"\n >\n {{ formattedDate(day.native) }}\n </igx-day-item>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: IgxDayItemComponent, selector: "igx-day-item", inputs: ["date", "viewDate", "selection", "selected", "disabledDates", "specialDates", "hideOutsideDays", "isLastInRange", "isFirstInRange", "isWithinRange", "isWithinPreviewRange", "hideLeadingDays", "hideTrailingDays", "isActive"], outputs: ["dateSelection", "mouseEnter", "mouseLeave", "mouseDown"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2488
|
+
], viewQueries: [{ propertyName: "dates", predicate: IgxDayItemComponent, descendants: true, read: IgxDayItemComponent }], usesInheritance: true, ngImport: i0, template: "<div\n role=\"row\"\n class=\"igx-days-view__row\"\n [title]=\"weekNumberHeader.long | titlecase\"\n>\n @if (showWeekNumbers) {\n <div\n role=\"columnheader\"\n class=\"igx-days-view__label igx-days-view__label--week-number\"\n >\n <span>\n <i>{{ weekNumberHeader.short | titlecase }}</i>\n </span>\n </div>\n }\n @for (dayName of weekHeaderLabels; track dayName.long) {\n <span\n role=\"columnheader\"\n [attr.aria-label]=\"dayName.long\"\n class=\"igx-days-view__label\"\n >\n <span class=\"igx-days-view__label-inner\">\n {{ dayName.formatted | titlecase }}\n </span>\n </span>\n }\n</div>\n\n@for (\n week of monthWeeks; track rowTracker(i, week);\n let isLast = $last; let i = $index\n) {\n <div\n class=\"igx-days-view__row\"\n role=\"row\"\n >\n @if (showWeekNumbers) {\n <div class=\"igx-days-view__date igx-days-view__date--week-number\">\n <span\n role=\"rowheader\"\n class=\"igx-days-view__date-inner igx-days-view__date-inner--week-number\"\n >\n {{ getWeekNumber(week[0]) }}\n </span>\n </div>\n }\n @for (day of week; track dateTracker($index, day)) {\n <igx-day-item\n #item\n class=\"igx-days-view__date\"\n role=\"gridcell\"\n [attr.id]=\"item.isCurrentMonth && day.timestamp\"\n [attr.aria-selected]=\"isSelected(day)\"\n [attr.aria-disabled]=\"isDateDisabled(day.native)\"\n [attr.aria-label]=\"\n isFirstInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_start\n : isLastInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_end\n : day.native.toDateString()\n \"\n [date]=\"day\"\n [viewDate]=\"viewDate\"\n [selection]=\"selection\"\n [selected]=\"isSelected(day)\"\n [isActive]=\"isActiveDate(day)\"\n [isLastInRange]=\"isLastInRange(day)\"\n [isFirstInRange]=\"isFirstInRange(day)\"\n [isWithinRange]=\"isWithinRange(day.native, true)\"\n [isWithinPreviewRange]=\"isWithinPreviewRange(day.native)\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [hideLeadingDays]=\"hideLeadingDays\"\n [hideTrailingDays]=\"hideTrailingDays\"\n [attr.tabindex]=\"-1\"\n (click)=\"handleDateClick(item)\"\n (mouseEnter)=\"changePreviewRange(day.native)\"\n (mouseLeave)=\"clearPreviewRange()\"\n >\n {{ formattedDate(day.native) | dayDigit:formatViews }}\n </igx-day-item>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: IgxDayItemComponent, selector: "igx-day-item", inputs: ["date", "viewDate", "selection", "selected", "disabledDates", "specialDates", "hideOutsideDays", "isLastInRange", "isFirstInRange", "isWithinRange", "isWithinPreviewRange", "hideLeadingDays", "hideTrailingDays", "isActive"], outputs: ["dateSelection", "mouseEnter", "mouseLeave", "mouseDown"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: DayDigitPipe, name: "dayDigit" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2460
2489
|
}
|
|
2461
2490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxDaysViewComponent, decorators: [{
|
|
2462
2491
|
type: Component,
|
|
@@ -2467,8 +2496,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
2467
2496
|
useExisting: IgxDaysViewComponent
|
|
2468
2497
|
},
|
|
2469
2498
|
KeyboardNavigationService
|
|
2470
|
-
], selector: 'igx-days-view', changeDetection: ChangeDetectionStrategy.OnPush, imports: [IgxDayItemComponent, TitleCasePipe], template: "<div\n role=\"row\"\n class=\"igx-days-view__row\"\n [title]=\"weekNumberHeader.long | titlecase\"\n>\n @if (showWeekNumbers) {\n <div\n role=\"columnheader\"\n class=\"igx-days-view__label igx-days-view__label--week-number\"\n >\n <span>\n <i>{{ weekNumberHeader.short | titlecase }}</i>\n </span>\n </div>\n }\n @for (dayName of weekHeaderLabels; track dayName.long) {\n <span\n role=\"columnheader\"\n [attr.aria-label]=\"dayName.long\"\n class=\"igx-days-view__label\"\n >\n <span class=\"igx-days-view__label-inner\">\n {{ dayName.formatted | titlecase }}\n </span>\n </span>\n }\n</div>\n\n@for (\n week of monthWeeks; track rowTracker(i, week);\n let isLast = $last; let i = $index\n) {\n <div\n class=\"igx-days-view__row\"\n role=\"row\"\n >\n @if (showWeekNumbers) {\n <div class=\"igx-days-view__date igx-days-view__date--week-number\">\n <span\n role=\"rowheader\"\n class=\"igx-days-view__date-inner igx-days-view__date-inner--week-number\"\n >\n {{ getWeekNumber(week[0]) }}\n </span>\n </div>\n }\n @for (day of week; track dateTracker($index, day)) {\n <igx-day-item\n #item\n class=\"igx-days-view__date\"\n role=\"gridcell\"\n [attr.id]=\"item.isCurrentMonth && day.timestamp\"\n [attr.aria-selected]=\"isSelected(day)\"\n [attr.aria-disabled]=\"isDateDisabled(day.native)\"\n [attr.aria-label]=\"\n isFirstInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_start\n : isLastInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_end\n : day.native.toDateString()\n \"\n [date]=\"day\"\n [viewDate]=\"viewDate\"\n [selection]=\"selection\"\n [selected]=\"isSelected(day)\"\n [isActive]=\"isActiveDate(day)\"\n [isLastInRange]=\"isLastInRange(day)\"\n [isFirstInRange]=\"isFirstInRange(day)\"\n [isWithinRange]=\"isWithinRange(day.native, true)\"\n [isWithinPreviewRange]=\"isWithinPreviewRange(day.native)\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [hideLeadingDays]=\"hideLeadingDays\"\n [hideTrailingDays]=\"hideTrailingDays\"\n [attr.tabindex]=\"-1\"\n (click)=\"handleDateClick(item)\"\n (mouseEnter)=\"changePreviewRange(day.native)\"\n (mouseLeave)=\"clearPreviewRange()\"\n >\n {{ formattedDate(day.native) }}\n </igx-day-item>\n }\n </div>\n}\n" }]
|
|
2471
|
-
}],
|
|
2499
|
+
], selector: 'igx-days-view', changeDetection: ChangeDetectionStrategy.OnPush, imports: [IgxDayItemComponent, TitleCasePipe, DayDigitPipe], template: "<div\n role=\"row\"\n class=\"igx-days-view__row\"\n [title]=\"weekNumberHeader.long | titlecase\"\n>\n @if (showWeekNumbers) {\n <div\n role=\"columnheader\"\n class=\"igx-days-view__label igx-days-view__label--week-number\"\n >\n <span>\n <i>{{ weekNumberHeader.short | titlecase }}</i>\n </span>\n </div>\n }\n @for (dayName of weekHeaderLabels; track dayName.long) {\n <span\n role=\"columnheader\"\n [attr.aria-label]=\"dayName.long\"\n class=\"igx-days-view__label\"\n >\n <span class=\"igx-days-view__label-inner\">\n {{ dayName.formatted | titlecase }}\n </span>\n </span>\n }\n</div>\n\n@for (\n week of monthWeeks; track rowTracker(i, week);\n let isLast = $last; let i = $index\n) {\n <div\n class=\"igx-days-view__row\"\n role=\"row\"\n >\n @if (showWeekNumbers) {\n <div class=\"igx-days-view__date igx-days-view__date--week-number\">\n <span\n role=\"rowheader\"\n class=\"igx-days-view__date-inner igx-days-view__date-inner--week-number\"\n >\n {{ getWeekNumber(week[0]) }}\n </span>\n </div>\n }\n @for (day of week; track dateTracker($index, day)) {\n <igx-day-item\n #item\n class=\"igx-days-view__date\"\n role=\"gridcell\"\n [attr.id]=\"item.isCurrentMonth && day.timestamp\"\n [attr.aria-selected]=\"isSelected(day)\"\n [attr.aria-disabled]=\"isDateDisabled(day.native)\"\n [attr.aria-label]=\"\n isFirstInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_start\n : isLastInRange(day)\n ? day.native.toDateString() +\n ', ' +\n resourceStrings.igx_calendar_range_end\n : day.native.toDateString()\n \"\n [date]=\"day\"\n [viewDate]=\"viewDate\"\n [selection]=\"selection\"\n [selected]=\"isSelected(day)\"\n [isActive]=\"isActiveDate(day)\"\n [isLastInRange]=\"isLastInRange(day)\"\n [isFirstInRange]=\"isFirstInRange(day)\"\n [isWithinRange]=\"isWithinRange(day.native, true)\"\n [isWithinPreviewRange]=\"isWithinPreviewRange(day.native)\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [hideLeadingDays]=\"hideLeadingDays\"\n [hideTrailingDays]=\"hideTrailingDays\"\n [attr.tabindex]=\"-1\"\n (click)=\"handleDateClick(item)\"\n (mouseEnter)=\"changePreviewRange(day.native)\"\n (mouseLeave)=\"clearPreviewRange()\"\n >\n {{ formattedDate(day.native) | dayDigit:formatViews }}\n </igx-day-item>\n }\n </div>\n}\n" }]
|
|
2500
|
+
}], propDecorators: { id: [{
|
|
2472
2501
|
type: HostBinding,
|
|
2473
2502
|
args: ['attr.id']
|
|
2474
2503
|
}, {
|
|
@@ -2945,6 +2974,9 @@ class IgxCalendarComponent extends IgxCalendarBaseDirective {
|
|
|
2945
2974
|
currentValue: this.viewDate
|
|
2946
2975
|
});
|
|
2947
2976
|
});
|
|
2977
|
+
this._destroyRef.onDestroy(() => {
|
|
2978
|
+
this.keyboardNavigation.detachKeyboardHandlers();
|
|
2979
|
+
});
|
|
2948
2980
|
}
|
|
2949
2981
|
onWrapperFocus(_event) {
|
|
2950
2982
|
this.showActiveDay = true;
|
|
@@ -3207,11 +3239,11 @@ class IgxCalendarComponent extends IgxCalendarBaseDirective {
|
|
|
3207
3239
|
*/
|
|
3208
3240
|
getFormattedDate() {
|
|
3209
3241
|
const date = this.headerDate;
|
|
3210
|
-
const
|
|
3211
|
-
const
|
|
3242
|
+
const monthFormatted = getDateFormatter().formatDateTime(date, this.locale, { month: 'short', day: 'numeric' });
|
|
3243
|
+
const dayFormatted = getDateFormatter().formatDateTime(date, this.locale, { weekday: 'short' });
|
|
3212
3244
|
return {
|
|
3213
|
-
monthday:
|
|
3214
|
-
weekday:
|
|
3245
|
+
monthday: monthFormatted,
|
|
3246
|
+
weekday: dayFormatted,
|
|
3215
3247
|
};
|
|
3216
3248
|
}
|
|
3217
3249
|
/**
|
|
@@ -3221,8 +3253,8 @@ class IgxCalendarComponent extends IgxCalendarBaseDirective {
|
|
|
3221
3253
|
getFormattedRange() {
|
|
3222
3254
|
const dates = this.selectedDates;
|
|
3223
3255
|
return {
|
|
3224
|
-
start: this.
|
|
3225
|
-
end: this.
|
|
3256
|
+
start: this.formatterRangeDay.format(dates.at(0)),
|
|
3257
|
+
end: this.formatterRangeDay.format(dates.at(-1))
|
|
3226
3258
|
};
|
|
3227
3259
|
}
|
|
3228
3260
|
/**
|
|
@@ -3358,13 +3390,6 @@ class IgxCalendarComponent extends IgxCalendarBaseDirective {
|
|
|
3358
3390
|
isDateInRanges(target, this.disabledDates);
|
|
3359
3391
|
this.activeDate = outOfRange ? date : target.native;
|
|
3360
3392
|
}
|
|
3361
|
-
/**
|
|
3362
|
-
* @hidden
|
|
3363
|
-
* @internal
|
|
3364
|
-
*/
|
|
3365
|
-
ngOnDestroy() {
|
|
3366
|
-
this.keyboardNavigation.detachKeyboardHandlers();
|
|
3367
|
-
}
|
|
3368
3393
|
/**
|
|
3369
3394
|
* @hidden
|
|
3370
3395
|
* @internal
|
|
@@ -3413,7 +3438,7 @@ class IgxCalendarComponent extends IgxCalendarBaseDirective {
|
|
|
3413
3438
|
multi: false,
|
|
3414
3439
|
provide: KeyboardNavigationService,
|
|
3415
3440
|
},
|
|
3416
|
-
], queries: [{ propertyName: "headerTemplateDirective", first: true, predicate: i0.forwardRef(() => IgxCalendarHeaderTemplateDirective), descendants: true, read: IgxCalendarHeaderTemplateDirective, static: true }, { propertyName: "headerTitleTemplateDirective", first: true, predicate: i0.forwardRef(() => IgxCalendarHeaderTitleTemplateDirective), descendants: true, read: IgxCalendarHeaderTitleTemplateDirective, static: true }, { propertyName: "subheaderTemplateDirective", first: true, predicate: i0.forwardRef(() => IgxCalendarSubheaderTemplateDirective), descendants: true, read: IgxCalendarSubheaderTemplateDirective, static: true }], viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }, { propertyName: "dacadeView", first: true, predicate: ["decade"], descendants: true, read: IgxYearsViewComponent }, { propertyName: "monthsView", first: true, predicate: ["months"], descendants: true, read: IgxMonthsViewComponent }, { propertyName: "daysView", first: true, predicate: ["days"], descendants: true, read: IgxDaysViewComponent }, { propertyName: "prevPageBtn", first: true, predicate: ["prevPageBtn"], descendants: true }, { propertyName: "nextPageBtn", first: true, predicate: ["nextPageBtn"], descendants: true }, { propertyName: "monthsBtns", predicate: ["monthsBtn"], descendants: true }, { propertyName: "monthViews", predicate: ["days"], descendants: true, read: IgxDaysViewComponent }], usesInheritance: true, ngImport: i0, template: "<ng-template let-result #defaultHeaderTitle>\n @if (selection === 'single') {\n <span>{{ resourceStrings.igx_calendar_select_date }}</span>\n }\n @if (selection === 'range') {\n <span>{{ resourceStrings.igx_calendar_range_placeholder }}</span>\n }\n</ng-template>\n\n<ng-template let-result #defaultHeaderDate>\n @if (selection === 'single') {\n <span>{{ getFormattedDate().weekday }}, </span>\n <span>{{ getFormattedDate().monthday }}</span>\n }\n @if (selection === 'range') {\n <span>{{ selectedDates.length === 0 ? 'Start' : getFormattedRange().start}}</span>\n <span> - </span>\n <span>{{ selectedDates.length <= 1 ? 'End' : getFormattedRange().end}}</span>\n }\n</ng-template>\n\n<!-- Month -->\n<ng-template #defaultMonth let-obj>\n <span\n #monthsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'LLLL') + ', ' + resourceStrings.igx_calendar_select_month\"\n (keydown)=\"onActiveViewYearKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewYear($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedMonth(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Year -->\n<ng-template #defaultYear let-obj>\n @if (activeView === 'year') {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">{{ formattedYear(obj.date) }}</span>\n }\n <span\n #yearsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'yyyy') + ', ' + resourceStrings.igx_calendar_select_year\"\n (keydown)=\"onActiveViewDecadeKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewDecade($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedYear(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Month Year -->\n<ng-template #defaultMonthYear let-obj let-result>\n @if (monthsViewNumber < 2 || obj.index < 1) {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">\n {{ monthsViewNumber > 1 ?\n (resourceStrings.igx_calendar_first_picker_of.replace('{0}', monthsViewNumber.toString()) + ' ' +\n (obj.date | date: 'LLLL yyyy')) :\n resourceStrings.igx_calendar_selected_month_is + (obj.date | date: 'LLLL yyyy')}}\n </span>\n }\n <ng-container *ngTemplateOutlet=\"defaultMonth; context: {$implicit: obj}\"></ng-container>\n <ng-container *ngTemplateOutlet=\"defaultYear; context: {$implicit: obj}\"></ng-container>\n</ng-template>\n\n<!-- Decade -->\n<ng-template #defaultDecade>\n <span>{{ getDecadeRange().start }} - {{ getDecadeRange().end }}</span>\n</ng-template>\n\n<!-- Previous arrow icon -->\n<ng-template #prevArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_prev\"></igx-icon>\n</ng-template>\n\n<!-- Next arrow icon -->\n<ng-template #nextArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_next\"></igx-icon>\n</ng-template>\n\n<!-- Previous picker button -->\n<ng-template #prevPageButton let-obj>\n <div\n #prevPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__prev\"\n role=\"button\"\n [attr.aria-label]=\"prevNavLabel((getPrevMonth(viewDate) | date: 'LLLL'))\"\n data-action=\"prev\"\n igxCalendarScrollPage\n [startScroll]=\"startPrevPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"prevArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Next picker button -->\n<ng-template #nextPageButton let-obj>\n <div\n #nextPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__next\"\n role=\"button\"\n [attr.aria-label]=\"nextNavLabel((getNextMonth(viewDate, monthsViewNumber) | date: 'LLLL'))\"\n data-action=\"next\"\n igxCalendarScrollPage\n [startScroll]=\"startNextPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"nextArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- PICKER IN DAYS -->\n<ng-template #calendarDaysPicker let-i>\n <section class=\"igx-calendar-picker\" [style.--calendar-row-start]=\"1 + (2 * i)\">\n <div class=\"igx-calendar-picker__dates\" [attr.data-month]=\"i | IgxGetViewDate:viewDate:false\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultMonthYear; context: getContext(i)\">\n </ng-container>\n </div>\n @if (this.orientation === 'horizontal' ? i === monthsViewNumber - 1 : i === 0) {\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n }\n </section>\n</ng-template>\n\n<!-- PICKER IN MONTHS -->\n<ng-template #calendarYearPicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultYear; context: getContext(0)\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<!-- PICKER IN YEARS -->\n<ng-template #calendarDecadePicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\" aria-live=\"polite\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultDecade;\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n\n@if (selection === 'single' && hasHeader || selection === 'range' && hasHeader) {\n <header\n aria-labelledby=\"igx-aria-calendar-title-month igx-aria-calendar-title-year\"\n class=\"igx-calendar__header\"\n >\n <h5 id=\"igx-aria-calendar-title-year\" class=\"igx-calendar__header-year\">\n <ng-container *ngTemplateOutlet=\"headerTitleTemplate ?? defaultHeaderTitle; context: headerContext\"></ng-container>\n </h5>\n <h2 id=\"igx-aria-calendar-title-month\" class=\"igx-calendar__header-date\">\n <ng-container *ngTemplateOutlet=\"headerTemplate ? headerTemplate : defaultHeaderDate; context: headerContext\">\n </ng-container>\n </h2>\n </header>\n}\n\n\n<div\n #wrapper\n [style.--calendar-months]=\"monthsViewNumber\"\n [tabIndex]=\"0\"\n class=\"igx-calendar__wrapper\"\n [class.igx-calendar__wrapper--vertical]=\"orientation === 'vertical'\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-multiselectable]=\"selection !== 'single'\"\n aria-labelledby=\"calendar-desc\"\n role=\"grid\"\n (focus)=\"this.onWrapperFocus($event)\"\n (blur)=\"this.onWrapperBlur($event)\"\n >\n <div id=\"calendar-desc\" tabindex=\"-1\" class=\"igx-calendar__aria-off-screen\">\n @switch (selection) {\n @case ('multi') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_multi_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_multi_selection}}\n }\n @case ('range') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_range_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_range_selection}}\n }\n @default {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_single_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_single_selection}}\n }\n }\n </div>\n <section\n class=\"igx-calendar__pickers\"\n [class.igx-calendar__pickers--days]=\"isDefaultView\"\n [class.igx-calendar__pickers--vertical]=\"orientation === 'vertical'\"\n >\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <ng-container *ngTemplateOutlet=\"calendarDaysPicker; context: {$implicit: i}\"></ng-container>\n }\n }\n\n @if (isYearView) {\n <ng-container *ngTemplateOutlet=\"calendarYearPicker\"></ng-container>\n }\n\n @if (isDecadeView) {\n <ng-container *ngTemplateOutlet=\"calendarDecadePicker\"></ng-container>\n }\n </section>\n\n <section class=\"igx-calendar__body\" [class.igx-calendar__body--vertical]=\"orientation === 'vertical'\" role=\"presentation\">\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <igx-days-view\n #days\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [selection]=\"selection\"\n [locale]=\"locale\"\n [value]=\"value\"\n [(activeDate)]=\"activeDate\"\n [(previewRangeDate)]=\"previewRangeDate\"\n [viewDate]=\"i | IgxGetViewDate: viewDate\"\n [weekStart]=\"weekStart\"\n [formatOptions]=\"formatOptions\"\n [formatViews]=\"formatViews\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [style.--calendar-row-start]=\"(i + 1) * 2\"\n [hideLeadingDays]=\"hideOutsideDays || i !== 0\"\n [hideTrailingDays]=\"hideOutsideDays || i !== monthsViewNumber - 1\"\n [showWeekNumbers]=\"showWeekNumbers\"\n [showActiveDay]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (dateSelected)=\"handleDateSelection($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-days-view>\n }\n }\n\n @if (isYearView) {\n <igx-months-view\n #months\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.month\"\n [monthFormat]=\"formatOptions.month\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeMonth($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-months-view>\n }\n\n @if (isDecadeView) {\n <igx-years-view\n #decade\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.year\"\n [yearFormat]=\"formatOptions.year\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeYear($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-years-view>\n }\n </section>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: IgxCalendarScrollPageDirective, selector: "[igxCalendarScrollPage]", inputs: ["startScroll", "stopScroll"] }, { kind: "component", type: IgxIconComponent, selector: "igx-icon", inputs: ["ariaHidden", "family", "name", "active"] }, { kind: "component", type: IgxDaysViewComponent, selector: "igx-days-view", inputs: ["id", "tabIndex", "role", "standalone", "showWeekNumbers", "activeDate", "previewRangeDate", "hideLeadingDays", "hideTrailingDays", "showActiveDay"], outputs: ["dateSelected", "pageChanged", "activeDateChange", "previewRangeDateChange"] }, { kind: "component", type: IgxMonthsViewComponent, selector: "igx-months-view", inputs: ["id", "standalone", "monthFormat", "formatView"] }, { kind: "component", type: IgxYearsViewComponent, selector: "igx-years-view", inputs: ["standalone", "yearFormat"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: IgxMonthViewSlotsCalendar, name: "IgxMonthViewSlots" }, { kind: "pipe", type: IgxGetViewDateCalendar, name: "IgxGetViewDate" }] }); }
|
|
3441
|
+
], queries: [{ propertyName: "headerTemplateDirective", first: true, predicate: i0.forwardRef(() => IgxCalendarHeaderTemplateDirective), descendants: true, read: IgxCalendarHeaderTemplateDirective, static: true }, { propertyName: "headerTitleTemplateDirective", first: true, predicate: i0.forwardRef(() => IgxCalendarHeaderTitleTemplateDirective), descendants: true, read: IgxCalendarHeaderTitleTemplateDirective, static: true }, { propertyName: "subheaderTemplateDirective", first: true, predicate: i0.forwardRef(() => IgxCalendarSubheaderTemplateDirective), descendants: true, read: IgxCalendarSubheaderTemplateDirective, static: true }], viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }, { propertyName: "dacadeView", first: true, predicate: ["decade"], descendants: true, read: IgxYearsViewComponent }, { propertyName: "monthsView", first: true, predicate: ["months"], descendants: true, read: IgxMonthsViewComponent }, { propertyName: "daysView", first: true, predicate: ["days"], descendants: true, read: IgxDaysViewComponent }, { propertyName: "prevPageBtn", first: true, predicate: ["prevPageBtn"], descendants: true }, { propertyName: "nextPageBtn", first: true, predicate: ["nextPageBtn"], descendants: true }, { propertyName: "monthsBtns", predicate: ["monthsBtn"], descendants: true }, { propertyName: "monthViews", predicate: ["days"], descendants: true, read: IgxDaysViewComponent }], usesInheritance: true, ngImport: i0, template: "<ng-template let-result #defaultHeaderTitle>\n @if (selection === 'single') {\n <span>{{ resourceStrings.igx_calendar_select_date }}</span>\n }\n @if (selection === 'range') {\n <span>{{ resourceStrings.igx_calendar_range_placeholder }}</span>\n }\n</ng-template>\n\n<ng-template let-result #defaultHeaderDate>\n @if (selection === 'single') {\n <span>{{ getFormattedDate().weekday }}, </span>\n <span>{{ getFormattedDate().monthday }}</span>\n }\n @if (selection === 'range') {\n <span>{{ selectedDates.length === 0 ? 'Start' : getFormattedRange().start}}</span>\n <span> - </span>\n <span>{{ selectedDates.length <= 1 ? 'End' : getFormattedRange().end}}</span>\n }\n</ng-template>\n\n<!-- Month -->\n<ng-template #defaultMonth let-obj>\n <span\n #monthsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'LLLL') + ', ' + resourceStrings.igx_calendar_select_month\"\n (keydown)=\"onActiveViewYearKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewYear($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedMonth(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Year -->\n<ng-template #defaultYear let-obj>\n @if (activeView === 'year') {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">{{ formattedYear(obj.date) }}</span>\n }\n <span\n #yearsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'yyyy') + ', ' + resourceStrings.igx_calendar_select_year\"\n (keydown)=\"onActiveViewDecadeKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewDecade($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedYear(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Month Year -->\n<ng-template #defaultMonthYear let-obj let-result>\n @if (monthsViewNumber < 2 || obj.index < 1) {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">\n {{ monthsViewNumber > 1 ?\n (resourceStrings.igx_calendar_first_picker_of.replace('{0}', monthsViewNumber.toString()) + ' ' +\n (obj.date | date: 'LLLL yyyy')) :\n resourceStrings.igx_calendar_selected_month_is + (obj.date | date: 'LLLL yyyy')}}\n </span>\n }\n <ng-container *ngTemplateOutlet=\"defaultMonth; context: {$implicit: obj}\"></ng-container>\n <ng-container *ngTemplateOutlet=\"defaultYear; context: {$implicit: obj}\"></ng-container>\n</ng-template>\n\n<!-- Decade -->\n<ng-template #defaultDecade>\n <span>{{ getDecadeRange().start }} - {{ getDecadeRange().end }}</span>\n</ng-template>\n\n<!-- Previous arrow icon -->\n<ng-template #prevArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_prev\"></igx-icon>\n</ng-template>\n\n<!-- Next arrow icon -->\n<ng-template #nextArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_next\"></igx-icon>\n</ng-template>\n\n<!-- Previous picker button -->\n<ng-template #prevPageButton let-obj>\n <div\n #prevPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__prev\"\n role=\"button\"\n [attr.aria-label]=\"prevNavLabel((getPrevMonth(viewDate) | date: 'LLLL'))\"\n data-action=\"prev\"\n igxCalendarScrollPage\n [startScroll]=\"startPrevPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"prevArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Next picker button -->\n<ng-template #nextPageButton let-obj>\n <div\n #nextPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__next\"\n role=\"button\"\n [attr.aria-label]=\"nextNavLabel((getNextMonth(viewDate, monthsViewNumber) | date: 'LLLL'))\"\n data-action=\"next\"\n igxCalendarScrollPage\n [startScroll]=\"startNextPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"nextArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- PICKER IN DAYS -->\n<ng-template #calendarDaysPicker let-i>\n <section class=\"igx-calendar-picker\" [style.--calendar-row-start]=\"1 + (2 * i)\">\n <div class=\"igx-calendar-picker__dates\" [attr.data-month]=\"i | IgxGetViewDate:viewDate:false\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultMonthYear; context: getContext(i)\">\n </ng-container>\n </div>\n @if (this.orientation === 'horizontal' ? i === monthsViewNumber - 1 : i === 0) {\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n }\n </section>\n</ng-template>\n\n<!-- PICKER IN MONTHS -->\n<ng-template #calendarYearPicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultYear; context: getContext(0)\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<!-- PICKER IN YEARS -->\n<ng-template #calendarDecadePicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\" aria-live=\"polite\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultDecade;\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n\n@if (selection === 'single' && hasHeader || selection === 'range' && hasHeader) {\n <header\n aria-labelledby=\"igx-aria-calendar-title-month igx-aria-calendar-title-year\"\n class=\"igx-calendar__header\"\n >\n <h5 id=\"igx-aria-calendar-title-year\" class=\"igx-calendar__header-year\">\n <ng-container *ngTemplateOutlet=\"headerTitleTemplate ?? defaultHeaderTitle; context: headerContext\"></ng-container>\n </h5>\n <h2 id=\"igx-aria-calendar-title-month\" class=\"igx-calendar__header-date\">\n <ng-container *ngTemplateOutlet=\"headerTemplate ? headerTemplate : defaultHeaderDate; context: headerContext\">\n </ng-container>\n </h2>\n </header>\n}\n\n\n<div\n #wrapper\n [style.--calendar-months]=\"monthsViewNumber\"\n [tabIndex]=\"0\"\n class=\"igx-calendar__wrapper\"\n [class.igx-calendar__wrapper--vertical]=\"orientation === 'vertical'\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-multiselectable]=\"selection !== 'single'\"\n aria-labelledby=\"calendar-desc\"\n role=\"grid\"\n (focus)=\"this.onWrapperFocus($event)\"\n (blur)=\"this.onWrapperBlur($event)\"\n >\n <div id=\"calendar-desc\" tabindex=\"-1\" class=\"igx-calendar__aria-off-screen\">\n @switch (selection) {\n @case ('multi') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_multi_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_multi_selection}}\n }\n @case ('range') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_range_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_range_selection}}\n }\n @default {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_single_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_single_selection}}\n }\n }\n </div>\n <section\n class=\"igx-calendar__pickers\"\n [class.igx-calendar__pickers--days]=\"isDefaultView\"\n [class.igx-calendar__pickers--vertical]=\"orientation === 'vertical'\"\n >\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <ng-container *ngTemplateOutlet=\"calendarDaysPicker; context: {$implicit: i}\"></ng-container>\n }\n }\n\n @if (isYearView) {\n <ng-container *ngTemplateOutlet=\"calendarYearPicker\"></ng-container>\n }\n\n @if (isDecadeView) {\n <ng-container *ngTemplateOutlet=\"calendarDecadePicker\"></ng-container>\n }\n </section>\n\n <section class=\"igx-calendar__body\" [class.igx-calendar__body--vertical]=\"orientation === 'vertical'\" role=\"presentation\">\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <igx-days-view\n #days\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [selection]=\"selection\"\n [locale]=\"locale\"\n [value]=\"value\"\n [(activeDate)]=\"activeDate\"\n [(previewRangeDate)]=\"previewRangeDate\"\n [viewDate]=\"i | IgxGetViewDate: viewDate\"\n [weekStart]=\"weekStart\"\n [formatOptions]=\"formatOptions\"\n [formatViews]=\"formatViews\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [style.--calendar-row-start]=\"(i + 1) * 2\"\n [hideLeadingDays]=\"hideOutsideDays || i !== 0\"\n [hideTrailingDays]=\"hideOutsideDays || i !== monthsViewNumber - 1\"\n [showWeekNumbers]=\"showWeekNumbers\"\n [showActiveDay]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (dateSelected)=\"handleDateSelection($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-days-view>\n }\n }\n\n @if (isYearView) {\n <igx-months-view\n #months\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.month\"\n [monthFormat]=\"formatOptions.month\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeMonth($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-months-view>\n }\n\n @if (isDecadeView) {\n <igx-years-view\n #decade\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.year\"\n [yearFormat]=\"formatOptions.year\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeYear($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-years-view>\n }\n </section>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: IgxCalendarScrollPageDirective, selector: "[igxCalendarScrollPage]", inputs: ["startScroll", "stopScroll"] }, { kind: "component", type: IgxIconComponent, selector: "igx-icon", inputs: ["ariaHidden", "family", "name", "active"] }, { kind: "component", type: IgxDaysViewComponent, selector: "igx-days-view", inputs: ["id", "tabIndex", "role", "standalone", "showWeekNumbers", "activeDate", "previewRangeDate", "hideLeadingDays", "hideTrailingDays", "showActiveDay"], outputs: ["dateSelected", "pageChanged", "activeDateChange", "previewRangeDateChange"] }, { kind: "component", type: IgxMonthsViewComponent, selector: "igx-months-view", inputs: ["id", "standalone", "monthFormat", "formatView"] }, { kind: "component", type: IgxYearsViewComponent, selector: "igx-years-view", inputs: ["standalone", "yearFormat"] }, { kind: "pipe", type: IgxDateFormatterPipe, name: "date" }, { kind: "pipe", type: IgxMonthViewSlotsCalendar, name: "IgxMonthViewSlots" }, { kind: "pipe", type: IgxGetViewDateCalendar, name: "IgxGetViewDate" }] }); }
|
|
3417
3442
|
}
|
|
3418
3443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxCalendarComponent, decorators: [{
|
|
3419
3444
|
type: Component,
|
|
@@ -3427,7 +3452,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
3427
3452
|
multi: false,
|
|
3428
3453
|
provide: KeyboardNavigationService,
|
|
3429
3454
|
},
|
|
3430
|
-
], selector: 'igx-calendar', imports: [NgTemplateOutlet, IgxCalendarScrollPageDirective, IgxIconComponent, IgxDaysViewComponent, IgxMonthsViewComponent, IgxYearsViewComponent, DatePipe, IgxMonthViewSlotsCalendar, IgxGetViewDateCalendar], template: "<ng-template let-result #defaultHeaderTitle>\n @if (selection === 'single') {\n <span>{{ resourceStrings.igx_calendar_select_date }}</span>\n }\n @if (selection === 'range') {\n <span>{{ resourceStrings.igx_calendar_range_placeholder }}</span>\n }\n</ng-template>\n\n<ng-template let-result #defaultHeaderDate>\n @if (selection === 'single') {\n <span>{{ getFormattedDate().weekday }}, </span>\n <span>{{ getFormattedDate().monthday }}</span>\n }\n @if (selection === 'range') {\n <span>{{ selectedDates.length === 0 ? 'Start' : getFormattedRange().start}}</span>\n <span> - </span>\n <span>{{ selectedDates.length <= 1 ? 'End' : getFormattedRange().end}}</span>\n }\n</ng-template>\n\n<!-- Month -->\n<ng-template #defaultMonth let-obj>\n <span\n #monthsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'LLLL') + ', ' + resourceStrings.igx_calendar_select_month\"\n (keydown)=\"onActiveViewYearKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewYear($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedMonth(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Year -->\n<ng-template #defaultYear let-obj>\n @if (activeView === 'year') {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">{{ formattedYear(obj.date) }}</span>\n }\n <span\n #yearsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'yyyy') + ', ' + resourceStrings.igx_calendar_select_year\"\n (keydown)=\"onActiveViewDecadeKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewDecade($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedYear(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Month Year -->\n<ng-template #defaultMonthYear let-obj let-result>\n @if (monthsViewNumber < 2 || obj.index < 1) {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">\n {{ monthsViewNumber > 1 ?\n (resourceStrings.igx_calendar_first_picker_of.replace('{0}', monthsViewNumber.toString()) + ' ' +\n (obj.date | date: 'LLLL yyyy')) :\n resourceStrings.igx_calendar_selected_month_is + (obj.date | date: 'LLLL yyyy')}}\n </span>\n }\n <ng-container *ngTemplateOutlet=\"defaultMonth; context: {$implicit: obj}\"></ng-container>\n <ng-container *ngTemplateOutlet=\"defaultYear; context: {$implicit: obj}\"></ng-container>\n</ng-template>\n\n<!-- Decade -->\n<ng-template #defaultDecade>\n <span>{{ getDecadeRange().start }} - {{ getDecadeRange().end }}</span>\n</ng-template>\n\n<!-- Previous arrow icon -->\n<ng-template #prevArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_prev\"></igx-icon>\n</ng-template>\n\n<!-- Next arrow icon -->\n<ng-template #nextArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_next\"></igx-icon>\n</ng-template>\n\n<!-- Previous picker button -->\n<ng-template #prevPageButton let-obj>\n <div\n #prevPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__prev\"\n role=\"button\"\n [attr.aria-label]=\"prevNavLabel((getPrevMonth(viewDate) | date: 'LLLL'))\"\n data-action=\"prev\"\n igxCalendarScrollPage\n [startScroll]=\"startPrevPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"prevArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Next picker button -->\n<ng-template #nextPageButton let-obj>\n <div\n #nextPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__next\"\n role=\"button\"\n [attr.aria-label]=\"nextNavLabel((getNextMonth(viewDate, monthsViewNumber) | date: 'LLLL'))\"\n data-action=\"next\"\n igxCalendarScrollPage\n [startScroll]=\"startNextPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"nextArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- PICKER IN DAYS -->\n<ng-template #calendarDaysPicker let-i>\n <section class=\"igx-calendar-picker\" [style.--calendar-row-start]=\"1 + (2 * i)\">\n <div class=\"igx-calendar-picker__dates\" [attr.data-month]=\"i | IgxGetViewDate:viewDate:false\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultMonthYear; context: getContext(i)\">\n </ng-container>\n </div>\n @if (this.orientation === 'horizontal' ? i === monthsViewNumber - 1 : i === 0) {\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n }\n </section>\n</ng-template>\n\n<!-- PICKER IN MONTHS -->\n<ng-template #calendarYearPicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultYear; context: getContext(0)\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<!-- PICKER IN YEARS -->\n<ng-template #calendarDecadePicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\" aria-live=\"polite\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultDecade;\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n\n@if (selection === 'single' && hasHeader || selection === 'range' && hasHeader) {\n <header\n aria-labelledby=\"igx-aria-calendar-title-month igx-aria-calendar-title-year\"\n class=\"igx-calendar__header\"\n >\n <h5 id=\"igx-aria-calendar-title-year\" class=\"igx-calendar__header-year\">\n <ng-container *ngTemplateOutlet=\"headerTitleTemplate ?? defaultHeaderTitle; context: headerContext\"></ng-container>\n </h5>\n <h2 id=\"igx-aria-calendar-title-month\" class=\"igx-calendar__header-date\">\n <ng-container *ngTemplateOutlet=\"headerTemplate ? headerTemplate : defaultHeaderDate; context: headerContext\">\n </ng-container>\n </h2>\n </header>\n}\n\n\n<div\n #wrapper\n [style.--calendar-months]=\"monthsViewNumber\"\n [tabIndex]=\"0\"\n class=\"igx-calendar__wrapper\"\n [class.igx-calendar__wrapper--vertical]=\"orientation === 'vertical'\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-multiselectable]=\"selection !== 'single'\"\n aria-labelledby=\"calendar-desc\"\n role=\"grid\"\n (focus)=\"this.onWrapperFocus($event)\"\n (blur)=\"this.onWrapperBlur($event)\"\n >\n <div id=\"calendar-desc\" tabindex=\"-1\" class=\"igx-calendar__aria-off-screen\">\n @switch (selection) {\n @case ('multi') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_multi_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_multi_selection}}\n }\n @case ('range') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_range_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_range_selection}}\n }\n @default {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_single_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_single_selection}}\n }\n }\n </div>\n <section\n class=\"igx-calendar__pickers\"\n [class.igx-calendar__pickers--days]=\"isDefaultView\"\n [class.igx-calendar__pickers--vertical]=\"orientation === 'vertical'\"\n >\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <ng-container *ngTemplateOutlet=\"calendarDaysPicker; context: {$implicit: i}\"></ng-container>\n }\n }\n\n @if (isYearView) {\n <ng-container *ngTemplateOutlet=\"calendarYearPicker\"></ng-container>\n }\n\n @if (isDecadeView) {\n <ng-container *ngTemplateOutlet=\"calendarDecadePicker\"></ng-container>\n }\n </section>\n\n <section class=\"igx-calendar__body\" [class.igx-calendar__body--vertical]=\"orientation === 'vertical'\" role=\"presentation\">\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <igx-days-view\n #days\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [selection]=\"selection\"\n [locale]=\"locale\"\n [value]=\"value\"\n [(activeDate)]=\"activeDate\"\n [(previewRangeDate)]=\"previewRangeDate\"\n [viewDate]=\"i | IgxGetViewDate: viewDate\"\n [weekStart]=\"weekStart\"\n [formatOptions]=\"formatOptions\"\n [formatViews]=\"formatViews\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [style.--calendar-row-start]=\"(i + 1) * 2\"\n [hideLeadingDays]=\"hideOutsideDays || i !== 0\"\n [hideTrailingDays]=\"hideOutsideDays || i !== monthsViewNumber - 1\"\n [showWeekNumbers]=\"showWeekNumbers\"\n [showActiveDay]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (dateSelected)=\"handleDateSelection($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-days-view>\n }\n }\n\n @if (isYearView) {\n <igx-months-view\n #months\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.month\"\n [monthFormat]=\"formatOptions.month\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeMonth($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-months-view>\n }\n\n @if (isDecadeView) {\n <igx-years-view\n #decade\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.year\"\n [yearFormat]=\"formatOptions.year\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeYear($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-years-view>\n }\n </section>\n</div>\n" }]
|
|
3455
|
+
], selector: 'igx-calendar', imports: [NgTemplateOutlet, IgxCalendarScrollPageDirective, IgxIconComponent, IgxDaysViewComponent, IgxMonthsViewComponent, IgxYearsViewComponent, IgxDateFormatterPipe, IgxMonthViewSlotsCalendar, IgxGetViewDateCalendar], template: "<ng-template let-result #defaultHeaderTitle>\n @if (selection === 'single') {\n <span>{{ resourceStrings.igx_calendar_select_date }}</span>\n }\n @if (selection === 'range') {\n <span>{{ resourceStrings.igx_calendar_range_placeholder }}</span>\n }\n</ng-template>\n\n<ng-template let-result #defaultHeaderDate>\n @if (selection === 'single') {\n <span>{{ getFormattedDate().weekday }}, </span>\n <span>{{ getFormattedDate().monthday }}</span>\n }\n @if (selection === 'range') {\n <span>{{ selectedDates.length === 0 ? 'Start' : getFormattedRange().start}}</span>\n <span> - </span>\n <span>{{ selectedDates.length <= 1 ? 'End' : getFormattedRange().end}}</span>\n }\n</ng-template>\n\n<!-- Month -->\n<ng-template #defaultMonth let-obj>\n <span\n #monthsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'LLLL') + ', ' + resourceStrings.igx_calendar_select_month\"\n (keydown)=\"onActiveViewYearKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewYear($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedMonth(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Year -->\n<ng-template #defaultYear let-obj>\n @if (activeView === 'year') {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">{{ formattedYear(obj.date) }}</span>\n }\n <span\n #yearsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'yyyy') + ', ' + resourceStrings.igx_calendar_select_year\"\n (keydown)=\"onActiveViewDecadeKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewDecade($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedYear(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Month Year -->\n<ng-template #defaultMonthYear let-obj let-result>\n @if (monthsViewNumber < 2 || obj.index < 1) {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">\n {{ monthsViewNumber > 1 ?\n (resourceStrings.igx_calendar_first_picker_of.replace('{0}', monthsViewNumber.toString()) + ' ' +\n (obj.date | date: 'LLLL yyyy')) :\n resourceStrings.igx_calendar_selected_month_is + (obj.date | date: 'LLLL yyyy')}}\n </span>\n }\n <ng-container *ngTemplateOutlet=\"defaultMonth; context: {$implicit: obj}\"></ng-container>\n <ng-container *ngTemplateOutlet=\"defaultYear; context: {$implicit: obj}\"></ng-container>\n</ng-template>\n\n<!-- Decade -->\n<ng-template #defaultDecade>\n <span>{{ getDecadeRange().start }} - {{ getDecadeRange().end }}</span>\n</ng-template>\n\n<!-- Previous arrow icon -->\n<ng-template #prevArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_prev\"></igx-icon>\n</ng-template>\n\n<!-- Next arrow icon -->\n<ng-template #nextArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_next\"></igx-icon>\n</ng-template>\n\n<!-- Previous picker button -->\n<ng-template #prevPageButton let-obj>\n <div\n #prevPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__prev\"\n role=\"button\"\n [attr.aria-label]=\"prevNavLabel((getPrevMonth(viewDate) | date: 'LLLL'))\"\n data-action=\"prev\"\n igxCalendarScrollPage\n [startScroll]=\"startPrevPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"prevArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Next picker button -->\n<ng-template #nextPageButton let-obj>\n <div\n #nextPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__next\"\n role=\"button\"\n [attr.aria-label]=\"nextNavLabel((getNextMonth(viewDate, monthsViewNumber) | date: 'LLLL'))\"\n data-action=\"next\"\n igxCalendarScrollPage\n [startScroll]=\"startNextPageScroll\"\n [stopScroll]=\"stopPageScroll\"\n (keydown)=\"$event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"nextArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- PICKER IN DAYS -->\n<ng-template #calendarDaysPicker let-i>\n <section class=\"igx-calendar-picker\" [style.--calendar-row-start]=\"1 + (2 * i)\">\n <div class=\"igx-calendar-picker__dates\" [attr.data-month]=\"i | IgxGetViewDate:viewDate:false\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultMonthYear; context: getContext(i)\">\n </ng-container>\n </div>\n @if (this.orientation === 'horizontal' ? i === monthsViewNumber - 1 : i === 0) {\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n }\n </section>\n</ng-template>\n\n<!-- PICKER IN MONTHS -->\n<ng-template #calendarYearPicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultYear; context: getContext(0)\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<!-- PICKER IN YEARS -->\n<ng-template #calendarDecadePicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\" aria-live=\"polite\">\n <ng-container\n *ngTemplateOutlet=\"subheaderTemplate ? subheaderTemplate : defaultDecade;\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n\n@if (selection === 'single' && hasHeader || selection === 'range' && hasHeader) {\n <header\n aria-labelledby=\"igx-aria-calendar-title-month igx-aria-calendar-title-year\"\n class=\"igx-calendar__header\"\n >\n <h5 id=\"igx-aria-calendar-title-year\" class=\"igx-calendar__header-year\">\n <ng-container *ngTemplateOutlet=\"headerTitleTemplate ?? defaultHeaderTitle; context: headerContext\"></ng-container>\n </h5>\n <h2 id=\"igx-aria-calendar-title-month\" class=\"igx-calendar__header-date\">\n <ng-container *ngTemplateOutlet=\"headerTemplate ? headerTemplate : defaultHeaderDate; context: headerContext\">\n </ng-container>\n </h2>\n </header>\n}\n\n\n<div\n #wrapper\n [style.--calendar-months]=\"monthsViewNumber\"\n [tabIndex]=\"0\"\n class=\"igx-calendar__wrapper\"\n [class.igx-calendar__wrapper--vertical]=\"orientation === 'vertical'\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-multiselectable]=\"selection !== 'single'\"\n aria-labelledby=\"calendar-desc\"\n role=\"grid\"\n (focus)=\"this.onWrapperFocus($event)\"\n (blur)=\"this.onWrapperBlur($event)\"\n >\n <div id=\"calendar-desc\" tabindex=\"-1\" class=\"igx-calendar__aria-off-screen\">\n @switch (selection) {\n @case ('multi') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_multi_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_multi_selection}}\n }\n @case ('range') {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_range_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_range_selection}}\n }\n @default {\n {{ monthsViewNumber && monthsViewNumber > 1 ?\n resourceStrings.igx_calendar_single_selection.replace('{0}', monthsViewNumber.toString()) :\n resourceStrings.igx_calendar_singular_single_selection}}\n }\n }\n </div>\n <section\n class=\"igx-calendar__pickers\"\n [class.igx-calendar__pickers--days]=\"isDefaultView\"\n [class.igx-calendar__pickers--vertical]=\"orientation === 'vertical'\"\n >\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <ng-container *ngTemplateOutlet=\"calendarDaysPicker; context: {$implicit: i}\"></ng-container>\n }\n }\n\n @if (isYearView) {\n <ng-container *ngTemplateOutlet=\"calendarYearPicker\"></ng-container>\n }\n\n @if (isDecadeView) {\n <ng-container *ngTemplateOutlet=\"calendarDecadePicker\"></ng-container>\n }\n </section>\n\n <section class=\"igx-calendar__body\" [class.igx-calendar__body--vertical]=\"orientation === 'vertical'\" role=\"presentation\">\n @if (isDefaultView) {\n @for (view of monthsViewNumber | IgxMonthViewSlots; track $index; let i = $index) {\n <igx-days-view\n #days\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [selection]=\"selection\"\n [locale]=\"locale\"\n [value]=\"value\"\n [(activeDate)]=\"activeDate\"\n [(previewRangeDate)]=\"previewRangeDate\"\n [viewDate]=\"i | IgxGetViewDate: viewDate\"\n [weekStart]=\"weekStart\"\n [formatOptions]=\"formatOptions\"\n [formatViews]=\"formatViews\"\n [disabledDates]=\"disabledDates\"\n [specialDates]=\"specialDates\"\n [style.--calendar-row-start]=\"(i + 1) * 2\"\n [hideLeadingDays]=\"hideOutsideDays || i !== 0\"\n [hideTrailingDays]=\"hideOutsideDays || i !== monthsViewNumber - 1\"\n [showWeekNumbers]=\"showWeekNumbers\"\n [showActiveDay]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (dateSelected)=\"handleDateSelection($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-days-view>\n }\n }\n\n @if (isYearView) {\n <igx-months-view\n #months\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.month\"\n [monthFormat]=\"formatOptions.month\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeMonth($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-months-view>\n }\n\n @if (isDecadeView) {\n <igx-years-view\n #decade\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.year\"\n [yearFormat]=\"formatOptions.year\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (pageChanged)=\"updateYear($event)\"\n (activeDateChanged)=\"updateActiveDescendant($event)\"\n (selected)=\"changeYear($event)\"\n (mousedown)=\"$event.preventDefault()\">\n </igx-years-view>\n }\n </section>\n</div>\n" }]
|
|
3431
3456
|
}], propDecorators: { wrapper: [{
|
|
3432
3457
|
type: ViewChild,
|
|
3433
3458
|
args: ["wrapper"]
|
|
@@ -3711,6 +3736,9 @@ class IgxMonthPickerComponent extends IgxCalendarBaseDirective {
|
|
|
3711
3736
|
currentValue: this.viewDate
|
|
3712
3737
|
});
|
|
3713
3738
|
});
|
|
3739
|
+
this._destroyRef.onDestroy(() => {
|
|
3740
|
+
this.keyboardNavigation.detachKeyboardHandlers();
|
|
3741
|
+
});
|
|
3714
3742
|
}
|
|
3715
3743
|
onWrapperFocus(event) {
|
|
3716
3744
|
event.stopPropagation();
|
|
@@ -3797,13 +3825,6 @@ class IgxMonthPickerComponent extends IgxCalendarBaseDirective {
|
|
|
3797
3825
|
this.dacadeView.onKeydownEnd(event);
|
|
3798
3826
|
}
|
|
3799
3827
|
}
|
|
3800
|
-
/**
|
|
3801
|
-
* @hidden
|
|
3802
|
-
* @internal
|
|
3803
|
-
*/
|
|
3804
|
-
ngOnDestroy() {
|
|
3805
|
-
this.keyboardNavigation.detachKeyboardHandlers();
|
|
3806
|
-
}
|
|
3807
3828
|
/**
|
|
3808
3829
|
* @hidden
|
|
3809
3830
|
* @internal
|
|
@@ -3862,7 +3883,7 @@ class IgxMonthPickerComponent extends IgxCalendarBaseDirective {
|
|
|
3862
3883
|
multi: false,
|
|
3863
3884
|
provide: KeyboardNavigationService
|
|
3864
3885
|
},
|
|
3865
|
-
], viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }, { propertyName: "monthsView", first: true, predicate: ["months"], descendants: true, read: IgxMonthsViewComponent }, { propertyName: "dacadeView", first: true, predicate: ["decade"], descendants: true, read: IgxYearsViewComponent }, { propertyName: "daysView", first: true, predicate: ["days"], descendants: true, read: IgxDaysViewComponent }, { propertyName: "yearsBtn", first: true, predicate: ["yearsBtn"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Previous arrow icon -->\n<ng-template #prevArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_prev\"></igx-icon>\n</ng-template>\n\n<!-- Next arrow icon -->\n<ng-template #nextArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_next\"></igx-icon>\n</ng-template>\n\n<!-- Previous picker button -->\n<ng-template #prevPageButton let-obj>\n <div\n #prevPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__prev\"\n role=\"button\"\n [attr.aria-label]=\"prevNavLabel((getPrevYearDate(viewDate) | date: 'yyyy'))\"\n data-action=\"prev\"\n igxCalendarScrollPage\n (mousedown)=\"previousPage()\"\n (keydown)=\"changePageKB($event, false)\"\n >\n <ng-container *ngTemplateOutlet=\"prevArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Next picker button -->\n<ng-template #nextPageButton let-obj>\n <div\n #nextPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__next\"\n role=\"button\"\n [attr.aria-label]=\"nextNavLabel((getNextYearDate(viewDate) | date: 'yyyy'))\"\n data-action=\"next\"\n igxCalendarScrollPage\n (mousedown)=\"nextPage()\"\n (keydown)=\"changePageKB($event)\"\n >\n <ng-container *ngTemplateOutlet=\"nextArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Year -->\n<ng-template #defaultYear let-obj>\n @if (activeView === 'year') {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">{{ formattedYear(obj.date) }}</span>\n }\n <span\n #yearsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'yyyy') + ', ' + resourceStrings.igx_calendar_select_year\"\n (keydown)=\"onActiveViewDecadeKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewDecade($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedYear(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Decade -->\n<ng-template #defaultDecade>\n <span>{{ getDecadeRange().start }} - {{ getDecadeRange().end }}</span>\n</ng-template>\n\n<!-- PICKER IN MONTHS -->\n<ng-template #calendarYearPicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\">\n <ng-container\n *ngTemplateOutlet=\"defaultYear; context: getContext(0)\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<!-- PICKER IN YEARS -->\n<ng-template #calendarDecadePicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\" aria-live=\"polite\">\n <ng-container\n *ngTemplateOutlet=\"defaultDecade;\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<div\n #wrapper\n [tabIndex]=\"0\"\n class=\"igx-calendar__wrapper\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-multiselectable]=\"selection !== 'single'\"\n aria-labelledby=\"calendar-desc\"\n role=\"grid\"\n (focus)=\"this.onWrapperFocus($event)\"\n (blur)=\"this.onWrapperBlur($event)\"\n >\n <caption id=\"calendar-desc\" tabindex=\"-1\" class=\"igx-calendar__aria-off-screen\">\n {{ resourceStrings.igx_calendar_singular_single_selection}}\n </caption>\n\n <section class=\"igx-calendar__pickers\">\n @if (isDefaultView) {\n <ng-container *ngTemplateOutlet=\"calendarYearPicker\"></ng-container>\n }\n\n @if (isDecadeView) {\n <ng-container *ngTemplateOutlet=\"calendarDecadePicker\"></ng-container>\n }\n </section>\n\n <section class=\"igx-calendar__body\">\n @if (isDefaultView) {\n <igx-months-view\n #months\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.month\"\n [monthFormat]=\"formatOptions.month\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (selected)=\"selectMonth($event)\"\n (pageChanged)=\"updateDate($event)\"\n (mousedown)=\"$event.preventDefault()\">\n >\n </igx-months-view>\n }\n\n @if (isDecadeView) {\n <igx-years-view\n #decade\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.year\"\n [yearFormat]=\"formatOptions.year\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (selected)=\"selectYear($event)\"\n (pageChanged)=\"updateDate($event)\"\n (mousedown)=\"$event.preventDefault()\"\n >\n </igx-years-view>\n }\n </section>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IgxIconComponent, selector: "igx-icon", inputs: ["ariaHidden", "family", "name", "active"] }, { kind: "component", type: IgxMonthsViewComponent, selector: "igx-months-view", inputs: ["id", "standalone", "monthFormat", "formatView"] }, { kind: "component", type: IgxYearsViewComponent, selector: "igx-years-view", inputs: ["standalone", "yearFormat"] }, { kind: "pipe", type:
|
|
3886
|
+
], viewQueries: [{ propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true }, { propertyName: "monthsView", first: true, predicate: ["months"], descendants: true, read: IgxMonthsViewComponent }, { propertyName: "dacadeView", first: true, predicate: ["decade"], descendants: true, read: IgxYearsViewComponent }, { propertyName: "daysView", first: true, predicate: ["days"], descendants: true, read: IgxDaysViewComponent }, { propertyName: "yearsBtn", first: true, predicate: ["yearsBtn"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Previous arrow icon -->\n<ng-template #prevArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_prev\"></igx-icon>\n</ng-template>\n\n<!-- Next arrow icon -->\n<ng-template #nextArrow let-obj>\n <igx-icon aria-hidden=\"true\" family=\"default\" name=\"arrow_next\"></igx-icon>\n</ng-template>\n\n<!-- Previous picker button -->\n<ng-template #prevPageButton let-obj>\n <div\n #prevPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__prev\"\n role=\"button\"\n [attr.aria-label]=\"prevNavLabel((getPrevYearDate(viewDate) | date: 'yyyy'))\"\n data-action=\"prev\"\n igxCalendarScrollPage\n (mousedown)=\"previousPage()\"\n (keydown)=\"changePageKB($event, false)\"\n >\n <ng-container *ngTemplateOutlet=\"prevArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Next picker button -->\n<ng-template #nextPageButton let-obj>\n <div\n #nextPageBtn\n tabindex=\"0\"\n class=\"igx-calendar-picker__next\"\n role=\"button\"\n [attr.aria-label]=\"nextNavLabel((getNextYearDate(viewDate) | date: 'yyyy'))\"\n data-action=\"next\"\n igxCalendarScrollPage\n (mousedown)=\"nextPage()\"\n (keydown)=\"changePageKB($event)\"\n >\n <ng-container *ngTemplateOutlet=\"nextArrow\"></ng-container>\n </div>\n</ng-template>\n\n<!-- Year -->\n<ng-template #defaultYear let-obj>\n @if (activeView === 'year') {\n <span class=\"igx-calendar__aria-off-screen\" aria-live=\"polite\">{{ formattedYear(obj.date) }}</span>\n }\n <span\n #yearsBtn\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"(obj.date | date: 'yyyy') + ', ' + resourceStrings.igx_calendar_select_year\"\n (keydown)=\"onActiveViewDecadeKB(obj.date, $event, obj.index)\"\n (mousedown)=\"onActiveViewDecade($event, obj.date, obj.index)\"\n class=\"igx-calendar-picker__date\">\n {{ formattedYear(obj.date) }}\n </span>\n</ng-template>\n\n<!-- Decade -->\n<ng-template #defaultDecade>\n <span>{{ getDecadeRange().start }} - {{ getDecadeRange().end }}</span>\n</ng-template>\n\n<!-- PICKER IN MONTHS -->\n<ng-template #calendarYearPicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\">\n <ng-container\n *ngTemplateOutlet=\"defaultYear; context: getContext(0)\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<!-- PICKER IN YEARS -->\n<ng-template #calendarDecadePicker>\n <section class=\"igx-calendar-picker\">\n <div class=\"igx-calendar-picker__dates\" aria-live=\"polite\">\n <ng-container\n *ngTemplateOutlet=\"defaultDecade;\">\n </ng-container>\n </div>\n <div class=\"igx-calendar-picker__nav\">\n <ng-container *ngTemplateOutlet=\"prevPageButton\"></ng-container>\n <ng-container *ngTemplateOutlet=\"nextPageButton\"></ng-container>\n </div>\n </section>\n</ng-template>\n\n<div\n #wrapper\n [tabIndex]=\"0\"\n class=\"igx-calendar__wrapper\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-multiselectable]=\"selection !== 'single'\"\n aria-labelledby=\"calendar-desc\"\n role=\"grid\"\n (focus)=\"this.onWrapperFocus($event)\"\n (blur)=\"this.onWrapperBlur($event)\"\n >\n <caption id=\"calendar-desc\" tabindex=\"-1\" class=\"igx-calendar__aria-off-screen\">\n {{ resourceStrings.igx_calendar_singular_single_selection}}\n </caption>\n\n <section class=\"igx-calendar__pickers\">\n @if (isDefaultView) {\n <ng-container *ngTemplateOutlet=\"calendarYearPicker\"></ng-container>\n }\n\n @if (isDecadeView) {\n <ng-container *ngTemplateOutlet=\"calendarDecadePicker\"></ng-container>\n }\n </section>\n\n <section class=\"igx-calendar__body\">\n @if (isDefaultView) {\n <igx-months-view\n #months\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.month\"\n [monthFormat]=\"formatOptions.month\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (selected)=\"selectMonth($event)\"\n (pageChanged)=\"updateDate($event)\"\n (mousedown)=\"$event.preventDefault()\">\n >\n </igx-months-view>\n }\n\n @if (isDecadeView) {\n <igx-years-view\n #decade\n role=\"rowgroup\"\n [tabIndex]=\"-1\"\n [date]=\"viewDate\"\n [locale]=\"locale\"\n [formatView]=\"formatViews.year\"\n [yearFormat]=\"formatOptions.year\"\n [showActive]=\"showActiveDay\"\n [standalone]=\"false\"\n (swiperight)=\"previousPage()\"\n (swipeleft)=\"nextPage()\"\n (selected)=\"selectYear($event)\"\n (pageChanged)=\"updateDate($event)\"\n (mousedown)=\"$event.preventDefault()\"\n >\n </igx-years-view>\n }\n </section>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IgxIconComponent, selector: "igx-icon", inputs: ["ariaHidden", "family", "name", "active"] }, { kind: "component", type: IgxMonthsViewComponent, selector: "igx-months-view", inputs: ["id", "standalone", "monthFormat", "formatView"] }, { kind: "component", type: IgxYearsViewComponent, selector: "igx-years-view", inputs: ["standalone", "yearFormat"] }, { kind: "pipe", type: IgxDateFormatterPipe, name: "date" }] }); }
|
|
3866
3887
|
}
|
|
3867
3888
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxMonthPickerComponent, decorators: [{
|
|
3868
3889
|
type: Component,
|
|
@@ -3878,7 +3899,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
3878
3899
|
},
|
|
3879
3900
|
], selector: "igx-month-picker", imports: [
|
|
3880
3901
|
NgTemplateOutlet,
|
|
3881
|
-
|
|
3902
|
+
IgxDateFormatterPipe,
|
|
3882
3903
|
IgxIconComponent,
|
|
3883
3904
|
IgxMonthsViewComponent,
|
|
3884
3905
|
IgxYearsViewComponent,
|