Skip to content

Commit e9497e2

Browse files
Merge branch '10.2.x' into ibarakov/fix-8179-10.2.x
2 parents 79efb47 + a0ed56b commit e9497e2

File tree

10 files changed

+115
-7
lines changed

10 files changed

+115
-7
lines changed

projects/igniteui-angular/src/lib/core/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ export const NAVIGATION_KEYS = new Set([
329329
export const ROW_EXPAND_KEYS = new Set('right down arrowright arrowdown'.split(' '));
330330
export const ROW_COLLAPSE_KEYS = new Set('left up arrowleft arrowup'.split(' '));
331331
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup', '+', 'add']);
332-
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc' , 'l']);
332+
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc' , 'l',
333+
/** This symbol corresponds to the Alt + L combination under MAC. */
334+
'¬']);
333335

334336
/**
335337
* @hidden

projects/igniteui-angular/src/lib/grids/filtering/excel-style/grid.excel-style-filtering.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
619619

620620
private addItems(shouldUpdateSelection: boolean) {
621621
this.selectAllSelected = true;
622+
this.containsNullOrEmpty = false;
622623
this.selectAllIndeterminate = false;
623624

624625
this.uniqueValues.forEach(element => {

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ export class IgxGridNavigationService {
542542
if ([' ', 'spacebar', 'space'].indexOf(key) !== -1) {
543543
this.handleColumnSelection(column, event);
544544
}
545-
if (alt && key === 'l' && this.grid.allowAdvancedFiltering) {
545+
if (alt && (key === 'l' || key === '¬') && this.grid.allowAdvancedFiltering) {
546546
this.grid.openAdvancedFilteringDialog();
547547
}
548548
if (ctrl && shift && key === 'l' && this.grid.allowFiltering && !column.columnGroup && column.filterable) {

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4860,6 +4860,20 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
48604860
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
48614861
expect(inputNativeElement.value).toBe('', 'input value didn\'t reset');
48624862
}));
4863+
4864+
it('Should reset blank items on column change.', fakeAsync(() => {
4865+
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName');
4866+
flush();
4867+
4868+
let listItems = GridFunctions.getExcelStyleSearchComponentListItems(fix);
4869+
expect(listItems[1].innerText).toBe('(Blanks)');
4870+
4871+
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'AnotherField');
4872+
flush();
4873+
4874+
listItems = GridFunctions.getExcelStyleSearchComponentListItems(fix);
4875+
expect(listItems[1].innerText).not.toBe('(Blanks)');
4876+
}));
48634877
});
48644878

48654879
describe('Load values on demand', () => {

projects/igniteui-angular/src/lib/services/excel/excel-exporter-grid.spec.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IgxExcelExporterService } from './excel-exporter';
99
import { IgxExcelExporterOptions } from './excel-exporter-options';
1010
import { JSZipWrapper } from './jszip-verification-wrapper.spec';
1111
import { FileContentData } from './test-data.service.spec';
12-
import { ReorderedColumnsComponent, GridIDNameJobTitleComponent, ProductsComponent } from '../../test-utils/grid-samples.spec';
12+
import { ReorderedColumnsComponent, GridIDNameJobTitleComponent, ProductsComponent, GridIDNameJobTitleHireDataPerformanceComponent } from '../../test-utils/grid-samples.spec';
1313
import { SampleTestData } from '../../test-utils/sample-test-data.spec';
1414
import { first } from 'rxjs/operators';
1515
import { DefaultSortingStrategy } from '../../data-operations/sorting-strategy';
@@ -37,7 +37,8 @@ describe('Excel Exporter', () => {
3737
GridIDNameJobTitleComponent,
3838
IgxTreeGridPrimaryForeignKeyComponent,
3939
ProductsComponent,
40-
GridWithEmtpyColumnsComponent
40+
GridWithEmtpyColumnsComponent,
41+
GridIDNameJobTitleHireDataPerformanceComponent
4142
],
4243
imports: [IgxGridModule, IgxTreeGridModule, NoopAnimationsModule]
4344
}).compileComponents();
@@ -511,6 +512,16 @@ describe('Excel Exporter', () => {
511512

512513
await setWorksheetNameAndExport(grid, options, fix, worksheetName);
513514
});
515+
516+
it('Should export arrays as strings.', async () => {
517+
const fix = TestBed.createComponent(GridIDNameJobTitleHireDataPerformanceComponent);
518+
fix.detectChanges();
519+
await wait();
520+
521+
const grid = fix.componentInstance.grid;
522+
523+
await exportAndVerify(grid, options, actualData.personJobHoursDataPerformance);
524+
});
514525
});
515526

516527
describe('', () => {

projects/igniteui-angular/src/lib/services/excel/test-data.service.spec.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,28 @@ export class ExportTestDataService {
122122
{ ID: 9, Name: 'Leslie Hansen', JobTitle: 'Associate Software Developer', HireDate: '2013-10-10T11:23:17.714Z' },
123123
{ ID: 10, Name: 'Eduardo Ramirez', JobTitle: 'Manager', HireDate: '2011-11-28T11:23:17.714Z' }
124124
];
125+
126+
private _personJobHoursDataPerformance = [
127+
{ ID: 1, Name: 'Casey Houston', JobTitle: 'Vice President', WorkingHours: 4, HireDate: '2017-06-19T11:43:07.714Z', Performance: [
128+
{Points: 3, Week: 1},
129+
{Points: 6, Week: 2},
130+
{Points: 1, Week: 3},
131+
{Points: 12, Week: 4},
132+
] },
133+
{ ID: 2, Name: 'Gilberto Todd', JobTitle: 'Director', WorkingHours: 6, HireDate: '2015-12-18T11:23:17.714Z', Performance: [
134+
{Points: 8, Week: 1},
135+
{Points: 7, Week: 2},
136+
{Points: 4, Week: 3},
137+
{Points: 9, Week: 4},
138+
] },
139+
{ ID: 3, Name: 'Tanya Bennett', JobTitle: 'Director', WorkingHours: 8, HireDate: '2005-11-18T11:23:17.714Z', Performance: [
140+
{Points: 1, Week: 1},
141+
{Points: 3, Week: 2},
142+
{Points: 14, Week: 3},
143+
{Points: 29, Week: 4},
144+
] }
145+
];
146+
125147
constructor() { }
126148

127149
get differentTypesData() {
@@ -163,6 +185,10 @@ export class ExportTestDataService {
163185
return this._simpleGridDataFull;
164186
}
165187

188+
get personJobHoursDataPerformance() {
189+
return this._personJobHoursDataPerformance;
190+
}
191+
166192
public getContactsFunkyData(delimiter) {
167193
return [{
168194
name: 'Terrance Mc\'Orta',
@@ -957,5 +983,21 @@ export class FileContentData {
957983

958984
return this.createData();
959985
}
986+
987+
get personJobHoursDataPerformance() {
988+
this._sharedStringsData =
989+
`count="18" uniqueCount="15"><si><t>ID</t></si><si><t>Name</t></si><si><t>JobTitle</t></si><si><t>WorkingHours</t></si><si><t>HireDate</t></si><si><t>Performance</t></si><si><t>Casey Houston</t></si><si><t>Vice President</t></si><si><t>2017-06-19T11:43:07.714Z</t></si><si><t>[object Object],[object Object],[object Object],[object Object]</t></si><si><t>Gilberto Todd</t></si><si><t>Director</t></si><si><t>2015-12-18T11:23:17.714Z</t></si><si><t>Tanya Bennett</t></si><si><t>2005-11-18T11:23:17.714Z</t></si>`;
990+
991+
this._tableData = `ref="A1:F4" totalsRowShown="0">
992+
<autoFilter ref="A1:F4"/><tableColumns count="6"><tableColumn id="1" name="ID"/><tableColumn id="2" name="Name"/><tableColumn id="3" name="JobTitle"/><tableColumn id="4" name="WorkingHours"/><tableColumn id="5" name="HireDate"/><tableColumn id="6" name="Performance"/></tableColumns>`;
993+
994+
this._worksheetData = `<dimension ref="A1:F4"/>
995+
<sheetViews><sheetView tabSelected="1" workbookViewId="0"></sheetView></sheetViews>
996+
<sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>
997+
<cols><col min="1" max="1" width="50" customWidth="1"/><col min="2" max="2" width="50" customWidth="1"/><col min="3" max="3" width="50" customWidth="1"/><col min="4" max="4" width="50" customWidth="1"/><col min="5" max="5" width="50" customWidth="1"/><col min="6" max="6" width="50" customWidth="1"/></cols>
998+
<sheetData><row r="1"><c r="A1" t="s"><v>0</v></c><c r="B1" t="s"><v>1</v></c><c r="C1" t="s"><v>2</v></c><c r="D1" t="s"><v>3</v></c><c r="E1" t="s"><v>4</v></c><c r="F1" t="s"><v>5</v></c></row><row r="2"><c r="A2" s="1"><v>1</v></c><c r="B2" t="s"><v>6</v></c><c r="C2" t="s"><v>7</v></c><c r="D2" s="1"><v>4</v></c><c r="E2" t="s"><v>8</v></c><c r="F2" t="s"><v>9</v></c></row><row r="3"><c r="A3" s="1"><v>2</v></c><c r="B3" t="s"><v>10</v></c><c r="C3" t="s"><v>11</v></c><c r="D3" s="1"><v>6</v></c><c r="E3" t="s"><v>12</v></c><c r="F3" t="s"><v>9</v></c></row><row r="4"><c r="A4" s="1"><v>3</v></c><c r="B4" t="s"><v>13</v></c><c r="C4" t="s"><v>11</v></c><c r="D4" s="1"><v>8</v></c><c r="E4" t="s"><v>14</v></c><c r="F4" t="s"><v>9</v></c></row></sheetData>`;
999+
1000+
return this.createData();
1001+
}
9601002
/* tslint:enable max-line-length */
9611003
}

projects/igniteui-angular/src/lib/services/excel/worksheet-data-dictionary.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ export class WorksheetDataDictionary {
4747

4848
public saveValue(value: any, column: number, isHeader: boolean): number {
4949
if (this._columnTypeInfo[column] === undefined && isHeader === false) {
50-
this._columnTypeInfo[column] = typeof value === 'string' ||
51-
typeof value === 'boolean' ||
52-
value instanceof Date;
50+
this._columnTypeInfo[column] = typeof value !== 'number' && value !== Number(value) && !Number.isFinite(value);
5351
}
5452

5553
let sanitizedValue = '';

projects/igniteui-angular/src/lib/test-utils/grid-samples.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,13 @@ export class GridIDNameJobTitleComponent extends PagingComponent {
727727
height = '100%';
728728
}
729729

730+
@Component({
731+
template: GridTemplateStrings.declareBasicGridWithColumns(ColumnDefinitions.idNameJobHoursHireDatePerformance)
732+
})
733+
export class GridIDNameJobTitleHireDataPerformanceComponent extends BasicGridComponent {
734+
data = SampleTestData.personJobHoursDataPerformance();
735+
}
736+
730737
@Component({
731738
template: `<div style="margin: 50px;">
732739
${GridTemplateStrings.declareGrid(

projects/igniteui-angular/src/lib/test-utils/sample-test-data.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,30 @@ export class SampleTestData {
173173
{ ID: 10, Name: "Eduardo Ramirez", JobTitle: "Manager", HireDate: "2011-11-28T11:23:17.714Z" }
174174
])
175175

176+
/* Data fields: ID: number, Name: string, JobTitle: string, WokingHours: number, HireDate: string, Performance: array;
177+
3 items, sorted by ID. */
178+
public static personJobHoursDataPerformance = () => ([
179+
{ ID: 1, Name: "Casey Houston", JobTitle: "Vice President", WorkingHours: 4, HireDate: "2017-06-19T11:43:07.714Z", Performance: [
180+
{Points: 3, Week: 1},
181+
{Points: 6, Week: 2},
182+
{Points: 1, Week: 3},
183+
{Points: 12, Week: 4},
184+
] },
185+
{ ID: 2, Name: "Gilberto Todd", JobTitle: "Director", WorkingHours: 6, HireDate: "2015-12-18T11:23:17.714Z", Performance: [
186+
{Points: 8, Week: 1},
187+
{Points: 7, Week: 2},
188+
{Points: 4, Week: 3},
189+
{Points: 9, Week: 4},
190+
] },
191+
{ ID: 3, Name: "Tanya Bennett", JobTitle: "Director", WorkingHours: 8, HireDate: "2005-11-18T11:23:17.714Z", Performance: [
192+
{Points: 1, Week: 1},
193+
{Points: 3, Week: 2},
194+
{Points: 14, Week: 3},
195+
{Points: 29, Week: 4},
196+
] },
197+
])
198+
199+
176200
/* Data fields: ID: number, Name: string, JobTitle: string; 10 items, sorted by ID. */
177201
public static personJobData = () => ([
178202
{ ID: 1, Name: "Casey Houston", JobTitle: "Vice President" },

projects/igniteui-angular/src/lib/test-utils/template-strings.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ export class ColumnDefinitions {
7575
<igx-column field="HireDate" pinned="true"></igx-column>
7676
`;
7777

78+
public static idNameJobHoursHireDatePerformance = `
79+
<igx-column field="ID"></igx-column>
80+
<igx-column field="Name"></igx-column>
81+
<igx-column field="JobTitle"></igx-column>
82+
<igx-column field="WorkingHours"></igx-column>
83+
<igx-column field="HireDate"></igx-column>
84+
<igx-column field="Performance"></igx-column>
85+
`;
86+
7887
public static nameJobTitleId = `
7988
<igx-column field="Name"></igx-column>
8089
<igx-column field="JobTitle"></igx-column>

0 commit comments

Comments
 (0)