-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calendar - expose views as separate components + advanced KB navigation #3855
Changes from 15 commits
68b8fb7
795eaba
2b2caf1
2267bd2
dedd966
b21a16d
141df15
9d9bf6d
4dbbb51
8fbaaf0
ca14b1f
c02327a
9b14056
c099138
b5d3199
608ab7c
355d69b
e19ca0b
c5f73a2
41b9cab
dfe69f8
5fb077f
62f7e89
a316523
3d9f3f7
7e4ef24
407f5ec
e4fff2b
58e24e3
46c5750
ac0a77d
0d080f4
59b0db5
5ee9c87
40d65ba
893e59d
40df56c
1a5e56d
43b23ea
13c645e
ed99de2
e333cde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ | |
</ng-template> | ||
|
||
<ng-template let-result #defaultMonth> | ||
<span (click)="activeViewYear()" class="igx-calendar-picker__date"> | ||
<span tabindex="0" (keydown)="activeViewYearKB($event)" (click)="activeViewYear()" class="igx-calendar-picker__date"> | ||
{{ formattedMonth(viewDate) }} | ||
</span> | ||
<span (click)="activeViewDecade()" class="igx-calendar-picker__date"> | ||
<span tabindex="0" (keydown)="activeViewDecadeKB($event)" (click)="activeViewDecade()" class="igx-calendar-picker__date"> | ||
{{ formattedYear(viewDate) }} | ||
</span> | ||
</ng-template> | ||
|
@@ -22,44 +22,41 @@ <h2 class="igx-calendar__header-date"> | |
|
||
<div *ngIf="isDefaultView" class="igx-calendar__body" [@animateView]="activeView" (swiperight)="previousMonth()" (swipeleft)="nextMonth()"> | ||
<div class="igx-calendar-picker"> | ||
<div class="igx-calendar-picker__prev" (click)="previousMonth()"> | ||
<div tabindex="0" class="igx-calendar-picker__prev" (keydown.space)="previousMonthKB($event)" (click)="previousMonth()"> | ||
<igx-icon fontSet="material">keyboard_arrow_left</igx-icon> | ||
</div> | ||
<div> | ||
<ng-container *ngTemplateOutlet="subheaderTemplate ? subheaderTemplate : defaultMonth; context: context"> | ||
</ng-container> | ||
</div> | ||
<div class="igx-calendar-picker__next" (click)="nextMonth()"> | ||
<div tabindex="0" class="igx-calendar-picker__next" (keydown.space)="nextMonthKB($event)" (click)="nextMonth()"> | ||
<igx-icon fontSet="material">keyboard_arrow_right</igx-icon> | ||
</div> | ||
</div> | ||
|
||
<div class="igx-calendar__body-row"> | ||
<span *ngFor="let dayName of generateWeekHeader()" class="igx-calendar__label"> | ||
{{ dayName | titlecase }} | ||
</span> | ||
</div> | ||
|
||
<div *ngFor="let week of getCalendarMonth; last as isLast; index as i; trackBy: rowTracker" class="igx-calendar__body-row" [@animateChange]="monthAction" | ||
(@animateChange.done)="animationDone($event, isLast)"> | ||
<span [igxCalendarDate]="day" (onDateSelection)="childClicked($event)" *ngFor="let day of week; trackBy: dateTracker"> | ||
{{ formattedDate(day.date) }} | ||
</span> | ||
</div> | ||
<igx-days-view [changeDaysView]="true" #days | ||
[animationAction]="monthAction" | ||
[locale]="locale" | ||
[value]="value" | ||
[weekStart]="weekStart" | ||
[viewDate]="viewDate" | ||
[selection]="selection" | ||
[disabledDates]="disabledDates" | ||
[specialDates]="specialDates" | ||
(onDateSelection)="childClicked($event)"> | ||
</igx-days-view> | ||
</div> | ||
|
||
<div *ngIf="isYearView" class="igx-calendar__body" [@animateView]="activeView"> | ||
<div class="igx-calendar__body-row--wrap"> | ||
<div (onMonthSelection)="changeMonth($event)" [igxCalendarMonth]="month" [index]="i" *ngFor="let month of months; index as i;"> | ||
{{ formattedMonth(month) | titlecase }} | ||
</div> | ||
</div> | ||
</div> | ||
<igx-months-view *ngIf="isYearView" [@animateView]="activeView" #months | ||
[date]="viewDate" | ||
[locale]="locale" | ||
[monthFormat]="_formatOptions.month" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use public property |
||
(onMonthSelection)="changeMonth($event)" > | ||
</igx-months-view> | ||
|
||
<div *ngIf="isDecadeView" class="igx-calendar__body" [@animateView]="activeView"> | ||
<div class="igx-calendar__body-column" (wheel)="onScroll($event)" (pan)="onPan($event)"> | ||
<span (onYearSelection)="changeYear($event)" [igxCalendarYear]="year" *ngFor="let year of decade"> | ||
{{ formattedYear(year) }} | ||
</span> | ||
</div> | ||
</div> | ||
<igx-years-view *ngIf="isDecadeView" [@animateView]="activeView" #decade | ||
[date]="viewDate" | ||
[locale]="locale" | ||
[yearFormat]="_formatOptions.year" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use public property |
||
(onYearSelection)="changeYear($event)"> | ||
</igx-years-view> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename
onDateSelection
toonSelection
. Applicable to all new views.