-
Notifications
You must be signed in to change notification settings - Fork 162
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
Conversation
…iteUI/igniteui-angular into SAndreeva/calendar-views-poc
@@ -2773,7 +2773,7 @@ describe('IgxGrid - Filtering Row UI actions', () => { | |||
fix.detectChanges(); | |||
|
|||
const calendar = fix.debugElement.query(By.css('igx-calendar')); | |||
const sundayLabel = calendar.nativeElement.children[1].children[1].children[0].children[0].innerText | |||
const sundayLabel = calendar.nativeElement.children[1].children[1].children[0].children[0].innerText; |
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.
- `Tab` will navigate through the subheader buttons; | ||
|
||
When `prev` or `next` month buttons (in the subheader) are focused: | ||
- `Space` will scroll into view the next or previous month. |
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.
Space
and Enter
.
[selection]="selection" | ||
[disabledDates]="disabledDates" | ||
[specialDates]="specialDates" | ||
(onViewChnaged)="viewChanged($event)" |
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.
Typo onViewChnaged
.
[disabledDates]="disabledDates" | ||
[specialDates]="specialDates" | ||
(onViewChnaged)="viewChanged($event)" | ||
(onDateSelection)="childClicked($event)"> |
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
to onSelection
. Applicable to all new views.
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
Use public property formatOptions
instead of the protected field (which is currently public).
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
Use public property formatOptions
instead of the protected field (which is currently public).
event.preventDefault(); | ||
event.stopPropagation(); | ||
|
||
this.previousMonth(); |
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.
You could add a parameter isKeydownTrigger
to this method with default value false
. That way you won't need the code bellow.
event.preventDefault(); | ||
event.stopPropagation(); | ||
|
||
this.nextMonth(); |
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.
The same as the previous comment. Use parameter and remove the duplicated code bellow.
public specialDates: DateRangeDescriptor[]; | ||
|
||
@Output() | ||
public onDateSelection = new EventEmitter<ICalendarDate>(); |
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.
Should be onDateSelection
.
projects/igniteui-angular/src/lib/calendar/days-view/days-view.component.ts
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/calendar/days-view/days-view.component.ts
Show resolved
Hide resolved
/** | ||
* Returns the locale representation of the year in the years view. | ||
* | ||
* @hidden |
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.
This could be useful so it shouldn't be hidden.
(@animateChange.done)="animationDone()" | ||
[date]="viewDate" | ||
[locale]="locale" | ||
[monthFormat]="_formatOptions.month" |
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.
Use the public property instead of the protected field _formatOptions
.
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
* @hidden | ||
*/ | ||
@HostListener('keydown.arrowdown', ['$event']) | ||
public onKeydownArrowDown(event) { |
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.
Add type of the event argument. Applicable to all keyboard event handlers.
selector: 'igx-month-picker', | ||
templateUrl: 'month-picker.component.html' | ||
}) | ||
export class IgxMonthPickerComponent extends IgxCalendarComponent { |
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.
Shouldn't we have some public API for this component? An input to set the initial month and an event to notify on selection changes. Etc.
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.
We need to import what's exported by this file in the public_api.ts similar to what's done with the calendar component.
Please add changelog note. |
…iteUI/igniteui-angular into SAndreeva/calendar-views-poc
…iteUI/igniteui-angular into SAndreeva/calendar-views-poc
Closes #3023,
Related #3126
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes