Skip to content

Commit 6e55d6a

Browse files
authored
Merge branch 'master' into mkirova/hgrid-remote-POC
2 parents de44aba + 283d4fa commit 6e55d6a

21 files changed

+148
-108
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ All notable changes for each version of this project will be documented in this
55
## 10.0.0
66

77
### General
8+
- `igxGrid`
9+
- **Behavioral Change** - Group rows now display the group column's header name instead of field when one is available.
810
- `igx-select`, `igx-combo`, `igx-drop-down`
9-
- **Behavioral Change** - The select, combo, and dropdown items now have display block and text-overflow ellipsis enabled by default.
11+
- **Behavioral Change** - The select, combo, and dropdown items now have display block and text-overflow ellipsis enabled by default.
1012
- `IgxTransaction` - The `onStateUpdate` now emits with information of its origin. The emitted value is of type `StateUpdateEvent`, which has two properties:
1113
- `origin` - it can vary within the values of the `TransactionEventOrigin` interface;
1214
- `actions` - contains information about the transactions, that caused the emission of the event.
@@ -20,7 +22,7 @@ All notable changes for each version of this project will be documented in this
2022
### General
2123
- `IgxHierarchicalGrid`
2224
- `onGridInitialized` - New output has been exposed. Emitted after a grid is being initialized for the corresponding row island.
23-
25+
- **Behavioral Change** - When moving a column `DropPosition.None` is now acting like `DropPosition.AfterDropTarget`.
2426
## 9.1.0
2527

2628
### General

ROADMAP.md

+13-13
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

+2
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

+3-1
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

+24-7
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

+27-51
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@ import { IgxColumnGroupComponent } from './columns/column-group.component';
151151
import { IGridSortingStrategy } from '../data-operations/sorting-strategy';
152152
import { IgxRowDragGhostDirective, IgxDragIndicatorIconDirective } from './row-drag.directive';
153153
import { isNumber } from 'util';
154+
import { showMessage } from '../core/deprecateDecorators';
154155

155156
const MINIMUM_COLUMN_WIDTH = 136;
156157
const FILTER_ROW_HEIGHT = 50;
157-
158+
let warningShown = false;
158159
// By default row editing overlay outlet is inside grid body so that overlay is hidden below grid header when scrolling.
159160
// 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.
160161
// Default row editing overlay height is higher then row height that is why the case is valid also for row with 2 rows.
@@ -3773,21 +3774,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
37733774
*/
37743775
protected _moveColumns(from: IgxColumnComponent, to: IgxColumnComponent, pos: DropPosition) {
37753776
const list = this.columnList.toArray();
3776-
const fromIndex = list.indexOf(from);
3777-
let toIndex = list.indexOf(to);
3778-
3779-
if (pos === DropPosition.BeforeDropTarget) {
3780-
toIndex--;
3781-
if (toIndex < 0) {
3782-
toIndex = 0;
3783-
}
3784-
}
3785-
3786-
if (pos === DropPosition.AfterDropTarget) {
3787-
toIndex++;
3788-
}
3789-
3790-
list.splice(toIndex, 0, ...list.splice(fromIndex, 1));
3777+
this._reorderColumns(from, to, pos, list);
37913778
const newList = this._resetColumnList(list);
37923779
this.columnList.reset(newList);
37933780
this.columnList.notifyOnChanges();
@@ -3815,39 +3802,27 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
38153802
* @hidden
38163803
*/
38173804
protected _reorderColumns(from: IgxColumnComponent, to: IgxColumnComponent, position: DropPosition, columnCollection: any[]) {
3818-
let dropIndex = columnCollection.indexOf(to);
3819-
3820-
if (to.columnGroup) {
3821-
dropIndex += to.allChildren.length;
3822-
}
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);
38233809

3824-
if (position === DropPosition.BeforeDropTarget) {
3825-
dropIndex--;
3826-
}
3810+
let dropIndex = columnCollection.indexOf(to);
38273811

38283812
if (position === DropPosition.AfterDropTarget) {
38293813
dropIndex++;
3814+
if (to.columnGroup) {
3815+
dropIndex += to.allChildren.length;
3816+
}
38303817
}
3831-
3832-
columnCollection.splice(dropIndex, 0, ...columnCollection.splice(columnCollection.indexOf(from), 1));
3818+
columnCollection.splice(dropIndex, 0, ...fromCollection);
38333819
}
38343820
/**
38353821
* @hidden
38363822
*/
38373823
protected _moveChildColumns(parent: IgxColumnComponent, from: IgxColumnComponent, to: IgxColumnComponent, pos: DropPosition) {
38383824
const buffer = parent.children.toArray();
3839-
const fromIndex = buffer.indexOf(from);
3840-
let toIndex = buffer.indexOf(to);
3841-
3842-
if (pos === DropPosition.BeforeDropTarget) {
3843-
toIndex--;
3844-
}
3845-
3846-
if (pos === DropPosition.AfterDropTarget) {
3847-
toIndex++;
3848-
}
3849-
3850-
buffer.splice(toIndex, 0, ...buffer.splice(fromIndex, 1));
3825+
this._reorderColumns(from, to, pos, buffer);
38513826
parent.children.reset(buffer);
38523827
}
38533828
/**
@@ -3859,19 +3834,17 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
38593834
*/
38603835
public moveColumn(column: IgxColumnComponent, dropTarget: IgxColumnComponent, pos: DropPosition = DropPosition.None) {
38613836

3837+
if (column === dropTarget) {
3838+
return;
3839+
}
38623840
let position = pos;
3863-
const fromIndex = column.visibleIndex;
3864-
const toIndex = dropTarget.visibleIndex;
3865-
3866-
if (pos === DropPosition.BeforeDropTarget && fromIndex < toIndex) {
3867-
position = DropPosition.BeforeDropTarget;
3868-
} else if (pos === DropPosition.AfterDropTarget && fromIndex > toIndex) {
3869-
position = DropPosition.AfterDropTarget;
3870-
} else {
3871-
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;
38723847
}
3873-
3874-
38753848
if ((column.level !== dropTarget.level) ||
38763849
(column.topLevelParent !== dropTarget.topLevelParent)) {
38773850
return;
@@ -3929,6 +3902,9 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
39293902
if (this.hasColumnLayouts) {
39303903
this.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
39313904
}
3905+
// after reordering is done reset cached column collections.
3906+
this.resetColumnCollections();
3907+
column.resetCaches();
39323908

39333909
const args = {
39343910
source: column,
@@ -5212,8 +5188,8 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
52125188
* @hidden
52135189
*/
52145190
protected reinitPinStates() {
5215-
this._pinnedColumns = (this.hasColumnGroups) ? this.columnList.filter((c) => c.pinned) :
5216-
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));
52175193
this._unpinnedColumns = this.hasColumnGroups ? this.columnList.filter((c) => !c.pinned) :
52185194
this.columnList.filter((c) => !c.pinned)
52195195
.sort((a, b) => this._unpinnedColumns.indexOf(a) - this._unpinnedColumns.indexOf(b));

0 commit comments

Comments
 (0)