Skip to content

Commit 9ab24e6

Browse files
authored
Merge branch 'master' into ibarakov/fix-7072-master
2 parents 9a53e7b + 283d4fa commit 9ab24e6

27 files changed

+252
-142
lines changed

CHANGELOG.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
4+
45
## 10.0.0
56

6-
### New Features
7+
### General
8+
- `igxGrid`
9+
- **Behavioral Change** - Group rows now display the group column's header name instead of field when one is available.
10+
- `igx-select`, `igx-combo`, `igx-drop-down`
11+
- **Behavioral Change** - The select, combo, and dropdown items now have display block and text-overflow ellipsis enabled by default.
12+
- `IgxTransaction` - The `onStateUpdate` now emits with information of its origin. The emitted value is of type `StateUpdateEvent`, which has two properties:
13+
- `origin` - it can vary within the values of the `TransactionEventOrigin` interface;
14+
- `actions` - contains information about the transactions, that caused the emission of the event.
715

16+
### New Features
817
- `IgxGrid`
918
- `showGroupArea` input is added, which can be used to enable/disable the group area row.
1019

11-
## 10.0
12-
13-
### General
14-
- `igx-select`, `igx-combo`, `igx-drop-down`
15-
- **Behavioral Change** - The select, combo, and dropdown items now have display block and text-overflow ellipsis enabled by default.
16-
1720
## 9.1.1
1821

1922
### General
2023
- `IgxHierarchicalGrid`
2124
- `onGridInitialized` - New output has been exposed. Emitted after a grid is being initialized for the corresponding row island.
22-
25+
- **Behavioral Change** - When moving a column `DropPosition.None` is now acting like `DropPosition.AfterDropTarget`.
2326
## 9.1.0
2427

2528
### General

ROADMAP.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ To Be Updated
1919

2020
## Milestone 11 (Released June 2nd, 2020)
2121

22-
1. Dock Manger [#5980](https://github.com/IgniteUI/igniteui-angular/issues/5980)
23-
2. Range Date Picker [#5732](https://github.com/IgniteUI/igniteui-angular/issues/5732)
24-
3. Keyboard Navigation Enhancement [#6755](https://github.com/IgniteUI/igniteui-angular/issues/6755)
25-
4. Column freezing/Pinning on the right (igx-grid) [#5879](https://github.com/IgniteUI/igniteui-angular/issues/5879)
26-
5. Column Selection for IgxGrid [#6578](https://github.com/IgniteUI/igniteui-angular/issues/6578)
27-
6. Splitter [#6639](https://github.com/IgniteUI/igniteui-angular/issues/6639)
28-
7. Row Pinning IgxGrid [#6640](https://github.com/IgniteUI/igniteui-angular/issues/6640)
29-
8. Data Analysis Directive [#1752](https://github.com/IgniteUI/igniteui-angular-samples/issues/1752)
30-
9. Slider does not support RTL [#5212](https://github.com/igniteui/igniteui-angular/issues/5212)
31-
10. Circular Progress Indicator does not support RTL [#5903](https://github.com/igniteui/igniteui-angular/issues/5903)
32-
11. Action Strip [#6941](https://github.com/IgniteUI/igniteui-angular/issues/6941)
33-
12. Theme igx-component scrollbars [#6675](https://github.com/IgniteUI/igniteui-angular/issues/6675)
34-
13. Use CSS variables by default [#6803](https://github.com/IgniteUI/igniteui-angular/issues/6675)
22+
1. **[DONE]** Dock Manger - Public Preview [#5980](https://github.com/IgniteUI/igniteui-angular/issues/5980)
23+
2. **[DONE]** Range Date Picker [#5732](https://github.com/IgniteUI/igniteui-angular/issues/5732)
24+
3. **[DONE]** Keyboard Navigation Enhancement [#6755](https://github.com/IgniteUI/igniteui-angular/issues/6755)
25+
4. **[DONE]** Column freezing/Pinning on the right (igx-grid) [#5879](https://github.com/IgniteUI/igniteui-angular/issues/5879)
26+
5. **[DONE]** Column Selection for IgxGrid [#6578](https://github.com/IgniteUI/igniteui-angular/issues/6578)
27+
6. **[DONE]** Splitter [#6639](https://github.com/IgniteUI/igniteui-angular/issues/6639)
28+
7. **[DONE]** Row Pinning IgxGrid [#6640](https://github.com/IgniteUI/igniteui-angular/issues/6640)
29+
8. **[DONE]** Data Analysis Directive [#1752](https://github.com/IgniteUI/igniteui-angular-samples/issues/1752)
30+
9. **[DONE]** Slider does not support RTL [#5212](https://github.com/igniteui/igniteui-angular/issues/5212)
31+
10. **[DONE]** Circular Progress Indicator does not support RTL [#5903](https://github.com/igniteui/igniteui-angular/issues/5903)
32+
11. **[DONE]** Action Strip [#6941](https://github.com/IgniteUI/igniteui-angular/issues/6941)
33+
12. **[DONE]** Theme igx-component scrollbars [#6675](https://github.com/IgniteUI/igniteui-angular/issues/6675)
34+
13. **[DONE]** Use CSS variables by default [#6803](https://github.com/IgniteUI/igniteui-angular/issues/6675)
3535

3636
## Milestone 10 (Released February 10th, 2020)
3737

projects/igniteui-angular/src/lib/data-operations/groupby-record.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ISortingExpression } from './sorting-expression.interface';
2+
import { IgxColumnComponent } from '../grids/columns/column.component';
23

34
/**
45
* @hidden
@@ -13,4 +14,5 @@ export interface IGroupByRecord {
1314
groupParent: IGroupByRecord;
1415
groups?: IGroupByRecord[];
1516
height: number;
17+
column?: IgxColumnComponent;
1618
}

projects/igniteui-angular/src/lib/data-operations/sorting-strategy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,16 @@ export class IgxSorting implements IGridSortingStrategy {
160160
let result = [];
161161
while (i < data.length) {
162162
const group = this.groupedRecordsByExpression(data, i, expressions[level]);
163+
const column = grid ? grid.getColumnByName(expressions[level].fieldName) : null;
163164
const groupRow: IGroupByRecord = {
164165
expression: expressions[level],
165166
level,
166167
records: cloneArray(group),
167168
value: group[0][expressions[level].fieldName],
168169
groupParent: parent,
169170
groups: [],
170-
height: grid ? grid.renderedRowHeight : null
171+
height: grid ? grid.renderedRowHeight : null,
172+
column: column
171173
};
172174
if (parent) {
173175
parent.groups.push(groupRow);

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

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,16 +1584,30 @@ export class IgxColumnComponent implements AfterContentInit {
15841584
this._pinned = true;
15851585
this.pinnedChange.emit(this._pinned);
15861586
this._unpinnedIndex = grid._unpinnedColumns.indexOf(this);
1587-
index = index !== undefined ? index : grid._pinnedColumns.length;
1587+
const rootPinnedCols = grid._pinnedColumns.filter((c) => c.level === 0);
1588+
index = index !== undefined ? index : rootPinnedCols.length;
15881589
const targetColumn = grid._pinnedColumns[index];
15891590
const args = { column: this, insertAtIndex: index, isPinned: true };
15901591
grid.onColumnPinning.emit(args);
15911592

15921593
if (grid._pinnedColumns.indexOf(this) === -1) {
1593-
grid._pinnedColumns.splice(args.insertAtIndex, 0, this);
1594+
if (!grid.hasColumnGroups) {
1595+
grid._pinnedColumns.splice(args.insertAtIndex, 0, this);
1596+
} else {
1597+
// insert based only on root collection
1598+
rootPinnedCols.splice(args.insertAtIndex, 0, this);
1599+
let allPinned = [];
1600+
// re-create hierarchy
1601+
rootPinnedCols.forEach(group => {
1602+
allPinned.push(group);
1603+
allPinned = allPinned.concat(group.allChildren);
1604+
});
1605+
grid._pinnedColumns = allPinned;
1606+
}
15941607

15951608
if (grid._unpinnedColumns.indexOf(this) !== -1) {
1596-
grid._unpinnedColumns.splice(grid._unpinnedColumns.indexOf(this), 1);
1609+
const childrenCount = this.allChildren.length;
1610+
grid._unpinnedColumns.splice(grid._unpinnedColumns.indexOf(this), 1 + childrenCount);
15971611
}
15981612
}
15991613

@@ -1650,13 +1664,16 @@ export class IgxColumnComponent implements AfterContentInit {
16501664

16511665
const targetColumn = grid._unpinnedColumns[index];
16521666

1653-
grid._unpinnedColumns.splice(index, 0, this);
1654-
if (grid._pinnedColumns.indexOf(this) !== -1) {
1655-
grid._pinnedColumns.splice(grid._pinnedColumns.indexOf(this), 1);
1667+
if (!hasIndex) {
1668+
grid._unpinnedColumns.splice(index, 0, this);
1669+
if (grid._pinnedColumns.indexOf(this) !== -1) {
1670+
grid._pinnedColumns.splice(grid._pinnedColumns.indexOf(this), 1);
1671+
}
16561672
}
16571673

1674+
16581675
if (hasIndex) {
1659-
grid._moveColumns(this, targetColumn);
1676+
grid.moveColumn(this, targetColumn);
16601677
}
16611678

16621679
if (this.columnGroup) {

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

Lines changed: 44 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ import {
4646
OverlaySettings,
4747
PositionSettings,
4848
ConnectedPositioningStrategy,
49-
ContainerPositionStrategy
49+
ContainerPositionStrategy,
50+
StateUpdateEvent,
51+
TransactionEventOrigin
5052
} from '../services/public_api';
5153
import { GridBaseAPIService } from './api.service';
5254
import { IgxGridCellComponent } from './cell.component';
@@ -149,10 +151,11 @@ import { IgxColumnGroupComponent } from './columns/column-group.component';
149151
import { IGridSortingStrategy } from '../data-operations/sorting-strategy';
150152
import { IgxRowDragGhostDirective, IgxDragIndicatorIconDirective } from './row-drag.directive';
151153
import { isNumber } from 'util';
154+
import { showMessage } from '../core/deprecateDecorators';
152155

153156
const MINIMUM_COLUMN_WIDTH = 136;
154157
const FILTER_ROW_HEIGHT = 50;
155-
158+
let warningShown = false;
156159
// By default row editing overlay outlet is inside grid body so that overlay is hidden below grid header when scrolling.
157160
// In cases when grid has 1-2 rows there isn't enough space in grid body and row editing overlay should be shown above header.
158161
// Default row editing overlay height is higher then row height that is why the case is valid also for row with 2 rows.
@@ -2856,7 +2859,20 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
28562859
this.summaryService.clearSummaryCache(args);
28572860
});
28582861

2859-
this.transactions.onStateUpdate.pipe(destructor).subscribe(() => {
2862+
this.transactions.onStateUpdate.pipe(destructor).subscribe((event: StateUpdateEvent) => {
2863+
let actions = [];
2864+
if (event.origin === TransactionEventOrigin.REDO) {
2865+
actions = event.actions ? event.actions.filter(x => x.transaction.type === TransactionType.DELETE) : [];
2866+
} else if (event.origin === TransactionEventOrigin.UNDO) {
2867+
actions = event.actions ? event.actions.filter(x => x.transaction.type === TransactionType.ADD) : [];
2868+
}
2869+
if (actions.length > 0) {
2870+
for (const action of actions) {
2871+
if (this.selectionService.isRowSelected(action.transaction.id)) {
2872+
this.selectionService.deselectRow(action.transaction.id);
2873+
}
2874+
}
2875+
}
28602876
this.selectionService.clearHeaderCBState();
28612877
this.summaryService.clearSummaryCache();
28622878
this._pipeTrigger++;
@@ -3758,21 +3774,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
37583774
*/
37593775
protected _moveColumns(from: IgxColumnComponent, to: IgxColumnComponent, pos: DropPosition) {
37603776
const list = this.columnList.toArray();
3761-
const fromIndex = list.indexOf(from);
3762-
let toIndex = list.indexOf(to);
3763-
3764-
if (pos === DropPosition.BeforeDropTarget) {
3765-
toIndex--;
3766-
if (toIndex < 0) {
3767-
toIndex = 0;
3768-
}
3769-
}
3770-
3771-
if (pos === DropPosition.AfterDropTarget) {
3772-
toIndex++;
3773-
}
3774-
3775-
list.splice(toIndex, 0, ...list.splice(fromIndex, 1));
3777+
this._reorderColumns(from, to, pos, list);
37763778
const newList = this._resetColumnList(list);
37773779
this.columnList.reset(newList);
37783780
this.columnList.notifyOnChanges();
@@ -3800,39 +3802,27 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
38003802
* @hidden
38013803
*/
38023804
protected _reorderColumns(from: IgxColumnComponent, to: IgxColumnComponent, position: DropPosition, columnCollection: any[]) {
3803-
let dropIndex = columnCollection.indexOf(to);
3805+
const fromIndex = columnCollection.indexOf(from);
3806+
const childColumnsCount = from.allChildren.length;
3807+
// remove item(s) to be moved.
3808+
const fromCollection = columnCollection.splice(fromIndex, childColumnsCount + 1);
38043809

3805-
if (to.columnGroup) {
3806-
dropIndex += to.allChildren.length;
3807-
}
3808-
3809-
if (position === DropPosition.BeforeDropTarget) {
3810-
dropIndex--;
3811-
}
3810+
let dropIndex = columnCollection.indexOf(to);
38123811

38133812
if (position === DropPosition.AfterDropTarget) {
38143813
dropIndex++;
3814+
if (to.columnGroup) {
3815+
dropIndex += to.allChildren.length;
3816+
}
38153817
}
3816-
3817-
columnCollection.splice(dropIndex, 0, ...columnCollection.splice(columnCollection.indexOf(from), 1));
3818+
columnCollection.splice(dropIndex, 0, ...fromCollection);
38183819
}
38193820
/**
38203821
* @hidden
38213822
*/
38223823
protected _moveChildColumns(parent: IgxColumnComponent, from: IgxColumnComponent, to: IgxColumnComponent, pos: DropPosition) {
38233824
const buffer = parent.children.toArray();
3824-
const fromIndex = buffer.indexOf(from);
3825-
let toIndex = buffer.indexOf(to);
3826-
3827-
if (pos === DropPosition.BeforeDropTarget) {
3828-
toIndex--;
3829-
}
3830-
3831-
if (pos === DropPosition.AfterDropTarget) {
3832-
toIndex++;
3833-
}
3834-
3835-
buffer.splice(toIndex, 0, ...buffer.splice(fromIndex, 1));
3825+
this._reorderColumns(from, to, pos, buffer);
38363826
parent.children.reset(buffer);
38373827
}
38383828
/**
@@ -3844,19 +3834,17 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
38443834
*/
38453835
public moveColumn(column: IgxColumnComponent, dropTarget: IgxColumnComponent, pos: DropPosition = DropPosition.None) {
38463836

3837+
if (column === dropTarget) {
3838+
return;
3839+
}
38473840
let position = pos;
3848-
const fromIndex = column.visibleIndex;
3849-
const toIndex = dropTarget.visibleIndex;
3850-
3851-
if (pos === DropPosition.BeforeDropTarget && fromIndex < toIndex) {
3852-
position = DropPosition.BeforeDropTarget;
3853-
} else if (pos === DropPosition.AfterDropTarget && fromIndex > toIndex) {
3854-
position = DropPosition.AfterDropTarget;
3855-
} else {
3856-
position = DropPosition.None;
3841+
if (position === DropPosition.None) {
3842+
warningShown = showMessage(
3843+
'DropPosition.None is deprecated.' +
3844+
'Use DropPosition.AfterDropTarget instead.',
3845+
warningShown);
3846+
position = DropPosition.AfterDropTarget;
38573847
}
3858-
3859-
38603848
if ((column.level !== dropTarget.level) ||
38613849
(column.topLevelParent !== dropTarget.topLevelParent)) {
38623850
return;
@@ -3914,6 +3902,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
39143902
if (this.hasColumnLayouts) {
39153903
this.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
39163904
}
3905+
// after reordering is done reset cached column collections.
3906+
this.resetColumnCollections();
3907+
column.resetCaches();
39173908

39183909
const args = {
39193910
source: column,
@@ -5197,8 +5188,8 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
51975188
* @hidden
51985189
*/
51995190
protected reinitPinStates() {
5200-
this._pinnedColumns = (this.hasColumnGroups) ? this.columnList.filter((c) => c.pinned) :
5201-
this.columnList.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
5191+
this._pinnedColumns = this.columnList
5192+
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
52025193
this._unpinnedColumns = this.hasColumnGroups ? this.columnList.filter((c) => !c.pinned) :
52035194
this.columnList.filter((c) => !c.pinned)
52045195
.sort((a, b) => this._unpinnedColumns.indexOf(a) - this._unpinnedColumns.indexOf(b));

0 commit comments

Comments
 (0)