Skip to content

Commit 49c732c

Browse files
committed
Merge branch 'astaev/issue7377-master' of github.com:IgniteUI/igniteui-angular into astaev/issue7377-master
2 parents 009309e + 12e6430 commit 49c732c

33 files changed

+3036
-1156
lines changed

CHANGELOG.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,26 @@ All notable changes for each version of this project will be documented in this
44

55
## 10.1.0
66

7+
### General
8+
- `igxCombo`
9+
- **Behavioral Change** - Change default positioning strategy from `ConnectedPositioningStrategy` to `AutoPositionStrategy`. The [`Auto`](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay_position.html#auto) strategy will initially try to show the element like the Connected strategy does. If the element goes out of the viewport Auto will flip the starting point and the direction, i.e. if the direction is 'bottom', it will switch it to 'top' and so on. If after flipping direction the content goes out of the view, auto strategy will revert to initial start point and direction and will push the content into the view. Note after pushing the content it may hide the combo's input.
10+
- `IgxNavbar`:
11+
- **Breaking Changes** - The `igx-action-icon` has been renamed to `igx-navbar-action`. It should get renamed in your components via `ng update`;
12+
713
### New Features
8-
- `IgxColumn`
14+
- `IgxGridState` directive
15+
- Added support for expansion states, column selection and row pinning.
16+
- Added support for `IgxTreeGrid` and `IgxHierarchicalGrid` (including child grids)
17+
- `IgxColumn`
918
- Added `byHeader` parameter to the `autosize` method which specifies if the autosizing should be based only on the header content width.
19+
- `IgxToast`
20+
- `message` property has been deprecated. You can place the *message text* in the toast content or pass it as parameter to `show` method instead.
21+
- An optional string parameter `message` has been added to `show()` method.
22+
- `IgxSnackbar`
23+
- `message` property has been deprecated. You can place the *message text* in the snackbar content or pass it as parameter to `show` method instead.
24+
- An optional string parameter `message` has been added to `show()` method.
25+
- `IgxNavbar`
26+
- 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.
1027

1128
## 10.0.0
1229

@@ -16,9 +33,9 @@ All notable changes for each version of this project will be documented in this
1633
- `igx-select`, `igx-combo`, `igx-drop-down`
1734
- **Behavioral Change** - The select, combo, and dropdown items now have display block and text-overflow ellipsis enabled by default.
1835
- `IgxTransaction` - The `onStateUpdate` now emits with information of its origin. The emitted value is of type `StateUpdateEvent`, which has two properties:
19-
- `origin` - it can vary within the values of the `TransactionEventOrigin` interface;
36+
- `origin` - it can vary within the values of the `TransactionEventOrigin` interface;
2037
- `actions` - contains information about the transactions, that caused the emission of the event.
21-
- `IgxPaginator` - The input `overlaySettings` was introduced, which allows applying custom overlay settings for the component.
38+
- `IgxPaginator` - The input `overlaySettings` was introduced, which allows applying custom overlay settings for the component.
2239

2340
### New Features
2441
- `IgxGrid`
@@ -41,6 +58,7 @@ All notable changes for each version of this project will be documented in this
4158
- `IgxHierarchicalGrid`
4259
- `onGridInitialized` - New output has been exposed. Emitted after a grid is being initialized for the corresponding row island.
4360
- **Behavioral Change** - When moving a column `DropPosition.None` is now acting like `DropPosition.AfterDropTarget`.
61+
4462
## 9.1.0
4563

4664
### General
@@ -162,9 +180,9 @@ All notable changes for each version of this project will be documented in this
162180
```typescript
163181
public pinningConfiguration: IPinningConfig = { columns: ColumnPinningPosition.End };
164182
```
165-
- Added new properties for paging:
166-
- `totalRecords` set to alter the pages count based on total remote records. Keep in mind that If you are using paging and all the data is passed to the grid, the value of totalRecords property will be set by default to the length of the provided data source. If totalRecords is set, it will take precedent over the default length based on the data source.
167-
- `pagingMode` - accepts `GridPagingMode` enumeration. If the paging mode is set to remote the grid will not paginate the passed data source, if the paging mode is set to local (which is the default value) the grid will paginate the data source based on the page, perPage and totalRecords values.
183+
- Added new properties for paging:
184+
- `totalRecords` set to alter the pages count based on total remote records. Keep in mind that If you are using paging and all the data is passed to the grid, the value of totalRecords property will be set by default to the length of the provided data source. If totalRecords is set, it will take precedent over the default length based on the data source.
185+
- `pagingMode` - accepts `GridPagingMode` enumeration. If the paging mode is set to remote the grid will not paginate the passed data source, if the paging mode is set to local (which is the default value) the grid will paginate the data source based on the page, perPage and totalRecords values.
168186
- Added functionality for column selection.
169187
- `columnSelection` property has been added. It accepts GridSelection mode enumeration. Grid selection mode could be none, single or multiple.
170188
- `selected` property has been added to the IgxColumnComponent; Allows you to set whether the column is selected.

gulpfile.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module.exports.copySchematics = (cb) => {
137137
const typedocBuildTheme = (cb) => {
138138
spawnSync(`typedoc`, [TYPEDOC.PROJECT_PATH,
139139
"--tsconfig",
140-
"tsconfig.base.json"], { stdio: 'inherit', shell: true });
140+
path.join(__dirname,"tsconfig.base.json")], { stdio: 'inherit', shell: true });
141141
cb();
142142
};
143143
typedocBuildTheme.displayName = 'typedoc-build:theme';
@@ -180,13 +180,26 @@ const TYPEDOC = {
180180
};
181181

182182
function typedocBuildExportFn(cb) {
183-
spawnSync('typedoc', [TYPEDOC.PROJECT_PATH, "--generate-json", TYPEDOC.EXPORT_JSON_PATH, "--tags", "--params"],
183+
spawnSync('typedoc', [
184+
TYPEDOC.PROJECT_PATH,
185+
"--generate-json",
186+
TYPEDOC.EXPORT_JSON_PATH,
187+
"--tags",
188+
"--params",
189+
"--tsconfig",
190+
path.join(__dirname,"tsconfig.base.json")],
184191
{ stdio: 'inherit', shell: true });
185192
cb();
186193
}
187194

188195
function typedocImportJsonFn(cb) {
189-
spawnSync('typedoc', [TYPEDOC.PROJECT_PATH, "--generate-from-json", TYPEDOC.EXPORT_JSON_PATH, "--warns"],
196+
spawnSync('typedoc', [
197+
TYPEDOC.PROJECT_PATH,
198+
"--generate-from-json",
199+
TYPEDOC.EXPORT_JSON_PATH,
200+
"--warns",
201+
"--tsconfig",
202+
path.join(__dirname,"tsconfig.base.json")],
190203
{ stdio: 'inherit', shell: true});
191204
cb();
192205
}
@@ -212,7 +225,7 @@ function typedocBuildDocsJA (cb) {
212225
'--localize',
213226
'jp',
214227
"--tsconfig",
215-
"tsconfig.base.json"], { stdio: 'inherit', shell: true });
228+
path.join(__dirname,"tsconfig.base.json")], { stdio: 'inherit', shell: true });
216229

217230
cb();
218231
}
@@ -223,7 +236,7 @@ function typedocBuildDocsEN (cb) {
223236
'--localize',
224237
'en',
225238
"--tsconfig",
226-
"tsconfig.base.json"], { stdio: 'inherit', shell: true});
239+
path.join(__dirname,"tsconfig.base.json")], { stdio: 'inherit', shell: true});
227240

228241
cb();
229242
}

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
}

projects/igniteui-angular/migrations/update-9_1_0/changes/selectors.json renamed to projects/igniteui-angular/migrations/update-10_1_0/changes/selectors.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"changes": [
44
{
55
"type": "component",
6-
"selector": "<igx-action-icon>",
7-
"replaceWith": "<igx-navbar-action>"
6+
"selector": "igx-action-icon",
7+
"replaceWith": "igx-navbar-action"
88
}
99
]
1010
}
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/combo/combo.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ConnectedPositioningStrategy } from './../services/overlay/position/connected-positioning-strategy';
21
import { CommonModule } from '@angular/common';
32
import {
43
AfterViewInit, ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, HostBinding, HostListener,
@@ -30,7 +29,7 @@ import { IgxInputGroupModule, IgxInputGroupComponent } from '../input-group/inpu
3029
import { IgxComboItemComponent } from './combo-item.component';
3130
import { IgxComboDropDownComponent } from './combo-dropdown.component';
3231
import { IgxComboFilteringPipe, IgxComboGroupingPipe } from './combo.pipes';
33-
import { OverlaySettings, AbsoluteScrollStrategy } from '../services/public_api';
32+
import { OverlaySettings, AbsoluteScrollStrategy, AutoPositionStrategy } from '../services/public_api';
3433
import { Subject } from 'rxjs';
3534
import { takeUntil } from 'rxjs/operators';
3635
import { DisplayDensityBase, DisplayDensityToken, IDisplayDensityOptions } from '../core/density';
@@ -156,7 +155,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
156155
private _onTouchedCallback: () => void = noop;
157156
private _overlaySettings: OverlaySettings = {
158157
scrollStrategy: new AbsoluteScrollStrategy(),
159-
positionStrategy: new ConnectedPositioningStrategy(),
158+
positionStrategy: new AutoPositionStrategy(),
160159
modal: false,
161160
closeOnOutsideClick: true,
162161
excludePositionTarget: true

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,44 @@ export class IgxColumnComponent implements AfterContentInit {
439439
@WatchColumnChanges()
440440
@Input()
441441
public maxWidth: string;
442+
443+
/**
444+
* @hidden
445+
*/
446+
get maxWidthPx() {
447+
const gridAvailableSize = this.grid.calcWidth;
448+
const isPercentageWidth = this.maxWidth && typeof this.maxWidth === 'string' && this.maxWidth.indexOf('%') !== -1;
449+
return isPercentageWidth ? parseFloat(this.maxWidth) / 100 * gridAvailableSize : parseFloat(this.maxWidth);
450+
}
451+
452+
/**
453+
* @hidden
454+
*/
455+
get maxWidthPercent() {
456+
const gridAvailableSize = this.grid.calcWidth;
457+
const isPercentageWidth = this.maxWidth && typeof this.maxWidth === 'string' && this.maxWidth.indexOf('%') !== -1;
458+
return isPercentageWidth ? parseFloat(this.maxWidth) : parseFloat(this.maxWidth) / gridAvailableSize * 100;
459+
}
460+
461+
/**
462+
* @hidden
463+
*/
464+
get minWidthPx() {
465+
const gridAvailableSize = this.grid.calcWidth;
466+
const isPercentageWidth = this.minWidth && typeof this.minWidth === 'string' && this.minWidth.indexOf('%') !== -1;
467+
return isPercentageWidth ? parseFloat(this.minWidth) / 100 * gridAvailableSize : parseFloat(this.minWidth);
468+
}
469+
470+
/**
471+
* @hidden
472+
*/
473+
get minWidthPercent() {
474+
const gridAvailableSize = this.grid.calcWidth;
475+
const isPercentageWidth = this.minWidth && typeof this.minWidth === 'string' && this.minWidth.indexOf('%') !== -1;
476+
return isPercentageWidth ? parseFloat(this.minWidth) : parseFloat(this.minWidth) / gridAvailableSize * 100;
477+
}
478+
479+
442480
/**
443481
* Sets/gets the minimum `width` of the column.
444482
* Default value is `88`;
@@ -1754,12 +1792,30 @@ export class IgxColumnComponent implements AfterContentInit {
17541792
*/
17551793
public autosize(byHeader = false) {
17561794
if (!this.columnGroup) {
1757-
this.width = !byHeader ? this.getLargestCellWidth() :
1758-
(Object.values(this.getHeaderCellWidths()).reduce((a, b) => a + b) + 'px');
1795+
const size = this.getAutoSize(byHeader);
1796+
this.width = size;
17591797
this.grid.reflow();
17601798
}
17611799
}
17621800

1801+
/**
1802+
* @hidden
1803+
*/
1804+
public getAutoSize(byHeader = false) {
1805+
const size = !byHeader ? this.getLargestCellWidth() :
1806+
(Object.values(this.getHeaderCellWidths()).reduce((a, b) => a + b) + 'px');
1807+
const gridAvailableSize = this.grid.calcWidth;
1808+
let newWidth;
1809+
const isPercentageWidth = this.width && typeof this.width === 'string' && this.width.indexOf('%') !== -1;
1810+
if (isPercentageWidth) {
1811+
const percentageSize = parseFloat(size) / gridAvailableSize * 100;
1812+
newWidth = percentageSize + '%';
1813+
} else {
1814+
newWidth = size;
1815+
}
1816+
return newWidth;
1817+
}
1818+
17631819
/**
17641820
* @hidden
17651821
*/
@@ -1880,14 +1936,14 @@ export class IgxColumnComponent implements AfterContentInit {
18801936
const colWidth = this.width;
18811937
const isPercentageWidth = colWidth && typeof colWidth === 'string' && colWidth.indexOf('%') !== -1;
18821938
if (isPercentageWidth) {
1883-
this._calcWidth = parseInt(colWidth, 10) / 100 * grid.calcWidth;
1939+
this._calcWidth = parseFloat(colWidth) / 100 * grid.calcWidth;
18841940
} else if (!colWidth) {
18851941
// no width
18861942
this._calcWidth = this.defaultWidth || grid.getPossibleColumnWidth();
18871943
} else {
18881944
this._calcWidth = this.width;
18891945
}
1890-
this.calcPixelWidth = parseInt(this._calcWidth, 10);
1946+
this.calcPixelWidth = parseFloat(this._calcWidth);
18911947
}
18921948

18931949
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3552,7 +3552,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
35523552
if (this.hasColumnLayouts) {
35533553
return '';
35543554
}
3555-
const colWidth = parseInt(column.calcWidth, 10);
3555+
const colWidth = parseFloat(column.calcWidth);
35563556
const minWidth = this.defaultHeaderGroupMinWidth;
35573557

35583558
if (colWidth < minWidth) {

0 commit comments

Comments
 (0)