Skip to content

Commit 1965266

Browse files
authored
Merge branch 'master' into pivot-grid-master
2 parents d31b721 + e7a9d07 commit 1965266

File tree

8 files changed

+75
-18
lines changed

8 files changed

+75
-18
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ All notable changes for each version of this project will be documented in this
66

77
### New Features
88
- `IgxCsvExporterService`, `IgxExcelExporterService`
9-
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.
9+
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.
10+
11+
### General
12+
13+
- `IgxDialog`
14+
- **Breaking Change** - The default positionSettings open/close animation has been changed to `fadeIn`/`fadeOut`. The open/close animation can be set through the position settings, e.g. change the animation to the previously default open/close animation:
15+
16+
```typescript
17+
import { slideInBottom, slideOutTop } from 'igniteui-angular';
18+
19+
@ViewChild('alert', { static: true }) public alert: IgxDialogComponent;
20+
public newPositionSettings: PositionSettings = {
21+
openAnimation: useAnimation(slideInBottom, { params: { fromPosition: 'translateY(100%)' } }),
22+
closeAnimation: useAnimation(slideOutTop, { params: { toPosition: 'translateY(-100%)'} })
23+
};
24+
this.alert.positionSettings = this.newPositionSettings;
25+
```
1026

1127
## 12.2.1
1228

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useAnimation } from '@angular/animations';
21
import { CommonModule } from '@angular/common';
32
import {
43
Component,
@@ -22,7 +21,7 @@ import { IgxRippleModule } from '../directives/ripple/ripple.directive';
2221
import { IgxDialogActionsDirective, IgxDialogTitleDirective } from './dialog.directives';
2322
import { IgxToggleModule, IgxToggleDirective } from '../directives/toggle/toggle.directive';
2423
import { OverlaySettings, GlobalPositionStrategy, NoOpScrollStrategy, PositionSettings } from '../services/public_api';
25-
import { slideInBottom, slideOutTop } from '../animations/slide/index';
24+
import {fadeIn, fadeOut} from '../animations/fade/index';
2625
import { IgxFocusModule } from '../directives/focus/focus.directive';
2726
import { CancelableEventArgs, IBaseEventArgs } from '../core/utils';
2827

@@ -459,8 +458,8 @@ export class IgxDialogComponent implements IToggleView, OnInit, OnDestroy, After
459458
protected destroy$ = new Subject<boolean>();
460459

461460
private _positionSettings: PositionSettings = {
462-
openAnimation: useAnimation(slideInBottom, { params: { fromPosition: 'translateY(100%)' } }),
463-
closeAnimation: useAnimation(slideOutTop, { params: { toPosition: 'translateY(-100%)' } })
461+
openAnimation: fadeIn,
462+
closeAnimation: fadeOut
464463
};
465464

466465
private _overlayDefaultSettings: OverlaySettings;

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7000,7 +7000,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
70007000

70017001
// eslint-disable-next-line prefer-const
70027002
for (let [row, set] of selectionMap) {
7003-
row = this.paginator ? row + (this.paginator.perPage * this.paginator.page) : row;
7003+
row = this.paginator && source === this.filteredSortedData ? row + (this.paginator.perPage * this.paginator.page) : row;
70047004
row = isRemote ? row - this.virtualizationState.startIndex : row;
70057005
if (!source[row] || source[row].detailsData !== undefined) {
70067006
continue;

projects/igniteui-angular/src/lib/grids/grid/grid.master-detail.spec.ts

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testin
33
import { configureTestSuite } from '../../test-utils/configure-suite';
44
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
55
import { By } from '@angular/platform-browser';
6-
import { UIInteractions, wait, waitForActiveNodeChange} from '../../test-utils/ui-interactions.spec';
6+
import { UIInteractions, wait, waitForActiveNodeChange } from '../../test-utils/ui-interactions.spec';
77
import { IgxGridModule } from './public_api';
88
import { IgxGridComponent } from './grid.component';
99
import { IgxGridRowComponent } from './grid-row.component';
@@ -42,7 +42,7 @@ describe('IgxGrid Master Detail #grid', () => {
4242
}));
4343

4444
describe('Basic', () => {
45-
beforeEach( fakeAsync(() => {
45+
beforeEach(fakeAsync(() => {
4646
fix = TestBed.createComponent(DefaultGridMasterDetailComponent);
4747
fix.detectChanges();
4848
grid = fix.componentInstance.grid;
@@ -689,7 +689,7 @@ describe('IgxGrid Master Detail #grid', () => {
689689

690690
describe('Integration', () => {
691691
describe('Paging', () => {
692-
it('Should not take into account expanded detail views as additional records.', fakeAsync(() => {
692+
it('Should not take into account expanded detail views as additional records.', fakeAsync(() => {
693693
fix = TestBed.createComponent(DefaultGridMasterDetailComponent);
694694
grid = fix.componentInstance.grid;
695695
fix.detectChanges();
@@ -859,6 +859,48 @@ describe('IgxGrid Master Detail #grid', () => {
859859
fix.detectChanges();
860860
expect(grid.getSelectedData()).toEqual(expectedData);
861861
}));
862+
863+
it('getSelectedData should return correct values when there are master details and paging is enabled', fakeAsync(() => {
864+
const range = { rowStart: 0, rowEnd: 5, columnStart: 'ContactName', columnEnd: 'ContactName' };
865+
const expectedDataFromSecondPage = [
866+
{ ContactName: 'Hanna Moos' },
867+
{ ContactName: 'Frédérique Citeaux' },
868+
{ ContactName: 'Martín Sommer' }
869+
];
870+
fix.componentInstance.paging = true;
871+
fix.detectChanges();
872+
grid.paginator.perPage = 5;
873+
fix.detectChanges();
874+
tick(16);
875+
grid.paginator.paginate(1);
876+
fix.detectChanges();
877+
tick(16);
878+
879+
grid.expandAll();
880+
tick(100);
881+
fix.detectChanges();
882+
883+
grid.selectRange(range);
884+
fix.detectChanges();
885+
expect(grid.getSelectedData()).toEqual(expectedDataFromSecondPage);
886+
887+
const expectedDataFromThirdPage = [
888+
{ ContactName: 'Victoria Ashworth' },
889+
{ ContactName: 'Patricio Simpson' },
890+
{ ContactName: 'Francisco Chang' }
891+
];
892+
grid.paginator.paginate(2);
893+
fix.detectChanges();
894+
tick(16);
895+
896+
grid.expandAll();
897+
tick(100);
898+
fix.detectChanges();
899+
900+
grid.selectRange(range);
901+
fix.detectChanges();
902+
expect(grid.getSelectedData()).toEqual(expectedDataFromThirdPage);
903+
}));
862904
});
863905

864906
describe('Row Selection', () => {

projects/igniteui-angular/src/lib/icon/icon.service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class IgxIconService {
105105
* this.iconService.addSvgIcon('aruba', '/assets/svg/country_flags/aruba.svg', 'svg-flags');
106106
* ```
107107
*/
108-
public addSvgIcon(name: string, url: string, family: string = '') {
108+
public addSvgIcon(name: string, url: string, family = this._family) {
109109
if (name && url) {
110110
const safeUrl = this._sanitizer.bypassSecurityTrustResourceUrl(url);
111111
if (!safeUrl) {
@@ -154,8 +154,9 @@ export class IgxIconService {
154154
* ```
155155
*/
156156
public isSvgIconCached(name: string, family: string = ''): boolean {
157-
if(this._cachedSvgIcons.has(family)) {
158-
const familyRegistry = this._cachedSvgIcons.get(family) as Map<string, SafeHtml>;
157+
const familyClassName = this.familyClassName(family);
158+
if(this._cachedSvgIcons.has(familyClassName)) {
159+
const familyRegistry = this._cachedSvgIcons.get(familyClassName) as Map<string, SafeHtml>;
159160
return familyRegistry.has(name);
160161
}
161162

@@ -169,7 +170,8 @@ export class IgxIconService {
169170
* ```
170171
*/
171172
public getSvgIcon(name: string, family: string = '') {
172-
return this._cachedSvgIcons.get(family)?.get(name);
173+
const familyClassName = this.familyClassName(family);
174+
return this._cachedSvgIcons.get(familyClassName)?.get(name);
173175
}
174176

175177
/**

projects/igniteui-angular/src/lib/services/overlay/overlay.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,6 @@ export class IgxOverlayService implements OnDestroy {
745745
wrapperElement.style.transitionDuration = '0ms';
746746
return;
747747
}
748-
if (animationOptions.type === AnimationMetadataType.AnimateRef) {
749-
animationOptions = (animationOptions as AnimationAnimateRefMetadata).animation;
750-
}
751748
if (!animationOptions.options || !animationOptions.options.params) {
752749
return;
753750
}
@@ -893,6 +890,7 @@ export class IgxOverlayService implements OnDestroy {
893890
private removeModalClasses(info: OverlayInfo) {
894891
if (info.settings.modal) {
895892
const wrapperElement = info.elementRef.nativeElement.parentElement.parentElement;
893+
this.applyAnimationParams(wrapperElement, info.settings.positionStrategy.settings.closeAnimation);
896894
wrapperElement.classList.remove('igx-overlay__wrapper--modal');
897895
wrapperElement.classList.add('igx-overlay__wrapper');
898896
}

src/app/icon/icon.sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h4 class="sample-title">Using SVG Icons</h4>
8686
<igx-icon family="svg-flags" name="equals"></igx-icon>
8787
<igx-icon family="svg-flags" name="is_empty"></igx-icon>
8888
<igx-icon family="svg-flags" name="starts_with"></igx-icon>
89-
<igx-icon family="svg-flags" name="copy"></igx-icon>
89+
<igx-icon name="copy"></igx-icon>
9090
</div>
9191
</article>
9292

src/app/icon/icon.sample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export class IconSampleComponent implements OnInit {
1919
this._iconService.addSvgIcon('equals', '/assets/svg/filtering/equals.svg', 'svg-flags');
2020
this._iconService.addSvgIcon('is_empty', '/assets/svg/filtering/is_empty.svg', 'svg-flags');
2121
this._iconService.addSvgIcon('starts_with', '/assets/svg/filtering/starts_with.svg', 'svg-flags');
22-
this._iconService.addSvgIcon('copy', '/assets/svg/filtering/copy.svg', 'svg-flags');
22+
this._iconService.addSvgIcon('copy', '/assets/svg/filtering/copy.svg');
2323
}
2424
}

0 commit comments

Comments
 (0)