Skip to content

Commit d31b73f

Browse files
committed
Merge branch 'pivot-grid-master' of https://github.com/IgniteUI/igniteui-angular into mdragnev/feat-10713
2 parents 0018710 + 77bbb70 commit d31b73f

35 files changed

+839
-156
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ All notable changes for each version of this project will be documented in this
2121
info
2222
</button>
2323
```
24+
- `IgxTabs` have full right-to-left (RTL) support.
25+
2426
### General
2527

2628
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`

projects/igniteui-angular/src/lib/core/styles/components/tabs/_tabs-theme.scss

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,23 @@
5858
@function igx-tabs-theme(
5959
$palette: null,
6060
$schema: $light-schema,
61-
6261
$item-text-color: null,
6362
$item-background: null,
64-
6563
$item-hover-background: null,
6664
$item-hover-color: null,
67-
6865
$item-active-color: null,
6966
$item-active-icon-color: null,
7067
$item-active-background: null,
7168
$indicator-color: null,
72-
7369
$button-color: null,
7470
$button-background: null,
7571
$button-hover-background: null,
7672
$button-hover-color: null,
77-
7873
$tab-ripple-color: null,
7974
$button-ripple-color: null,
8075
$border-radius: null,
81-
8276
$border-color: null,
8377
$border-color--hover: null,
84-
8578
$disable-shadow: true
8679
) {
8780
$name: 'igx-tabs';
@@ -347,6 +340,10 @@
347340
display: none;
348341
}
349342

343+
@include if-rtl() {
344+
transform: scaleX(-1);
345+
}
346+
350347
@include igx-ripple($button-ripple-theme);
351348
@include igx-css-vars($button-ripple-theme);
352349
}
@@ -594,5 +591,3 @@
594591
}
595592
}
596593
}
597-
598-

projects/igniteui-angular/src/lib/grids/common/grid.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export interface RowType {
9797
parent?: RowType;
9898
hasChildren?: boolean;
9999
treeRow? : ITreeGridRecord;
100-
addRowUI?: any;
100+
addRowUI?: boolean;
101101
focused?: boolean;
102102
grid: GridType;
103103
onRowSelectorClick?: (event: MouseEvent) => void;

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6512,12 +6512,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
65126512
this.tbody.nativeElement.style.display = 'none';
65136513
let res = !this.nativeElement.parentElement ||
65146514
this.nativeElement.parentElement.clientHeight === 0 ||
6515-
this.nativeElement.parentElement.clientHeight === renderedHeight;
6516-
if (!this.platform.isChromium && !this.platform.isFirefox) {
6515+
this.nativeElement.parentElement.clientHeight === renderedHeight ||
65176516
// If grid causes the parent container to extend (for example when container is flex)
65186517
// we should always auto-size since the actual size of the container will continuously change as the grid renders elements.
6519-
res = this.checkContainerSizeChange();
6520-
}
6518+
this.checkContainerSizeChange();
65216519
this.tbody.nativeElement.style.display = '';
65226520
return res;
65236521
}

projects/igniteui-angular/src/lib/grids/grid-public-row.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IGroupByRecord } from '../data-operations/groupby-record.interface';
2-
import { IgxEditRow } from './common/crud.service';
2+
import { IgxAddRow, IgxEditRow } from './common/crud.service';
33
import { GridInstanceType, GridSummaryCalculationMode, GridSummaryPosition } from './common/enums';
44
import { IgxGridCell } from './grid-public-cell';
55
import { IgxSummaryResult } from './summaries/grid-summary';
@@ -38,6 +38,19 @@ abstract class BaseRow implements RowType {
3838
return primaryKey ? data[primaryKey] : data;
3939
}
4040

41+
/**
42+
* Gets if this represents add row UI
43+
*
44+
* ```typescript
45+
* let isAddRow = row.addRowUI;
46+
* ```
47+
*/
48+
public get addRowUI(): boolean {
49+
return !!this.grid.crudService.row &&
50+
this.grid.crudService.row.getClassName() === IgxAddRow.name &&
51+
this.grid.crudService.row.id === this.key;
52+
}
53+
4154
/**
4255
* The data record that populates the row.
4356
*

projects/igniteui-angular/src/lib/grids/grid/grid-mrl-keyboard-nav.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,7 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
17851785
expect(fix.componentInstance.selectedCell.column.field).toMatch('Phone');
17861786

17871787
GridFunctions.simulateGridContentKeydown(fix, 'ArrowDown');
1788+
await waitForSelectionChange(fix.componentInstance.grid);
17881789
fix.detectChanges();
17891790

17901791
expect(fix.componentInstance.selectedCell.value).toEqual(fix.componentInstance.data[0].Fax);

projects/igniteui-angular/src/lib/grids/headers/grid-header.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ export class IgxGridHeaderComponent implements DoCheck, OnDestroy {
213213
}
214214
}
215215
}
216-
if (!this.grid.isPivot || !this.grid.navigation.isRowHeaderActive) {
217-
this.grid.theadRow.nativeElement.focus();
218-
}
216+
this.grid.theadRow.nativeElement.focus();
219217
}
220218

221219
/**

projects/igniteui-angular/src/lib/grids/headers/headers.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export { IgxGridHeaderRowComponent } from './grid-header-row.component';
3737
IgxGridHeaderGroupComponent,
3838
IgxGridHeaderRowComponent,
3939
IgxHeaderGroupWidthPipe,
40+
SortingIndexPipe,
4041
IgxHeaderGroupStylePipe
4142
]
4243
})

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { IgxGridComponent } from '../grid/grid.component';
88
import { IgxPivotHeaderRowComponent } from './pivot-header-row.component';
99
import { IgxPivotRowDimensionContentComponent } from './pivot-row-dimension-content.component';
1010
import { IgxPivotRowDimensionHeaderGroupComponent } from './pivot-row-dimension-header-group.component';
11+
import { IgxPivotRowDimensionHeaderComponent } from './pivot-row-dimension-header.component';
1112

1213
/**
1314
* @hidden
@@ -18,6 +19,7 @@ import { IgxPivotRowDimensionHeaderGroupComponent } from './pivot-row-dimension-
1819
IgxPivotRowComponent,
1920
IgxPivotHeaderRowComponent,
2021
IgxPivotRowDimensionContentComponent,
22+
IgxPivotRowDimensionHeaderComponent,
2123
IgxPivotRowDimensionHeaderGroupComponent,
2224
IgxPivotRowPipe,
2325
IgxPivotRowExpansionPipe,
@@ -32,6 +34,7 @@ import { IgxPivotRowDimensionHeaderGroupComponent } from './pivot-row-dimension-
3234
IgxPivotRowComponent,
3335
IgxPivotHeaderRowComponent,
3436
IgxPivotRowDimensionContentComponent,
37+
IgxPivotRowDimensionHeaderComponent,
3538
IgxPivotRowDimensionHeaderGroupComponent,
3639
IgxPivotRowExpansionPipe,
3740
IgxPivotRowPipe,

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.pipes.spec.ts

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { IgxPivotNumericAggregate } from './pivot-grid-aggregate';
66
import { IPivotConfiguration } from './pivot-grid.interface';
77
import { IgxPivotColumnPipe, IgxPivotRowExpansionPipe, IgxPivotRowPipe } from './pivot-grid.pipes';
88
import { PivotGridFunctions } from '../../test-utils/pivot-grid-functions.spec';
9+
import { DATA } from 'src/app/shared/pivot-data';
910

1011
describe('Pivot pipes #pivotGrid', () => {
1112
let rowPipe: IgxPivotRowPipe;
@@ -1532,4 +1533,117 @@ describe('Pivot pipes #pivotGrid', () => {
15321533
{ Years: '2021', AllProduct: 'All Products', Discontinued: 'false', Country: 'USA', SellerName: 'John' }
15331534
]);
15341535
});
1536+
// automation for https://github.com/IgniteUI/igniteui-angular/issues/10545
1537+
it('should generate last dimension values for all records.', () => {
1538+
data = [
1539+
{
1540+
ProductCategory: 'Clothing', UnitPrice: 12.81, SellerName: 'Stanley',
1541+
Country: 'Bulgaria', City: 'Sofia', Date: '01/01/2021', UnitsSold: 282
1542+
},
1543+
{
1544+
ProductCategory: 'Clothing', UnitPrice: 49.57, SellerName: 'Elisa',
1545+
Country: 'USA', City: 'New York', Date: '01/05/2019', UnitsSold: 296
1546+
},
1547+
{
1548+
ProductCategory: 'Bikes', UnitPrice: 3.56, SellerName: 'Lydia',
1549+
Country: 'Uruguay', City: 'Ciudad de la Costa', Date: '01/06/2020', UnitsSold: 68
1550+
},
1551+
{
1552+
ProductCategory: 'Accessories', UnitPrice: 85.58, SellerName: 'David',
1553+
Country: 'USA', City: 'New York', Date: '04/07/2021', UnitsSold: 293
1554+
},
1555+
{
1556+
ProductCategory: 'Components', UnitPrice: 18.13, SellerName: 'John',
1557+
Country: 'USA', City: 'New York', Date: '12/08/2021', UnitsSold: 240
1558+
},
1559+
{
1560+
ProductCategory: 'Clothing', UnitPrice: 68.33, SellerName: 'Larry',
1561+
Country: 'Uruguay', City: 'Ciudad de la Costa', Date: '05/12/2020', UnitsSold: 456
1562+
},
1563+
{
1564+
ProductCategory: 'Clothing', UnitPrice: 16.05, SellerName: 'Walter',
1565+
Country: 'Bulgaria', City: 'Plovdiv', Date: '02/19/2020', UnitsSold: 492
1566+
}];
1567+
pivotConfig.columns = [{
1568+
memberName: 'Country',
1569+
enabled: true
1570+
}];
1571+
pivotConfig.rows = [
1572+
new IgxPivotDateDimension(
1573+
{
1574+
memberName: 'Date',
1575+
enabled: true
1576+
},
1577+
{
1578+
months: false
1579+
}
1580+
),
1581+
{
1582+
memberName: 'City',
1583+
enabled: true
1584+
},
1585+
{
1586+
memberFunction: () => 'All',
1587+
memberName: 'AllProducts',
1588+
enabled: true,
1589+
childLevel: {
1590+
memberFunction: (recData) => recData.ProductCategory,
1591+
memberName: 'ProductCategory',
1592+
enabled: true
1593+
}
1594+
},
1595+
{
1596+
memberName: 'SellerName',
1597+
enabled: true
1598+
}
1599+
];
1600+
const rowPipeResult = rowPipe.transform(data, pivotConfig, expansionStates);
1601+
const columnPipeResult = columnPipe.transform(rowPipeResult, pivotConfig, new Map<any, boolean>());
1602+
const rowStatePipeResult = rowStatePipe.transform(columnPipeResult, pivotConfig, expansionStates, true);
1603+
const sellers = rowStatePipeResult.map(x => x.SellerName);
1604+
// there should be no empty values.
1605+
expect(sellers.filter(x => x === undefined).length).toBe(0);
1606+
});
1607+
1608+
// automation for https://github.com/IgniteUI/igniteui-angular/issues/10662
1609+
it('should retain processed values for last dimension when bound to complex object.', () => {
1610+
data = DATA;
1611+
pivotConfig.rows = [
1612+
{
1613+
memberName: 'Date',
1614+
enabled: true,
1615+
},
1616+
{
1617+
memberName: 'AllProduct',
1618+
memberFunction: () => 'All Products',
1619+
enabled: true,
1620+
childLevel:
1621+
{
1622+
1623+
memberName: 'Product',
1624+
memberFunction: (recData) => recData.Product.Name,
1625+
enabled: true
1626+
}
1627+
},
1628+
{
1629+
memberName: 'AllSeller',
1630+
memberFunction: () => 'All Sellers',
1631+
enabled: true,
1632+
childLevel:
1633+
{
1634+
memberName: 'Seller',
1635+
memberFunction: (recData) => recData.Seller.Name,
1636+
enabled: true,
1637+
},
1638+
},
1639+
];
1640+
1641+
const rowPipeResult = rowPipe.transform(data, pivotConfig, expansionStates);
1642+
const columnPipeResult = columnPipe.transform(rowPipeResult, pivotConfig, new Map<any, boolean>());
1643+
const rowStatePipeResult = rowStatePipe.transform(columnPipeResult, pivotConfig, expansionStates, true);
1644+
1645+
const res = rowStatePipeResult.filter(x => x.AllSeller === undefined).map(x => x.Seller);
1646+
// all values should be strings as the result of the processed member function is string.
1647+
expect(res.filter(x => typeof x !== 'string').length).toBe(0);
1648+
});
15351649
});

0 commit comments

Comments
 (0)