Skip to content

Commit c3aebc1

Browse files
authored
Merge branch 'master' into vkombov/feat-10217-master
2 parents 88192ff + 14921f6 commit c3aebc1

Some content is hidden

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

54 files changed

+5694
-90
lines changed

CHANGELOG.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes for each version of this project will be documented in this
55
## 13.0.0
66

77
### New Features
8+
- Added `IgxStepper` component
9+
- Highly customizable component that visualizes content as a process and shows its progress by dividing the content into chronological `igx-steps`.
10+
- Exposed API to control features like step validation, styling, orientation, and easy-to-use keyboard navigation.
11+
- Code example below:
12+
13+
```html
14+
<igx-stepper>
15+
<igx-step *ngFor="let step of stepsData" >
16+
...
17+
</igx-step>
18+
</igx-stepper>
19+
```
20+
21+
- For more information, check out the [README](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/stepper/README.md), [specification](https://github.com/IgniteUI/igniteui-angular/wiki/Stepper-Specification) and [official documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/stepper).
22+
823
- `IgxCsvExporterService`, `IgxExcelExporterService`
924
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.
1025
- `IgxGridToolbarPinningComponent`, `IgxGridToolbarHidingComponent`
@@ -34,15 +49,20 @@ All notable changes for each version of this project will be documented in this
3449
- Inputs `showToolbar`, `toolbarTitle`, `columnHiding`, `columnHidingTitle`, `hiddenColumnsText`,
3550
`columnPinning`, `columnPinningTitle`, `pinnedColumnsText`.
3651
Use `IgxGridToolbarComponent`, `IgxGridToolbarHidingComponent`, `IgxGridToolbarPinningComponent` instead.
52+
- `igxGrid`
53+
- Exposed a `groupStrategy` input that functions similarly to `sortStrategy`, allowing customization of the grouping behavior of the grid. Please, refer to the [Group By ](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/groupby) topic for more information.
3754
- `IgxColumnActionsComponent`
3855
- **Breaking Change** - The following input has been removed
39-
- Input `columns`. Use `igxGrid` `columns` input instead.
56+
- Input `columns`. Use `igxGrid` `columns` input instead.
57+
- `IgxCarousel`
58+
- **Breaking Changes** -The carousel animation type `CarouselAnimationType` is renamed to `HorizontalAnimationType`.
4059

4160
## 12.2.3
4261

4362
### General
4463
- **Breaking Change** - `IgxPercentSummaryOperand` and `IgxCurrencySummaryOperand` have been removed and `IgxNumberSummaryOperand` should be used instead. If you have used the percent or currency summary operands to extend a custom summary operand from them, then change the custom operand to extend from the number summary operand.
45-
64+
- `IgxToastComponent`
65+
- **Deprecated** - The `position` input property has been deprecated. Use `positionSettings` input instead.
4666
## 12.2.1
4767

4868
### New Features

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Some of the Angular chart types included are: [Polar chart](https://www.infragis
6565
|select|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/select/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/select)|||||
6666
|slider|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/slider/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/slider/slider)|||||
6767
|snackbar|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/snackbar/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/snackbar)|||||
68+
|stepper|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/stepper/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/stepper)|
6869
|switch|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/switch/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/switch)|||||
6970
|tabs|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/tabs/tabs/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/tabs)|||||
7071
|time picker|:white_check_mark:|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/time-picker/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/time-picker)|||||

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@
105105
"version": "12.1.0",
106106
"description": "Updates Ignite UI for Angular from v11.1.x to v12.1.0",
107107
"factory": "./update-12_1_0"
108+
},
109+
"migration-22": {
110+
"version": "13.0.0",
111+
"description": "Updates Ignite UI for Angular from v12.2.x to v13.0.0",
112+
"factory": "./update-13_0_0"
108113
}
109114
}
110115
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "../../common/schema/class.schema.json",
3+
"changes": [{
4+
"name": "CarouselAnimationType",
5+
"replaceWith": "HorizontalAnimationType"
6+
}
7+
]
8+
}
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
import * as path from 'path';
2+
3+
import { EmptyTree } from '@angular-devkit/schematics';
4+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
5+
6+
const version = '13.0.0';
7+
8+
describe(`Update to ${version}`, () => {
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+
const migrationName = 'migration-22';
31+
const lineBreaksAndSpaceRegex = /\s/g;
32+
33+
it('should rename CarouselAnimationType to HorizontalAnimationType', async () => {
34+
appTree.create(
35+
'/testSrc/appPrefix/component/test.component.ts',
36+
`import { Component, ViewChild } from '@angular/core';
37+
import { CarouselAnimationType } from 'igniteui-angular';
38+
39+
@Component({
40+
selector: 'animationType',
41+
templateUrl: './test.component.html',
42+
styleUrls: ['./test.component.scss']
43+
})
44+
export class AnimationType {
45+
public animationType: CarouselAnimationType = CarouselAnimationType.slide;
46+
}
47+
`);
48+
const tree = await schematicRunner
49+
.runSchematicAsync(migrationName, {}, appTree)
50+
.toPromise();
51+
52+
const expectedContent = `import { Component, ViewChild } from '@angular/core';
53+
import { HorizontalAnimationType } from 'igniteui-angular';
54+
55+
@Component({
56+
selector: 'animationType',
57+
templateUrl: './test.component.html',
58+
styleUrls: ['./test.component.scss']
59+
})
60+
export class AnimationType {
61+
public animationType: HorizontalAnimationType = HorizontalAnimationType.slide;
62+
}
63+
`;
64+
65+
expect(
66+
tree.readContent(
67+
'/testSrc/appPrefix/component/test.component.ts'
68+
)
69+
).toEqual(expectedContent);
70+
});
71+
72+
/* eslint-disable arrow-parens */
73+
it('Should properly rename columns property to columnsCollection', async () => {
74+
appTree.create('/testSrc/appPrefix/component/test.component.ts',
75+
`
76+
import { IgxGridComponent } from 'igniteui-angular';
77+
export class MyClass {
78+
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
79+
public grid1: IgxGridComponent;
80+
81+
public ngAfterViewInit() {
82+
const columns = grid1.columns;
83+
}
84+
}
85+
`);
86+
87+
const tree = await schematicRunner
88+
.runSchematicAsync(migrationName, {}, appTree)
89+
.toPromise();
90+
91+
expect(
92+
tree.readContent('/testSrc/appPrefix/component/test.component.ts')
93+
).toEqual(
94+
`
95+
import { IgxGridComponent } from 'igniteui-angular';
96+
export class MyClass {
97+
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
98+
public grid1: IgxGridComponent;
99+
100+
public ngAfterViewInit() {
101+
const columns = grid1.columnsCollection;
102+
}
103+
}
104+
`
105+
);
106+
});
107+
108+
it('Should properly rename columns property to columnsCollection - treeGrid', async () => {
109+
appTree.create('/testSrc/appPrefix/component/test.component.ts',
110+
`
111+
import { IgxTreeGridComponent } from 'igniteui-angular';
112+
export class MyClass {
113+
@ViewChild(IgxTreeGridComponent, { read: IgxTreeGridComponent })
114+
public tGrid1: IgxTreeGridComponent;
115+
116+
public ngAfterViewInit() {
117+
const columns = this.tGrid1.columns;
118+
}
119+
120+
public soSth() {
121+
const editableColumns = this.tGrid1.columns.filter(c => e.editable);
122+
}
123+
}
124+
`);
125+
126+
const tree = await schematicRunner
127+
.runSchematicAsync(migrationName, {}, appTree)
128+
.toPromise();
129+
130+
expect(
131+
tree.readContent('/testSrc/appPrefix/component/test.component.ts')
132+
).toEqual(
133+
`
134+
import { IgxTreeGridComponent } from 'igniteui-angular';
135+
export class MyClass {
136+
@ViewChild(IgxTreeGridComponent, { read: IgxTreeGridComponent })
137+
public tGrid1: IgxTreeGridComponent;
138+
139+
public ngAfterViewInit() {
140+
const columns = this.tGrid1.columnsCollection;
141+
}
142+
143+
public soSth() {
144+
const editableColumns = this.tGrid1.columnsCollection.filter(c => e.editable);
145+
}
146+
}
147+
`
148+
);
149+
});
150+
151+
it('should remove paging and paginationTemplate property and define a igx-paginator component with custom content', async () => {
152+
appTree.create(
153+
'/testSrc/appPrefix/component/test.component.html', `
154+
<div class="columnHidingContainer">
155+
<div *ngFor="let col of grid.columns">
156+
{{col.field}}
157+
</div>
158+
</div>
159+
<div class="gridContainer">
160+
<igx-grid igxPreventDocumentScroll #grid [data]="data" [autoGenerate]="false" width="100%" height="560px" columnWidth="200px"
161+
[allowFiltering]="true">
162+
<igx-column [field]="'ID'" dataType="string" [sortable]="true"></igx-column>
163+
<igx-column [field]="'ContactName'" dataType="string" [sortable]="true" [disableHiding]="true"></igx-column>
164+
<igx-column [field]="'ContactTitle'" dataType="string" [sortable]="true" [disableHiding]="true"></igx-column>
165+
<igx-column [field]="'City'" dataType="string" [sortable]="true"></igx-column>
166+
<igx-column [field]="'CompanyName'" dataType="string" [sortable]="true"></igx-column>
167+
</igx-grid>
168+
</div>`);
169+
const tree = await schematicRunner.runSchematicAsync(migrationName, {}, appTree)
170+
.toPromise();
171+
172+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.html').replace(lineBreaksAndSpaceRegex, ''))
173+
.toEqual(`
174+
<div class="columnHidingContainer">
175+
<div *ngFor="let col of grid.columnsCollection">
176+
{{col.field}}
177+
</div>
178+
</div>
179+
<div class="gridContainer">
180+
<igx-grid igxPreventDocumentScroll #grid [data]="data" [autoGenerate]="false" width="100%" height="560px" columnWidth="200px"
181+
[allowFiltering]="true">
182+
<igx-column [field]="'ID'" dataType="string" [sortable]="true"></igx-column>
183+
<igx-column [field]="'ContactName'" dataType="string" [sortable]="true" [disableHiding]="true"></igx-column>
184+
<igx-column [field]="'ContactTitle'" dataType="string" [sortable]="true" [disableHiding]="true"></igx-column>
185+
<igx-column [field]="'City'" dataType="string" [sortable]="true"></igx-column>
186+
<igx-column [field]="'CompanyName'" dataType="string" [sortable]="true"></igx-column>
187+
</igx-grid>
188+
</div>
189+
`.replace(lineBreaksAndSpaceRegex, ''));
190+
});
191+
});
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges } from '../common/UpdateChanges';
7+
import { Element } from '@angular/compiler';
8+
import { findElementNodes, getSourceOffset, parseFile } from '../common/util';
9+
10+
const version = '13.0.0';
11+
12+
export default (): Rule => (host: Tree, context: SchematicContext) => {
13+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
14+
15+
const update = new UpdateChanges(__dirname, host, context);
16+
const GRIDS = ['IgxGridComponent', 'IgxTreeGridComponent', 'IgxHierarchicalGridComponent'];
17+
const TAGS = ['igx-grid', 'igx-tree-grid', 'igx-hierarchical-grid'];
18+
const tsFiles = update.tsFiles;
19+
20+
for (const path of update.templateFiles) {
21+
findElementNodes(parseFile(host, path), TAGS)
22+
.map(node => getSourceOffset(node as Element))
23+
.forEach(offset => {
24+
const { file, node } = offset;
25+
if (file.content.includes('columns')) {
26+
const gridRef = node.attrs.find(e => e.name.includes('#')).name.substring(1);
27+
const content = file.content.split(gridRef + '.columns').join(gridRef + '.columnsCollection');
28+
host.overwrite(path, content);
29+
}
30+
});
31+
}
32+
33+
const getIndicesOf = (searchStr, str) => {
34+
if (searchStr.length === 0) {
35+
return [];
36+
}
37+
let startIndex = 0;
38+
let index = 0;
39+
const indexes = [];
40+
while ((index = str.indexOf(searchStr, startIndex)) > -1) {
41+
indexes.push(index);
42+
startIndex = index + searchStr.length;
43+
}
44+
return indexes;
45+
};
46+
47+
for (const path of tsFiles) {
48+
let content = host.read(path)?.toString();
49+
GRIDS.forEach(grid => {
50+
if (content.indexOf(grid) > -1) {
51+
const indexes = getIndicesOf('@ViewChild', content);
52+
indexes.forEach(index => {
53+
const viewChildRef = content.substring(index, content.indexOf(';', index)).replace(/\s\s+/g, ' ');
54+
if (viewChildRef.includes(grid)) {
55+
const gridDeclaration = viewChildRef.substring(viewChildRef.indexOf(')') + 1).replace(/\:/g, '').trim();
56+
const gridName = gridDeclaration.split(' ')[1];
57+
content = content.split(gridName + '.columns').join(gridName + '.columnsCollection');
58+
host.overwrite(path, content);
59+
}
60+
});
61+
}
62+
});
63+
}
64+
update.applyChanges();
65+
};

projects/igniteui-angular/src/lib/carousel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A walkthrough of how to get started can be found [here](https://www.infragistics
1717
| `gesturesSupport` | boolean | Controls should the gestures should be supported. Defaults to `true`. |
1818
| `maximumIndicatorsCount` | number | The number of visible indicators. Defaults to `5`. |
1919
| `indicatorsOrientation` | CarouselIndicatorsOrientation | Controls whether the indicators should be previewed on top or on bottom of carousel. Defaults to `bottom`. |
20-
| `animationType` | CarouselAnimationType | Controls what animation should be played when slides are changing. Defaults to `slide`. |
20+
| `animationType` | HorizontalAnimationType | Controls what animation should be played when slides are changing. Defaults to `slide`. |
2121
| `total` | number | The number of slides the carousel currently has. |
2222
| `current` | number | The index of the slide currently showing. |
2323
| `isPlaying` | boolean | Returns whether the carousel is paused/playing. |

0 commit comments

Comments
 (0)