Skip to content

Commit ceffcd4

Browse files
authored
Merge branch 'master' into fix-#6053-master
2 parents b54e399 + 9e95189 commit ceffcd4

File tree

123 files changed

+2011
-1241
lines changed

Some content is hidden

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

123 files changed

+2011
-1241
lines changed

CHANGELOG.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,34 @@ All notable changes for each version of this project will be documented in this
1616
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
1717
- **Behavioral Change** - Pinning columns is no longer automatically prevented when the pinning area would exceed the size of the grid.
1818

19+
### 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).
27+
- `IgxOverlayService`:
28+
- `setOffset` method added. It offsets the content along the corresponding axis by the provided amount.
29+
- `IgxToggleDirective`:
30+
- `setOffset` method added. It offsets the content along the corresponding axis by the provided amount.
31+
32+
## 8.2.6
33+
34+
### New Features
35+
- `IgxSelectItem`
36+
- `text` input is added. By default, the Select component will display the selected item's element inner text. In cases with a more complex item template, where more than just text interpolation is used, set the text property to specify what to display in the select field when the item is selected.
37+
38+
1939
## 8.2.4
40+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
41+
- The header text of the columns and the column groups now has the `title` attribute set to it in order to expose a native browser tooltip.
2042

2143
### RTL Support
22-
Most of the components in the framework now have full right-to-left (RTL) support via the newly included RTL themes.
44+
Most of the components in the framework now have full right-to-left (RTL) support via the newly included RTL themes.
2345

24-
For CSS-based projects add `node_modules/igniteui-angular/styles/igniteui-angular-rtl.css` to your angular.json styles collection.
46+
For CSS-based projects add `node_modules/igniteui-angular/styles/igniteui-angular-rtl.css` to your angular.json styles collection.
2547

2648
For Sass-based projects pass `$direction` to the `igx-core` mixin in your root stylesheet.
2749

@@ -37,7 +59,7 @@ Currently the following components have only partial RTL support:
3759
- Circular Progress Indicator (igx-circular-bar)
3860

3961
We plan on adding support for the aforementioned components in the upcoming releases.
40-
62+
4163
### New Features
4264

4365
- Columns now expose the `cellStyles` property which allows conditional styling of the column cells. Similar to `cellClasses` it accepts an object literal where the keys are style properties and the values are expressions for evaluation.
@@ -59,6 +81,20 @@ The callback signature for both `cellStyles` and `cellClasses` is now changed to
5981

6082
- `IgxChip`
6183
- **Breaking Change** The `originalEvent` property for the events `onMoveStart`, `onMoveEnd`, `onClick` and `onSelection` now provides the events, passed from the `igxDrag` directive. The passed original events are in other words the previous events that triggered the `igxChip` ones. They also have original events until a browser event is reached.
84+
- `IgxGrid` - Now you can access all grid data inside the custom column summary. Two additional optional parameters are introduced in the IgxSummaryOperand `operate` method.
85+
86+
```typescript
87+
class MySummary extends IgxNumberSummaryOperand {
88+
constructor() {
89+
super();
90+
}
91+
operate(columnData: any[], allGridData = [], fieldName?): IgxSummaryResult[] {
92+
const result = super.operate(allData.map(r => r[fieldName]));
93+
result.push({ key: 'test', label: 'Total Discounted', summaryResult: allData.filter((rec) => rec.Discontinued).length });
94+
return result;
95+
}
96+
}
97+
```
6298

6399
## 8.2.0
64100
### New theme

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

Lines changed: 5 additions & 0 deletions
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"
Lines changed: 35 additions & 0 deletions
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+
}
Lines changed: 89 additions & 0 deletions
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+
});
Lines changed: 67 additions & 0 deletions
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+
}
Lines changed: 35 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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/combo/combo-add-item.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IgxComboItemComponent } from './combo-item.component';
2-
import { Component } from '@angular/core';
2+
import { Component, HostListener } from '@angular/core';
33

44
/**
55
* @hidden
@@ -16,8 +16,19 @@ export class IgxComboAddItemComponent extends IgxComboItemComponent {
1616
set selected(value: boolean) {
1717
}
1818

19-
clicked(event?) {
19+
/**
20+
* @hidden
21+
* @internal
22+
* This is related to https://github.com/angular/angular/issues/33300
23+
* When the above is fixed, we can remove the @HostListener decorator and move
24+
* the body of the `handleClick` method back under `clicked`
25+
*/
26+
@HostListener('click')
27+
handleClick() {
2028
this.comboAPI.disableTransitions = false;
2129
this.comboAPI.add_custom_item();
2230
}
31+
32+
clicked(event?) {
33+
}
2334
}

projects/igniteui-angular/src/lib/combo/combo-item.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import {
44
HostBinding,
55
Inject,
66
Input,
7-
DoCheck,
8-
HostListener
7+
DoCheck
98
} from '@angular/core';
109
import { IgxDropDownItemComponent } from '../drop-down/drop-down-item.component';
1110
import { IGX_DROPDOWN_BASE, IDropDownBase, Navigate } from '../drop-down/drop-down.common';
@@ -85,7 +84,6 @@ export class IgxComboItemComponent extends IgxDropDownItemComponent implements D
8584
return rect.y >= parentDiv.y;
8685
}
8786

88-
@HostListener('click', ['$event'])
8987
clicked(event) {
9088
this.comboAPI.disableTransitions = false;
9189
if (this.disabled || this.isHeader) {

projects/igniteui-angular/src/lib/combo/combo.common.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ElementRef, EventEmitter, InjectionToken } from '@angular/core';
22
import { CancelableEventArgs, CancelableBrowserEventArgs } from '../core/utils';
3-
import { IFilteringExpression } from '../data-operations/filtering-expression.interface';
43

54
export const IGX_COMBO_COMPONENT = new InjectionToken<IgxComboBase>('IgxComboComponentToken');
65

@@ -12,7 +11,6 @@ export interface IgxComboBase {
1211
groupKey: string;
1312
isRemote: boolean;
1413
filteredData: any[];
15-
filteringExpressions: IFilteringExpression[];
1614
totalItemCount: number;
1715
itemsMaxHeight: number;
1816
itemHeight: number;

0 commit comments

Comments
 (0)