Skip to content

Commit e05394f

Browse files
committed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into amarinov/issue6081_master
2 parents 933d5b5 + 83e9fb8 commit e05394f

File tree

67 files changed

+893
-220
lines changed

Some content is hidden

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

67 files changed

+893
-220
lines changed

CHANGELOG.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ All notable changes for each version of this project will be documented in this
1717
- **Behavioral Change** - Pinning columns is no longer automatically prevented when the pinning area would exceed the size of the grid.
1818

1919
### New Features
20+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`:
21+
- `sortStrategy` input is added, which can be used to set a global sorting strategy for the entire grid.
22+
(**NOTE**: The grid's `sortStrategy` is of different type compared to the column's `sortStrategy`.)
23+
- `NoopSortingStrategy` is added, which can be used to disable the default sorting of the grid by assigning its instance to the grid's `sortStrategy` input. (Useful for remote sorting.)
24+
- `NoopFilteringStrategy` is added, which can be used to disable the default filtering of the grid by assigning its instance to the grid's `filterStrategy` input. (Useful for remote filtering.)
25+
- `sortingExpressionsChange` event emitter is added, which is fired whenever a change to the sorting expressions has occurred (prior to performing the actual sorting).
26+
- `filteringExpressionsTreeChange` event emitter is added, which is fired whenever a change to the filtering expressions has occurred (prior to performing the actual filtering).
2027
- `IgxOverlayService`:
21-
- `setOffset` method added. It repositions the content in the horizontal and vertical directions.
28+
- `setOffset` method added. It offsets the content along the corresponding axis by the provided amount.
2229
- `IgxToggleDirective`:
23-
- `setOffset` method added. It repositions the content in the horizontal and vertical directions.
30+
- `setOffset` method added. It offsets the content along the corresponding axis by the provided amount.
2431

2532
## 8.2.6
2633

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

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
"factory": "./update-8_2_3"
5858
},
5959
"migration-12": {
60+
"version": "8.2.6",
61+
"description": "Updates Ignite UI for Angular from v8.2.3 to v8.2.6",
62+
"factory": "./update-8_2_6"
63+
},
64+
"migration-13": {
6065
"version": "9.0.0",
6166
"description": "Updates Ignite UI for Angular from v8.2.x to v9.2.0",
6267
"factory": "./update-9_0_0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "../../common/schema/theme-props.schema.json",
3+
"changes": [
4+
{
5+
"name": "$button-background",
6+
"remove": true,
7+
"owner": "igx-grid-toolbar-theme"
8+
},
9+
{
10+
"name": "$button-text-color",
11+
"remove": true,
12+
"owner": "igx-grid-toolbar-theme"
13+
},
14+
{
15+
"name": "$button-hover-background",
16+
"remove": true,
17+
"owner": "igx-grid-toolbar-theme"
18+
},
19+
{
20+
"name": "$button-hover-text-color",
21+
"remove": true,
22+
"owner": "igx-grid-toolbar-theme"
23+
},
24+
{
25+
"name": "$button-focus-background",
26+
"remove": true,
27+
"owner": "igx-grid-toolbar-theme"
28+
},
29+
{
30+
"name": "$button-focus-text-color",
31+
"remove": true,
32+
"owner": "igx-grid-toolbar-theme"
33+
}
34+
]
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import * as path from 'path';
2+
// tslint:disable:no-implicit-dependencies
3+
import { virtualFs } from '@angular-devkit/core';
4+
import { EmptyTree } from '@angular-devkit/schematics';
5+
// tslint:disable-next-line:no-submodule-imports
6+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
7+
8+
describe('Update 8.2.6', () => {
9+
let appTree: UnitTestTree;
10+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
11+
const configJson = {
12+
defaultProject: 'testProj',
13+
projects: {
14+
testProj: {
15+
sourceRoot: '/testSrc'
16+
}
17+
},
18+
schematics: {
19+
'@schematics/angular:component': {
20+
prefix: 'appPrefix'
21+
}
22+
}
23+
};
24+
25+
beforeEach(() => {
26+
appTree = new UnitTestTree(new EmptyTree());
27+
appTree.create('/angular.json', JSON.stringify(configJson));
28+
});
29+
30+
it('should update igx-carousel-theme prop', done => {
31+
appTree.create(
32+
'/testSrc/appPrefix/component/test.component.scss',
33+
`$my-toolbar-theme: igx-grid-toolbar-theme(
34+
$background-color: null,
35+
$button-background: null,
36+
$title-text-color: null,
37+
$button-text-color: null,
38+
$button-hover-background: null,
39+
$button-hover-text-color: null,
40+
$button-focus-background: null,
41+
$button-focus-text-color: null,
42+
$dropdown-background: null,
43+
$item-text-color: null,
44+
$item-hover-background: null,
45+
$item-hover-text-color: null,
46+
$item-focus-background: null,
47+
$item-focus-text-color: null
48+
);`
49+
);
50+
const tree = schematicRunner.runSchematic('migration-12', {}, appTree);
51+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.scss'))
52+
.toEqual(
53+
`$my-toolbar-theme: igx-grid-toolbar-theme(
54+
$background-color: null,
55+
$title-text-color: null,
56+
$dropdown-background: null,
57+
$item-text-color: null,
58+
$item-hover-background: null,
59+
$item-hover-text-color: null,
60+
$item-focus-background: null,
61+
$item-focus-text-color: null
62+
);`
63+
);
64+
done();
65+
});
66+
67+
it('should update igx-grid-paginator-theme', done => {
68+
appTree.create(
69+
'/testSrc/appPrefix/component/test.component.scss',
70+
`$dark-grid-paginator: igx-grid-paginator-theme($color: black);
71+
@include igx-grid-paginator($dark-grid-paginator);
72+
.igx-grid-paginator__pager {
73+
@include igx-button($dark-button);
74+
}
75+
$dark-grid-paginator-schema: extend($_dark-grid-pagination,());`
76+
);
77+
const tree = schematicRunner.runSchematic('migration-12', {}, appTree);
78+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.scss'))
79+
.toEqual(
80+
`$dark-grid-paginator: igx-paginator-theme($color: black);
81+
@include igx-paginator($dark-grid-paginator);
82+
.igx-grid-paginator__pager {
83+
@include igx-button($dark-button);
84+
}
85+
$dark-grid-paginator-schema: extend($_dark-pagination,());`
86+
);
87+
done();
88+
});
89+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { getProjects, getWorkspace } from '../common/util';
7+
import { UpdateChanges } from '../common/UpdateChanges';
8+
9+
const version = '8.2.6';
10+
11+
export default function(): Rule {
12+
return (host: Tree, context: SchematicContext) => {
13+
const themes = ['$_base-dark-grid-pagination',
14+
'$_dark-grid-pagination',
15+
'$_dark-fluent-grid-pagination',
16+
'$_light-grid-pagination',
17+
'$_fluent-grid-pagination',
18+
'$_round-shape-grid-pagination',
19+
'$_default-shape-grid-pagination',
20+
'$_square-shape-grid-pagination'];
21+
22+
const newThemes = ['$_base-dark-pagination',
23+
'$_dark-pagination',
24+
'$_dark-fluent-pagination',
25+
'$_light-pagination',
26+
'$_fluent-pagination',
27+
'$_round-shape-pagination',
28+
'$_default-shape-pagination',
29+
'$_square-shape-pagination'];
30+
31+
let globalStyleExt: string;
32+
const config = getWorkspace(host);
33+
const projects = getProjects(config);
34+
35+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
36+
37+
if (config.schematics && config.schematics['@schematics/angular:component']) {
38+
// updated projects have global prefix rather than per-project:
39+
globalStyleExt = config.schematics['@schematics/angular:component'].styleext;
40+
}
41+
42+
for (const proj of projects) {
43+
const dir = host.getDir(proj.sourceRoot);
44+
let ext = globalStyleExt || 'scss';
45+
if (proj.schematics && proj.schematics['@schematics/angular:component']) {
46+
ext = proj.schematics['@schematics/angular:component'].styleext || ext;
47+
}
48+
dir.visit((path, entry) => {
49+
if (path.endsWith('.' + ext)) {
50+
let content = entry.content.toString();
51+
if (content.match(/\bigx-grid-paginator\b/g)) {
52+
content = content.replace(/\bigx-grid-paginator\b/g, 'igx-paginator');
53+
}
54+
themes.forEach((n, i) => {
55+
if (content.indexOf(n) !== -1) {
56+
content = content.split(n).join(newThemes[i]);
57+
}
58+
});
59+
host.overwrite(path, content);
60+
}
61+
});
62+
}
63+
64+
const update = new UpdateChanges(__dirname, host, context);
65+
update.applyChanges();
66+
};
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "../../common/schema/theme-props.schema.json",
3+
"changes": [
4+
{
5+
"name": "$button-background",
6+
"remove": true,
7+
"owner": "igx-grid-toolbar-theme"
8+
},
9+
{
10+
"name": "$button-text-color",
11+
"remove": true,
12+
"owner": "igx-grid-toolbar-theme"
13+
},
14+
{
15+
"name": "$button-hover-background",
16+
"remove": true,
17+
"owner": "igx-grid-toolbar-theme"
18+
},
19+
{
20+
"name": "$button-hover-text-color",
21+
"remove": true,
22+
"owner": "igx-grid-toolbar-theme"
23+
},
24+
{
25+
"name": "$button-focus-background",
26+
"remove": true,
27+
"owner": "igx-grid-toolbar-theme"
28+
},
29+
{
30+
"name": "$button-focus-text-color",
31+
"remove": true,
32+
"owner": "igx-grid-toolbar-theme"
33+
}
34+
]
35+
}

projects/igniteui-angular/migrations/update-9_0_0/index.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Update 9.0.0', () => {
3535
IgxRowComponent, IgxHierarchicalGridBaseComponent } from 'igniteui-angular';
3636
`);
3737

38-
const tree = schematicRunner.runSchematic('migration-12', {}, appTree);
38+
const tree = schematicRunner.runSchematic('migration-13', {}, appTree);
3939
expect(tree.readContent('/testSrc/appPrefix/component/test.component.ts'))
4040
.toEqual(
4141
`import { IgxDropDownBaseDirective, IgxDropDownItemBaseDirective, IgxGridBaseDirective,

projects/igniteui-angular/src/lib/core/styles/components/avatar/_avatar-theme.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@
3434
$image-background: null
3535
) {
3636
$name: 'igx-avatar';
37-
$theme: apply-palette(map-get($schema, $name), $palette);
37+
$theme: ();
38+
39+
@if map-has-key($schema, $name) {
40+
$theme: apply-palette(map-get($schema, $name), $palette);
41+
} @else {
42+
$theme: apply-palette($schema, $palette);
43+
}
3844

3945
@if not($icon-color) and $icon-background {
4046
$icon-color: text-contrast($icon-background);

projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-theme.scss

+9-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@
5454
$disable-border: true
5555
) {
5656
$name: 'igx-badge';
57-
$badge-schema: map-get($schema, $name);
58-
$border-width: if($disable-border == true, 0, rem(1px));
59-
$theme: apply-palette($badge-schema, $palette);
57+
$badge-schema: ();
58+
59+
@if map-has-key($schema, $name) {
60+
$badge-schema: map-get($schema, $name);
61+
} @else {
62+
$badge-schema: $schema;
63+
}
6064

65+
$theme: apply-palette($badge-schema, $palette);
66+
$border-width: if($disable-border == true, 0, rem(1px));
6167
$border-radius: round-borders(
6268
if($border-radius, $border-radius, map-get($badge-schema, 'border-radius')), 0, 11px
6369
);

projects/igniteui-angular/src/lib/core/styles/components/banner/_banner-theme.scss

+9-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434
$banner-illustration-color: null
3535
) {
3636
$name: 'igx-banner';
37-
$theme: apply-palette(map-get($schema, $name), $palette);
37+
$banner-schema: ();
38+
39+
@if map-has-key($schema, $name) {
40+
$banner-schema: map-get($schema, $name);
41+
} @else {
42+
$banner-schema: $schema;
43+
}
44+
45+
$theme: apply-palette($banner-schema, $palette);
3846

3947
@if not($banner-message-color) and $banner-background {
4048
$banner-message-color: text-contrast($banner-background);

projects/igniteui-angular/src/lib/core/styles/components/bottom-nav/_bottom-nav-theme.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
$shadow: null
3939
) {
4040
$name: 'igx-bottom-nav';
41-
$bottom-nav-schema: map-get($schema, $name);
41+
$bottom-nav-schema: ();
42+
43+
@if map-has-key($schema, $name) {
44+
$bottom-nav-schema: map-get($schema, $name);
45+
} @else {
46+
$bottom-nav-schema: $schema;
47+
}
4248

4349
$theme: apply-palette($bottom-nav-schema, $palette);
4450

projects/igniteui-angular/src/lib/core/styles/components/button-group/_button-group-theme.scss

+8-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@
7070
$item-selected-hover-background: null
7171
) {
7272
$name: 'igx-button-group';
73-
$button-group-schema: map-get($schema, $name);
73+
$button-group-schema: ();
74+
75+
@if map-has-key($schema, $name) {
76+
$button-group-schema: map-get($schema, $name);
77+
} @else {
78+
$button-group-schema: $schema;
79+
}
80+
7481
$theme: apply-palette($button-group-schema, $palette);
7582

7683
$border: 1px solid map-get($theme, 'item-selected-border-color');

0 commit comments

Comments
 (0)