Skip to content

Commit c7c6e8f

Browse files
authored
Merge branch 'master' into astaev/tabsStyleMigrations
2 parents baed352 + a0777f4 commit c7c6e8f

File tree

126 files changed

+1101
-929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1101
-929
lines changed

CHANGELOG.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ All notable changes for each version of this project will be documented in this
99
- **Breaking Change** - The `locale` and `pipeArgs` parameters are removed from the `operate` method exposed by the `IgxNumberSummaryOperand`, `IgxDateSummaryOperand`, `IgxCurrencySummaryOperand` and `IgxPercentSummaryOperand`. They are now set in the `igx-grid-summary-cell` template. To change the locale and format setting of the `igx-grid-summary-cell` the user can use the new `summaryFormatter` property of the `IgxColumnComponent`.
1010
- `IgxTabs`, `IgxBottomNav`
1111
- **Breaking Change** - `IgxTabs` and `IgxBottomNav` components were completely refactored in order to provide more flexible and descriptive way to define tab headers and contents. Please make sure to update via `ng update` in order to migrate the existing `igx-tabs` and `igx-bottom-nav` definitions to the new ones.
12+
- `IgxForOfDirective`
13+
- **Breaking Change** - `IgxForOfDirective` events are renamed as follows:
14+
- `onChunkLoad` -> `chunkLoad`
15+
- `onScrollbarVisibilityChanged` -> `scrollbarVisibilityChanged`
16+
- `onContentSizeChange` -> `contentSizeChange`
17+
- `onDataChanged` -> `dataChanged`
18+
- `onBeforeViewDestroyed` -> `beforeViewDestroyed`
19+
- `onChunkPreload` -> `chunkPreload`
20+
- `onDataChanging` -> `dataChanging`
21+
- `IgxColumnComponent`
22+
- **Breaking Change** - The `onColumnChange` output is renamed to `columnChange`.
23+
- **Breaking Change** - `IgxHierarchicalGrid` and `igxRowIsland` events are renamed as follows:
24+
- `onGridCreated` -> `gridCreated`
25+
- `onGridInitialized` -> `gridInitialized`
26+
- `onDataPreLoad` -> `dataPreLoad`
1227

1328
### New Features
1429
- `IgxForOf`, `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
@@ -47,7 +62,9 @@ All notable changes for each version of this project will be documented in this
4762
- The `igx-tab-header` supports `igx-prefix` and `igx-suffix` directives in its `ng-content`.
4863
- `IgxBottomNav`
4964
- The `IgxBottomNav` component exposes `disableAnimations` property which determines whether the contents should animate when switching the selected item. The property is set to `true` by default which means that the animations are disabled.
50-
65+
- `IgxOverlayService`
66+
- `detach` and `detachAll` methods are added to `IgxOverlayService`. Calling `detach` will remove all the elements generated for the related overlay, as well as clean up all related resources. Calling `detachAll` will remove all elements generated by any call to `IgxOverlay` `attach`, and will clean up all related resources. _Note: calling `hide` or `hideAll` will not clean generated by the service elements and will not clean up related resources._
67+
5168
### Themes:
5269
- Breaking Changes:
5370
- `IgxButton` theme has been simplified. The number of theme params (`igx-button-theme`) has been reduced significantly and no longer includes prefixed parameters (`flat-*`, `raised-*`, etc.). See the migration guide to update existing button themes. Updates performed with `ng update` will migrate existing button themes but some additional tweaking may be required to account for the abscense of prefixed params.
@@ -60,13 +77,6 @@ All notable changes for each version of this project will be documented in this
6077
```
6178

6279

63-
64-
65-
### New Features
66-
- `IgxOverlayService`
67-
- `detach` and `detachAll` methods are added to `IgxOverlayService`. Calling `detach` will remove all the elements generated for the related overlay, as well as clean up all related resources. Calling `detachAll` will remove all elements generated by any call to `IgxOverlay` `attach`, and will clean up all related resources. _Note: calling `hide` or `hideAll` will not clean generated by the service elements and will not clean up related resources._
68-
69-
7080
## 11.1.1
7181

7282
### New Features
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "../../common/schema/members-changes.schema.json",
3+
"changes": [
4+
{
5+
"member": "onColumnChange",
6+
"replaceWith": "columnChange",
7+
"definedIn": [
8+
"IgxColumnComponent"
9+
]
10+
}
11+
]
12+
}

projects/igniteui-angular/migrations/update-12_0_0/changes/outputs.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,102 @@
88
"selector": "igx-column",
99
"type": "component"
1010
}
11+
},
12+
{
13+
"name": "onChunkLoad",
14+
"replaceWith": "chunkLoad",
15+
"owner": {
16+
"selector": "[igxFor][igxForOf]",
17+
"type": "directive"
18+
}
19+
},
20+
{
21+
"name": "onScrollbarVisibilityChanged",
22+
"replaceWith": "scrollbarVisibilityChanged",
23+
"owner": {
24+
"selector": "[igxFor][igxForOf]",
25+
"type": "directive"
26+
}
27+
},
28+
{
29+
"name": "onContentSizeChange",
30+
"replaceWith": "contentSizeChange",
31+
"owner": {
32+
"selector": "[igxFor][igxForOf]",
33+
"type": "directive"
34+
}
35+
},
36+
{
37+
"name": "onDataChanged",
38+
"replaceWith": "dataChanged",
39+
"owner": {
40+
"selector": "[igxFor][igxForOf]",
41+
"type": "directive"
42+
}
43+
},
44+
{
45+
"name": "onBeforeViewDestroyed",
46+
"replaceWith": "beforeViewDestroyed",
47+
"owner": {
48+
"selector": "[igxFor][igxForOf]",
49+
"type": "directive"
50+
}
51+
},
52+
{
53+
"name": "onChunkPreload",
54+
"replaceWith": "chunkPreload",
55+
"owner": {
56+
"selector": "[igxFor][igxForOf]",
57+
"type": "directive"
58+
}
59+
},
60+
{
61+
"name": "onDataChanging",
62+
"replaceWith": "dataChanging",
63+
"owner": {
64+
"selector": "[igxFor][igxForOf]",
65+
"type": "directive"
66+
}
67+
},
68+
{
69+
"name": "onGridCreated",
70+
"replaceWith": "gridCreated",
71+
"owner": {
72+
"selector": "igx-row-island",
73+
"type": "component"
74+
}
75+
},
76+
{
77+
"name": "onGridInitialized",
78+
"replaceWith": "gridInitialized",
79+
"owner": {
80+
"selector": "igx-row-island",
81+
"type": "component"
82+
}
83+
},
84+
{
85+
"name": "onDataPreLoad",
86+
"replaceWith": "dataPreLoad",
87+
"owner": {
88+
"selector": "igx-hierarchical-grid",
89+
"type": "component"
90+
}
91+
},
92+
{
93+
"name": "onDataPreLoad",
94+
"replaceWith": "dataPreLoad",
95+
"owner": {
96+
"selector": "igx-grid",
97+
"type": "component"
98+
}
99+
},
100+
{
101+
"name": "onColumnToggled",
102+
"replaceWith": "columnToggled",
103+
"owner": {
104+
"selector": "igx-column-actions",
105+
"type": "component"
106+
}
11107
}
12108
]
13109
}

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ describe('igxGridEditingActions #grid ', () => {
7777
expect(grid.rowList.first.rowData['ID']).toBe('ANATR');
7878
expect(dataLenght - 1).toBe(grid.dataLength);
7979
});
80+
81+
it('should focus the first cell when editing mode is cell', () => {
82+
fixture.detectChanges();
83+
grid.selectRange({rowStart: 0, rowEnd: 0, columnStart: 'ContactName', columnEnd: 'ContactName'});
84+
fixture.detectChanges();
85+
grid.actionStrip.show(grid.rowList.first);
86+
fixture.detectChanges();
87+
const editIcon = fixture.debugElement.queryAll(By.css(`igx-grid-editing-actions igx-icon`))[0];
88+
expect(editIcon.nativeElement.innerText).toBe('edit');
89+
editIcon.parent.triggerEventHandler('click', new Event('click'));
90+
fixture.detectChanges();
91+
// first cell of the row should be the active one, excluding ID as primaryKey
92+
expect(grid.selectionService.activeElement.column).toBe(1);
93+
expect(grid.selectionService.activeElement.row).toBe(0);
94+
});
8095
});
8196

8297
describe('Menu ', () => {

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
105105
// be sure row is in view
106106
if (grid.rowList.filter(r => r === row).length !== 0) {
107107
grid.gridAPI.crudService.enterEditMode(firstEditable, event);
108+
firstEditable.activate();
108109
}
109110
this.strip.hide();
110111
}

projects/igniteui-angular/src/lib/calendar/calendar-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { WEEKDAYS, Calendar, isDateInRanges, IFormattingOptions, IFormattingView
33
import { ControlValueAccessor } from '@angular/forms';
44
import { DateRangeDescriptor } from '../core/dates';
55
import { noop, Subject } from 'rxjs';
6-
import { isDate, mkenum } from '../core/utils';
6+
import { isDate, mkenum, PlatformUtil } from '../core/utils';
77
import { IgxCalendarView } from './month-picker-base';
88
import { CurrentResourceStrings } from '../core/i18n/resources';
99
import { ICalendarResourceStrings } from '../core/i18n/calendar-resources';
@@ -433,7 +433,7 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
433433
/**
434434
* @hidden
435435
*/
436-
constructor() {
436+
constructor(protected platform: PlatformUtil) {
437437
this.calendarModel = new Calendar();
438438

439439
this.viewDate = this.viewDate ? this.viewDate : new Date();

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
IgxCalendarHeaderTemplateDirective,
2020
IgxCalendarSubheaderTemplateDirective
2121
} from './calendar.directives';
22-
import { KEYS } from '../core/utils';
2322
import { ICalendarDate, monthRange } from './calendar';
2423
import { CalendarView, IgxCalendarView, IgxMonthPickerBaseDirective } from './month-picker-base';
2524
import { IgxMonthsViewComponent } from './months-view/months-view.component';
@@ -700,7 +699,7 @@ export class IgxCalendarComponent extends IgxMonthPickerBaseDirective implements
700699
* @hidden
701700
* @internal
702701
*/
703-
public stopMonthScroll = (event) => {
702+
public stopMonthScroll = (event: KeyboardEvent) => {
704703
event.stopPropagation();
705704

706705
// generally the scrolling is built on the calendar component
@@ -716,7 +715,7 @@ export class IgxCalendarComponent extends IgxMonthPickerBaseDirective implements
716715
} else if (this.monthScrollDirection === ScrollMonth.NEXT) {
717716
this.nextMonthBtn.nativeElement.focus();
718717
}
719-
if (event.key === KEYS.SPACE || event.key === KEYS.SPACE_IE || event.key === KEYS.ENTER) {
718+
if (this.platform.isActivationKey(event)) {
720719
this.resetActiveDate();
721720
}
722721

@@ -839,8 +838,8 @@ export class IgxCalendarComponent extends IgxMonthPickerBaseDirective implements
839838
* @hidden
840839
* @internal
841840
*/
842-
public onActiveViewYearKB(args: Date, event, activeViewIdx: number): void {
843-
if (event.key === KEYS.SPACE || event.key === KEYS.SPACE_IE || event.key === KEYS.ENTER) {
841+
public onActiveViewYearKB(args: Date, event: KeyboardEvent, activeViewIdx: number): void {
842+
if (this.platform.isActivationKey(event)) {
844843
event.preventDefault();
845844
this.onActiveViewYear(args, activeViewIdx);
846845
}

projects/igniteui-angular/src/lib/calendar/calendar.directives.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
} from '@angular/core';
2121
import { fromEvent, Subject, interval } from 'rxjs';
2222
import { takeUntil, debounce, tap } from 'rxjs/operators';
23-
import { KEYS } from '../core/utils';
23+
import { PlatformUtil } from '../core/utils';
2424

2525
/**
2626
* @hidden
@@ -68,7 +68,7 @@ export class IgxCalendarYearDirective {
6868
return this.elementRef.nativeElement;
6969
}
7070

71-
constructor(public elementRef: ElementRef) {}
71+
constructor(public elementRef: ElementRef) { }
7272

7373
@HostListener('click')
7474
public onClick() {
@@ -106,7 +106,7 @@ export class IgxCalendarMonthDirective {
106106
return this.elementRef.nativeElement;
107107
}
108108

109-
constructor(public elementRef: ElementRef) {}
109+
constructor(public elementRef: ElementRef) { }
110110

111111
@HostListener('click')
112112
public onClick() {
@@ -123,7 +123,7 @@ export class IgxCalendarMonthDirective {
123123
})
124124
export class IgxCalendarHeaderTemplateDirective {
125125

126-
constructor(public template: TemplateRef<any>) {}
126+
constructor(public template: TemplateRef<any>) { }
127127
}
128128

129129
/**
@@ -133,7 +133,7 @@ export class IgxCalendarHeaderTemplateDirective {
133133
selector: '[igxCalendarSubheader]'
134134
})
135135
export class IgxCalendarSubheaderTemplateDirective {
136-
constructor(public template: TemplateRef<any>) {}
136+
constructor(public template: TemplateRef<any>) { }
137137
}
138138

139139
/**
@@ -165,7 +165,7 @@ export class IgxCalendarScrollMonthDirective implements AfterViewInit, OnDestroy
165165
*/
166166
private destroy$ = new Subject<boolean>();
167167

168-
constructor(private element: ElementRef, private zone: NgZone) { }
168+
constructor(private element: ElementRef, private zone: NgZone, protected platform: PlatformUtil) { }
169169

170170
/**
171171
* @hidden
@@ -198,15 +198,15 @@ export class IgxCalendarScrollMonthDirective implements AfterViewInit, OnDestroy
198198
this.zone.runOutsideAngular(() => {
199199
fromEvent(this.element.nativeElement, 'keydown').pipe(
200200
tap((event: KeyboardEvent) => {
201-
if (event.key === KEYS.SPACE || event.key === KEYS.SPACE_IE || event.key === KEYS.ENTER) {
201+
if (this.platform.isActivationKey(event)) {
202202
event.preventDefault();
203203
event.stopPropagation();
204204
}
205205
}),
206206
debounce(() => interval(100)),
207207
takeUntil(this.destroy$)
208208
).subscribe((event: KeyboardEvent) => {
209-
if (event.key === KEYS.SPACE || event.key === KEYS.SPACE_IE || event.key === KEYS.ENTER) {
209+
if (this.platform.isActivationKey(event)) {
210210
this.zone.run(() => this.startScroll(true));
211211
}
212212
});

projects/igniteui-angular/src/lib/calendar/days-view/days-view.component.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
1515
import { IgxDayItemComponent } from './day-item.component';
1616
import { DateRangeDescriptor, DateRangeType } from '../../core/dates';
1717
import { IgxCalendarBaseDirective, CalendarSelection } from '../calendar-base';
18-
import { isEqual } from '../../core/utils';
18+
import { isEqual, PlatformUtil } from '../../core/utils';
1919
import { IViewChangingEventArgs } from './days-view.interface';
2020
import { IgxDaysViewNavigationService } from '../days-view/daysview-navigation.service';
2121

@@ -136,8 +136,11 @@ export class IgxDaysViewComponent extends IgxCalendarBaseDirective implements Do
136136
/**
137137
* @hidden
138138
*/
139-
constructor(public daysNavService: IgxDaysViewNavigationService) {
140-
super();
139+
constructor(
140+
public daysNavService: IgxDaysViewNavigationService,
141+
protected platform: PlatformUtil
142+
) {
143+
super(platform);
141144
}
142145

143146
/**
@@ -148,8 +151,8 @@ export class IgxDaysViewComponent extends IgxCalendarBaseDirective implements Do
148151
public resetActiveMonth() {
149152
if (this.shouldResetDate) {
150153
const date = this.dates.find(day => day.selected && day.isCurrentMonth) ||
151-
this.dates.find(day => day.isToday && day.isCurrentMonth) ||
152-
this.dates.find(d => d.isFocusable);
154+
this.dates.find(day => day.isToday && day.isCurrentMonth) ||
155+
this.dates.find(d => d.isFocusable);
153156
if (date) {
154157
this.activeDate = date.date.date.toLocaleDateString();
155158
}
@@ -307,7 +310,7 @@ export class IgxDaysViewComponent extends IgxCalendarBaseDirective implements Do
307310
let selectedDates: Date | Date[];
308311
if (this.isDateDisabled(date.date) || !this.value ||
309312
(Array.isArray(this.value) && this.value.length === 0)
310-
) {
313+
) {
311314
return false;
312315
}
313316

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IgxCalendarBaseDirective } from './calendar-base';
22
import { Directive, ViewChildren, ElementRef, QueryList, Input } from '@angular/core';
3-
import { KEYS, mkenum } from '../core/utils';
3+
import { mkenum } from '../core/utils';
44

55
export const IgxCalendarView = mkenum({
66
Month: 'month',
@@ -113,8 +113,8 @@ export class IgxMonthPickerBaseDirective extends IgxCalendarBaseDirective {
113113
/**
114114
* @hidden
115115
*/
116-
public activeViewDecadeKB(event, activeViewIdx = 0) {
117-
if (event.key === KEYS.SPACE || event.key === KEYS.SPACE_IE || event.key === KEYS.ENTER) {
116+
public activeViewDecadeKB(event: KeyboardEvent, activeViewIdx = 0) {
117+
if (this.platform.isActivationKey(event)) {
118118
event.preventDefault();
119119
this.activeViewDecade(activeViewIdx);
120120
}

0 commit comments

Comments
 (0)