Skip to content

Commit 665fa80

Browse files
Merge branch 'bpenkov/overlay-close-on-escape' of https://github.com/IgniteUI/igniteui-angular into bpenkov/overlay-close-on-escape
2 parents 448fb37 + 8529e50 commit 665fa80

30 files changed

+442
-118
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ All notable changes for each version of this project will be documented in this
1111
- Added new property - `closeOnEsc` - in `OverlaySettings`. The overlay can now be prevented from closing, on escape keypress, by setting the property to `false`, by default it's `true`.
1212
- `igxDialog`
1313
- Added `closeOnEscapeKey` - with it, the dialog can be allowed or prevented from closing when `Esc` is pressed.
14+
- `IgxNavbar`:
15+
- **Breaking Changes** - The `igx-action-icon` has been renamed to `igx-navbar-action`. It should get renamed in your components via `ng update`;
1416
### New Features
1517
- `IgxGridState` directive
1618
- Added support for expansion states, column selection and row pinning.
@@ -23,6 +25,8 @@ All notable changes for each version of this project will be documented in this
2325
- `IgxSnackbar`
2426
- `message` property has been deprecated. You can place the *message text* in the snackbar content or pass it as parameter to `show` method instead.
2527
- An optional string parameter `message` has been added to `show()` method.
28+
- `IgxNavbar`
29+
- Added new `igx-navbar-title, igxNavbarTitle` directive that can be used to provide custom content for navbar title. It would override the value of `title` input property.
2630

2731
## 10.0.0
2832

angularDocsPostDeploy.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Write-Host "Check file exists: " ([System.IO.File]::Exists($filePath))
6161
Write-Host "Check dir exists:" ([System.IO.Directory]::Exists($angularDocsRootFolder));
6262

6363
if([System.IO.File]::Exists($filePath) -and [System.IO.Directory]::Exists($angularDocsRootFolder)) {
64-
$folders = Get-ChildItem -Path $angularDocsRootFolder -Directory -Exclude $tagFolder,"sass","typescript";
64+
$folders = Get-ChildItem -Path $angularDocsRootFolder -Directory -Exclude $tagFolder,"sass","typescript" -Name | Sort-Object @{Expression = {[double]($_.Substring(0, $_.LastIndexOf('.'))) }};
6565
$textToUpdate = "";
6666
foreach($item in $folders) {
6767
$textToUpdate += '"' + $item.Name + '"';
@@ -72,4 +72,4 @@ if([System.IO.File]::Exists($filePath) -and [System.IO.Directory]::Exists($angul
7272
$content = [System.IO.File]::ReadAllText($filePath);
7373
$newContent = $content -replace "\[.*\]", $textToUpdate;
7474
[System.IO.File]::WriteAllText($filePath,$newContent);
75-
}
75+
}

projects/igniteui-angular/migrations/migration-collection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
"version": "9.1.0",
7676
"description": "Updates Ignite UI for Angular from v9.0.x to v9.1.0",
7777
"factory": "./update-9_1_0"
78+
},
79+
"migration-16": {
80+
"version": "10.1.0",
81+
"description": "Updates Ignite UI for Angular from v10.0.x to v10.1.0",
82+
"factory": "./update-10_1_0"
7883
}
7984
}
8085
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "../../common/schema/class.schema.json",
3+
"changes": [
4+
{
5+
"name": "IgxActionIconDirective",
6+
"replaceWith": "IgxNavbarActionDirective"
7+
}
8+
]
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../common/schema/selector.schema.json",
3+
"changes": [
4+
{
5+
"type": "component",
6+
"selector": "igx-action-icon",
7+
"replaceWith": "igx-navbar-action"
8+
}
9+
]
10+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import * as path from 'path';
2+
3+
// tslint:disable:no-implicit-dependencies
4+
import { virtualFs } from '@angular-devkit/core';
5+
import { EmptyTree } from '@angular-devkit/schematics';
6+
// tslint:disable-next-line:no-submodule-imports
7+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
8+
9+
describe('Update 10.1.0', () => {
10+
let appTree: UnitTestTree;
11+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
12+
const configJson = {
13+
defaultProject: 'testProj',
14+
projects: {
15+
testProj: {
16+
sourceRoot: '/testSrc'
17+
}
18+
},
19+
schematics: {
20+
'@schematics/angular:component': {
21+
prefix: 'appPrefix'
22+
}
23+
}
24+
};
25+
26+
beforeEach(() => {
27+
appTree = new UnitTestTree(new EmptyTree());
28+
appTree.create('/angular.json', JSON.stringify(configJson));
29+
});
30+
31+
it('should upgrade the igx-action-icon to igx-navbar-action', async () => {
32+
appTree.create(
33+
'/testSrc/appPrefix/component/custom.component.html',
34+
`<igx-navbar title="Test title">
35+
<igx-action-icon>
36+
<igx-icon>arrow_back</igx-icon>
37+
</igx-action-icon>
38+
</igx-navbar>`);
39+
const tree = await schematicRunner.runSchematicAsync('migration-16', {}, appTree)
40+
.toPromise();
41+
42+
expect(tree.readContent('/testSrc/appPrefix/component/custom.component.html'))
43+
.toEqual(
44+
`<igx-navbar title="Test title">
45+
<igx-navbar-action>
46+
<igx-icon>arrow_back</igx-icon>
47+
</igx-navbar-action>
48+
</igx-navbar>`);
49+
});
50+
51+
it('should update IgxActionIconDirective to IgxNavbarActionDirective', async () => {
52+
appTree.create('/testSrc/appPrefix/component/custom.component.ts',
53+
`import { IgxActionIconDirective } from 'igniteui-angular';
54+
export class TestNavbar {
55+
@ViewChild(IgxActionIconDirective, { read: IgxActionIconDirective })
56+
private actionIcon: IgxActionIconDirective; }`);
57+
58+
const tree = await schematicRunner.runSchematicAsync('migration-16', {}, appTree).toPromise();
59+
60+
expect(tree.readContent('/testSrc/appPrefix/component/custom.component.ts'))
61+
.toEqual(
62+
`import { IgxNavbarActionDirective } from 'igniteui-angular';
63+
export class TestNavbar {
64+
@ViewChild(IgxNavbarActionDirective, { read: IgxNavbarActionDirective })
65+
private actionIcon: IgxNavbarActionDirective; }`);
66+
});
67+
68+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges, InputPropertyType, BoundPropertyObject } from '../common/UpdateChanges';
7+
8+
const version = '10.1.0';
9+
10+
export default function (): Rule {
11+
return (host: Tree, context: SchematicContext) => {
12+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
13+
14+
const update = new UpdateChanges(__dirname, host, context);
15+
update.applyChanges();
16+
};
17+
}

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Directive, Inject } from '@angular/core';
22
import { IgxActionStripComponent } from '../action-strip.component';
33
import { IgxRowDirective } from '../../grids/public_api';
4+
import { IgxGridIconService } from '../../grids/common/grid-icon.service';
45

56
@Directive({
67
selector: '[igxGridActionsBase]'
78
})
89
export class IgxGridActionsBaseDirective {
9-
constructor(@Inject(IgxActionStripComponent) protected strip: IgxActionStripComponent) { }
10+
constructor(@Inject(IgxActionStripComponent) protected strip: IgxActionStripComponent, protected iconService: IgxGridIconService) { }
1011

1112
/**
1213
* Getter to be used in template
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* tslint:disable */
2+
export const PINNING_ACTIONS_ICONS_FONT_SET = 'pinning-actions-icons';
3+
export const PINNING_ACTIONS_ICONS = [
4+
{
5+
name: 'jump_up',
6+
value: `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
7+
<path d="M6 8l4 4H7c0 3.31 2.69 6 6 6 1.01 0 1.97-.25 2.8-.7l1.46 1.46A7.93 7.93 0 0113 20c-4.42 0-8-3.58-8-8H2l4-4zm15-5v2H5V3h16z"/>
8+
</svg>`
9+
},
10+
{
11+
name: 'jump_down',
12+
value: `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
13+
<path d="M21 19v2H5v-2h16zM13 4c1.57 0 3.03.46 4.26 1.24L15.8 6.7A5.87 5.87 0 0013 6c-3.31 0-6 2.69-6 6h3l-4 4-4-4h3c0-4.42 3.58-8 8-8z"/>
14+
</svg>`
15+
}
16+
];
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<ng-container *ngIf="isRowContext">
22
<button *ngIf="inPinnedArea && pinnedTop" igxRipple igxButton="icon" (click)="scrollToRow($event)">
3-
<igx-icon fontSet="filtering-icons" name="jump_down"></igx-icon>
3+
<igx-icon fontSet="pinning-actions-icons" name="jump_down"></igx-icon>
44
</button>
55
<button *ngIf="inPinnedArea && !pinnedTop" igxRipple igxButton="icon" (click)="scrollToRow($event)">
6-
<igx-icon fontSet="filtering-icons" name="jump_up"></igx-icon>
6+
<igx-icon fontSet="pinning-actions-icons" name="jump_up"></igx-icon>
77
</button>
88
<button *ngIf="!pinned" igxRipple igxButton="icon" (click)="pin($event)">
9-
<igx-icon fontSet="filtering-icons" name="pin"></igx-icon>
9+
<igx-icon fontSet="pinning-icons" name="pin"></igx-icon>
1010
</button>
1111
<button *ngIf="pinned" igxRipple igxButton="icon" (click)="unpin($event)">
12-
<igx-icon fontSet="filtering-icons" name="unpin"></igx-icon>
12+
<igx-icon fontSet="pinning-icons" name="unpin"></igx-icon>
1313
</button>
1414
</ng-container>

0 commit comments

Comments
 (0)