Skip to content

Commit f3e529b

Browse files
authored
Merge branch '18.0.x' into mkirova/hgrid-colInit-18.0.x
2 parents 14fbc56 + 3f72185 commit f3e529b

File tree

11 files changed

+233
-133
lines changed

11 files changed

+233
-133
lines changed

projects/igniteui-angular/src/lib/calendar/month-picker/month-picker.component.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,35 @@ describe('IgxMonthPicker', () => {
525525
expect(monthPicker.activeViewChanged.emit).toHaveBeenCalled();
526526
expect(monthPicker.activeView).toEqual('year');
527527
});
528+
529+
it('should emit viewDateChanged event when changing year with arrow buttons', () => {
530+
const fixture = TestBed.createComponent(IgxMonthPickerSampleComponent);
531+
const monthPicker = fixture.componentInstance.monthPicker;
532+
spyOn(monthPicker.viewDateChanged, 'emit');
533+
534+
fixture.detectChanges();
535+
536+
const dom = fixture.debugElement;
537+
const prev = dom.query(By.css('.igx-calendar-picker__prev'));
538+
const next = dom.query(By.css('.igx-calendar-picker__next'));
539+
540+
UIInteractions.simulateMouseDownEvent(prev.nativeElement);
541+
fixture.detectChanges();
542+
543+
expect(monthPicker.viewDateChanged.emit).toHaveBeenCalledWith({
544+
previousValue: new Date(2019, 1, 1),
545+
currentValue: new Date(2018, 1, 1)
546+
});
547+
548+
UIInteractions.simulateMouseDownEvent(next.nativeElement);
549+
UIInteractions.simulateMouseDownEvent(next.nativeElement);
550+
fixture.detectChanges();
551+
552+
expect(monthPicker.viewDateChanged.emit).toHaveBeenCalledWith({
553+
previousValue: new Date(2018, 1, 1),
554+
currentValue: new Date(2019, 1, 1)
555+
});
556+
});
528557
});
529558

530559
@Component({

projects/igniteui-angular/src/lib/calendar/month-picker/month-picker.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export class IgxMonthPickerComponent extends IgxCalendarBaseDirective implements
117117
if (this.isDecadeView) {
118118
this.viewDate = CalendarDay.from(this.viewDate).add('year', -15).native;
119119
}
120+
121+
this.viewDateChanged.emit({
122+
previousValue: this.previousViewDate,
123+
currentValue: this.viewDate,
124+
});
120125
}
121126

122127
/**
@@ -134,6 +139,11 @@ export class IgxMonthPickerComponent extends IgxCalendarBaseDirective implements
134139
if (this.isDecadeView) {
135140
this.viewDate = CalendarDay.from(this.viewDate).add('year', 15).native;
136141
}
142+
143+
this.viewDateChanged.emit({
144+
previousValue: this.previousViewDate,
145+
currentValue: this.viewDate,
146+
});
137147
}
138148

139149
/**

projects/igniteui-angular/src/lib/grids/common/events.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { IBaseSearchInfo } from '../../directives/text-highlight/text-highlight.
1010

1111
/** The event arguments when data from a grid is being copied. */
1212
export interface IGridClipboardEvent {
13-
/** `data` can be of any type and referes to the data that is being copied/stored to the clipboard */
13+
/** `data` can be of any type and refers to the data that is being copied/stored to the clipboard */
1414
data: any[];
1515
/**
16-
* `cancel` returns whether an external event has interepted the copying
17-
* If the value becomes "true", it returns/exits from the method, instanciating the interface
16+
* `cancel` returns whether an external event has intercepted the copying
17+
* If the value becomes "true", it returns/exits from the method, instantiating the interface
1818
*/
1919
cancel: boolean;
2020
}
@@ -67,7 +67,7 @@ export interface IGridEditDoneEventArgs extends IBaseEventArgs {
6767
rowData: any;
6868
/**
6969
* Represents the previous (before editing) value of the edited cell.
70-
* It's used when the event has been stoped/exited.
70+
* It's used when the event has been stopped/exited.
7171
*/
7272
oldValue: any;
7373
/**
@@ -93,7 +93,7 @@ export interface IGridEditDoneEventArgs extends IBaseEventArgs {
9393
owner?: GridType;
9494
/**
9595
* Optional
96-
* Indicates if the editing cosists of adding a new row
96+
* Indicates if the editing consists of adding a new row
9797
*/
9898
isAddRow?: boolean;
9999
/**
@@ -151,7 +151,7 @@ export interface IPinColumnEventArgs extends IBaseEventArgs {
151151
insertAtIndex: number;
152152
/**
153153
* Returns the actual pin state of the column.
154-
* If pinning/unpinning is succesfull, value of `isPinned` will change accordingly when read in the "-ing" and "-ed" event.
154+
* If pinning/unpinning is successful, value of `isPinned` will change accordingly when read in the "-ing" and "-ed" event.
155155
*/
156156
isPinned: boolean;
157157
}
@@ -160,7 +160,7 @@ export interface IPinColumnEventArgs extends IBaseEventArgs {
160160
* The event arguments before a column's pin state is changed.
161161
* `insertAtIndex`specifies at which index in the pinned/unpinned area the column is inserted.
162162
* Can be changed in the `columnPin` event.
163-
* `isPinned` returns the actual pin state of the column. When pinning/unpinning is succesfull,
163+
* `isPinned` returns the actual pin state of the column. When pinning/unpinning is successful,
164164
* the value of `isPinned` will change accordingly when read in the "-ing" and "-ed" event.
165165
*/
166166
export interface IPinColumnCancellableEventArgs extends IPinColumnEventArgs, CancelableEventArgs {
@@ -190,7 +190,7 @@ export interface IRowDataEventArgs extends IBaseEventArgs {
190190

191191
/** The event arguments when a column is being resized */
192192
export interface IColumnResizeEventArgs extends IBaseEventArgs {
193-
/** Represents the informantion of the column that is being resized */
193+
/** Represents the information of the column that is being resized */
194194
column: ColumnType;
195195
/** Represents the old width of the column before the resizing */
196196
prevWidth: string;
@@ -236,7 +236,7 @@ export interface IRowSelectionEventArgs extends CancelableEventArgs, IBaseEventA
236236
}
237237

238238
/**
239-
* The event arguments when the selection state of a column is being chaged
239+
* The event arguments when the selection state of a column is being changed
240240
* The event is cancelable
241241
*/
242242
export interface IColumnSelectionEventArgs extends CancelableEventArgs, IBaseEventArgs {
@@ -288,8 +288,8 @@ export interface IGridToolbarExportEventArgs extends IBaseEventArgs {
288288
*/
289289
options: IgxExporterOptionsBase;
290290
/**
291-
* `cancel` returns whether the event has been interepted and stopped
292-
* If the value becomes "true", it returns/exits from the method, instanciating the interface
291+
* `cancel` returns whether the event has been intercepted and stopped
292+
* If the value becomes "true", it returns/exits from the method, instantiating the interface
293293
*/
294294
cancel: boolean;
295295
}
@@ -298,7 +298,7 @@ export interface IGridToolbarExportEventArgs extends IBaseEventArgs {
298298
export interface IColumnMovingStartEventArgs extends IBaseEventArgs {
299299
/**
300300
* Represents the column that is being moved.
301-
* The `ColumnType` contains the informatoin (the grid it belongs to, css data, settings, etc.) of the column in its properties
301+
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
302302
*/
303303
source: ColumnType;
304304
}
@@ -307,12 +307,12 @@ export interface IColumnMovingStartEventArgs extends IBaseEventArgs {
307307
export interface IColumnMovingEventArgs extends IBaseEventArgs {
308308
/**
309309
* Represents the column that is being moved.
310-
* The `ColumnType` contains the informatoin (the grid it belongs to, css data, settings, etc.) of the column in its properties
310+
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
311311
*/
312312
source: ColumnType;
313313
/**
314-
* `cancel` returns whether the event has been interepted and stopped
315-
* If the value becomes "true", it returns/exits from the method, instanciating the interface
314+
* `cancel` returns whether the event has been intercepted and stopped
315+
* If the value becomes "true", it returns/exits from the method, instantiating the interface
316316
*/
317317
cancel: boolean;
318318
}
@@ -321,17 +321,17 @@ export interface IColumnMovingEventArgs extends IBaseEventArgs {
321321
export interface IColumnMovingEndEventArgs extends IBaseEventArgs {
322322
/**
323323
* The source of the event represents the column that is being moved.
324-
* The `ColumnType` contains the informatoin (the grid it belongs to, css data, settings, etc.) of the column in its properties
324+
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
325325
*/
326326
source: ColumnType;
327327
/**
328328
* The target of the event represents the column, the source is being moved to.
329-
* The `ColumnType` contains the informatoin (the grid it belongs to, css data, settings, etc.) of the column in its properties
329+
* The `ColumnType` contains the information (the grid it belongs to, css data, settings, etc.) of the column in its properties
330330
*/
331331
target: ColumnType;
332332
/**
333-
* `cancel` returns whether the event has been interepted and stopped
334-
* If the value becomes "true", it returns/exits from the method, instanciating the interface
333+
* `cancel` returns whether the event has been intercepted and stopped
334+
* If the value becomes "true", it returns/exits from the method, instantiating the interface
335335
*/
336336
cancel: boolean;
337337
}
@@ -345,12 +345,12 @@ export interface IGridKeydownEventArgs extends IBaseEventArgs {
345345
targetType: GridKeydownTargetType;
346346
/** Represents the information and details of the object itself */
347347
target: any;
348-
/** Represents the original event, that occured. */
348+
/** Represents the original event, that occurred. */
349349
event: Event;
350350
/**
351351
* The event is cancelable
352-
* `cancel` returns whether the event has been interepted and stopped
353-
* If the value becomes "true", it returns/exits from the method, instanciating the interface
352+
* `cancel` returns whether the event has been intercepted and stopped
353+
* If the value becomes "true", it returns/exits from the method, instantiating the interface
354354
*/
355355
cancel: boolean;
356356
}
@@ -360,7 +360,7 @@ export interface ICellPosition {
360360
/** It returns the position (index) of the row, the cell is in */
361361
rowIndex: number;
362362
/**
363-
* It returns the position (index) of the colunm, the cell is in
363+
* It returns the position (index) of the column, the cell is in
364364
* Counts only the visible (non hidden) columns
365365
*/
366366
visibleColumnIndex: number;
@@ -391,7 +391,7 @@ export interface IRowDragStartEventArgs extends CancelableEventArgs, IBaseEventA
391391
dragElement: HTMLElement;
392392
}
393393

394-
/** Рepresents event arguments related to the row's expansion state being changed in a grid */
394+
/** Represents event arguments related to the row's expansion state being changed in a grid */
395395
export interface IRowToggleEventArgs extends IBaseEventArgs {
396396
/**
397397
* Represents the ID of the row that emitted the event (which state is changed)
@@ -406,13 +406,13 @@ export interface IRowToggleEventArgs extends IBaseEventArgs {
406406
expanded: boolean;
407407
/**
408408
* Optional
409-
* Represents the original event, that has triggered the expantion/collapse
409+
* Represents the original event, that has triggered the expansion/collapse
410410
*/
411411
event?: Event;
412412
/**
413413
* The event is cancelable
414-
* `cancel` returns whether the event has been interepted and stopped
415-
* If the value becomes "true", it returns/exits from the method, instanciating the interface
414+
* `cancel` returns whether the event has been intercepted and stopped
415+
* If the value becomes "true", it returns/exits from the method, instantiating the interface
416416
*/
417417
cancel: boolean;
418418
}
@@ -459,7 +459,7 @@ export interface IColumnToggledEventArgs extends IBaseEventArgs {
459459
checked: boolean;
460460
}
461461

462-
/** Emmited when the active node is changed */
462+
/** Emitted when the active node is changed */
463463
export interface IActiveNodeChangeEventArgs extends IBaseEventArgs {
464464
/** Represents the row index of the active node */
465465
row: number;
@@ -491,7 +491,7 @@ export interface ISortingEventArgs extends IBaseEventArgs, CancelableEventArgs {
491491
sortingExpressions?: ISortingExpression | Array<ISortingExpression>;
492492
/**
493493
* Optional
494-
* Represents the gouping expressions applied to the grid.
494+
* Represents the grouping expressions applied to the grid.
495495
* It can be a single grouping expression or an array of them
496496
* The expression contains information like the sorting expression and criteria by which the elements will be grouped
497497
*/
@@ -515,7 +515,7 @@ export interface IColumnVisibilityChangedEventArgs extends IBaseEventArgs {
515515
/** Represents the column the event originated from */
516516
column: any;
517517
/**
518-
* The new hidden state that the column will have, if operation is succesfull.
518+
* The new hidden state that the column will have, if operation is successful.
519519
* Will be `true` when hiding and `false` when showing.
520520
*/
521521
newValue: boolean;

0 commit comments

Comments
 (0)