Skip to content

Commit 69e2eda

Browse files
authored
Merge branch '10.1.x' into ddincheva/bugFixs8294-10.1
2 parents ae1b78a + b8e2705 commit 69e2eda

File tree

19 files changed

+151
-88
lines changed

19 files changed

+151
-88
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master, 9.1.x, 10.0.x, 10.1.x ]
8+
branches: [ master, '[0-9]+.[0-9]+.x' ]
99
pull_request:
10-
branches: [ master, 9.1.x, 10.0.x, 10.1.x ]
10+
branches: [ master, '[0-9]+.[0-9]+.x' ]
1111

1212
jobs:
1313
build:

angular.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
"with": "src/environments/environment.hmr.ts"
7070
}
7171
]
72+
},
73+
"es5": {
74+
"tsConfig": "src/tsconfig-es5.app.json"
7275
}
7376
}
7477
},
@@ -85,6 +88,9 @@
8588
"hmr": true,
8689
"hmrWarning": false,
8790
"browserTarget": "igniteui-dev-demos:build:hmr"
91+
},
92+
"es5": {
93+
"browserTarget": "igniteui-dev-demos:build:es5"
8894
}
8995
}
9096
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve --open --configuration hmr",
7+
"start-es5": "ng serve --configuration es5 -o",
78
"build": "ng build",
89
"test": "ng test",
910
"lint": "ng lint",

projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
401401
private _cdr: ChangeDetectorRef,
402402
private _moduleRef: NgModuleRef<any>,
403403
private _injector: Injector,
404-
private _renderer: Renderer2) { }
404+
private _renderer: Renderer2) {
405+
}
406+
405407

406408
/**
407409
* Gets the input group template.
@@ -801,7 +803,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
801803
return this._inputGroup || this._inputGroupUserTemplate || null;
802804
}
803805

804-
/** @hidden @internal */
806+
/** @hidden @internal */
805807
public get inputDirective(): IgxInputDirective {
806808
return this._inputDirective || this._inputDirectiveUserTemplates.first || null;
807809
}
@@ -895,7 +897,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
895897

896898
this._inputDirectiveUserTemplates.changes.subscribe(() => {
897899
this.attachTemplateBlur();
898-
});
900+
});
899901
this.attachTemplateBlur();
900902
}
901903

@@ -911,8 +913,8 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
911913
this.rawDateString = (res.target as HTMLInputElement).value;
912914
this.onBlur(res, false);
913915
});
914-
// TODO: Refactor custom template handling.
915-
// Revise blur handling when custom template is passed
916+
// TODO: Refactor custom template handling.
917+
// Revise blur handling when custom template is passed
916918
}
917919
}
918920

@@ -1151,6 +1153,12 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
11511153

11521154
/** @hidden @internal */
11531155
public onInput(event) {
1156+
/**
1157+
* Fix for #8165 until refactoring (#6483).
1158+
* The IgxDateTimeEditor will be used to handle all inputs, i.e. this handler will be removed.
1159+
* It extends the IgxMaskDirective which contains logic that handles this issue.
1160+
*/
1161+
if (isIE() && !this._isInEditMode && !this.inputGroup.isFocused) { return; }
11541162
const targetValue = event.target.value;
11551163
const cursorPosition = this._getCursorPosition();
11561164
const checkInput = DatePickerUtil.checkForCompleteDateInput(this.dateFormatParts, targetValue);

projects/igniteui-angular/src/lib/directives/mask/mask.directive.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
154154
/** @hidden */
155155
public ngOnInit(): void {
156156
if (!this.nativeElement.placeholder) {
157-
this.renderer.setAttribute(this.nativeElement, 'placeholder', this.maskOptions.format);
157+
this.renderer.setAttribute(this.nativeElement, 'placeholder', this.maskOptions.format);
158158
}
159159
}
160160

@@ -188,7 +188,15 @@ export class IgxMaskDirective implements OnInit, AfterViewChecked, ControlValueA
188188
/** @hidden */
189189
@HostListener('input')
190190
public onInputChanged(): void {
191-
if (isIE() && this._stopPropagation) {
191+
/**
192+
* '!this._focused' is a fix for #8165
193+
* On page load IE triggers input events before focus events and
194+
* it does so for every single input on the page.
195+
* The mask needs to be prevented from doing anything while this is happening because
196+
* the end user will be unable to blur the input.
197+
* https://stackoverflow.com/questions/21406138/input-event-triggered-on-internet-explorer-when-placeholder-changed
198+
*/
199+
if (isIE() && (this._stopPropagation || !this._focused)) {
192200
this._stopPropagation = false;
193201
return;
194202
}

projects/igniteui-angular/src/lib/grids/api.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
443443

444444
public get_all_data(includeTransactions = false): any[] {
445445
const grid = this.grid;
446-
let data = grid.data ? grid.data : [];
446+
let data = grid && grid.data ? grid.data : [];
447447
data = includeTransactions ? grid.dataWithAddedInTransactionRows : data;
448448
return data;
449449
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export abstract class IgxColumnActionsBaseDirective {
1616
/**
1717
* @hidden @internal
1818
*/
19-
public checkAllLabel: string;
19+
public abstract get checkAllLabel(): string;
2020

2121
/**
2222
* @hidden @internal
2323
*/
24-
public uncheckAllLabel: string;
24+
public abstract get uncheckAllLabel(): string;
2525

2626
/**
2727
* @hidden @internal

projects/igniteui-angular/src/lib/grids/column-actions/column-hiding.directive.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export class IgxColumnHidingDirective extends IgxColumnActionsBaseDirective {
1818
/**
1919
* @hidden @internal
2020
*/
21-
public checkAllLabel = this.columnActions.grid?.resourceStrings.igx_grid_hiding_check_all_label ?? 'Hide All';
21+
public get checkAllLabel(): string {
22+
return this.columnActions.grid?.resourceStrings.igx_grid_hiding_check_all_label ?? 'Hide All';
23+
}
2224

2325
/**
2426
* @hidden @internal
2527
*/
26-
public uncheckAllLabel = this.columnActions.grid?.resourceStrings.igx_grid_hiding_uncheck_all_label ?? 'Show All';
27-
28+
public get uncheckAllLabel(): string {
29+
return this.columnActions.grid?.resourceStrings.igx_grid_hiding_uncheck_all_label ?? 'Show All';
30+
}
2831
/**
2932
* @hidden @internal
3033
*/

projects/igniteui-angular/src/lib/grids/column-actions/column-pinning.directive.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export class IgxColumnPinningDirective extends IgxColumnActionsBaseDirective {
1818
/**
1919
* @hidden @internal
2020
*/
21-
public checkAllLabel = this.columnActions.grid?.resourceStrings.igx_grid_pinning_check_all_label ?? 'Pin All';
21+
public get checkAllLabel(): string {
22+
return this.columnActions.grid?.resourceStrings.igx_grid_pinning_check_all_label ?? 'Pin All';
23+
}
2224

2325
/**
2426
* @hidden @internal
2527
*/
26-
public uncheckAllLabel = this.columnActions.grid?.resourceStrings.igx_grid_pinning_uncheck_all_label ?? 'Unpin All';
27-
28+
public get uncheckAllLabel(): string {
29+
return this.columnActions.grid?.resourceStrings.igx_grid_pinning_uncheck_all_label ?? 'Unpin All';
30+
}
2831
/**
2932
* @hidden @internal
3033
*/

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
125125
this._columnPinning = this.grid.onColumnPinning.pipe(takeUntil(this.destroy$)).subscribe(() => {
126126
requestAnimationFrame(() => {
127127
if (!(this.cdr as ViewRef).destroyed) {
128-
this.cdr.detectChanges();
128+
this.cdr.detectChanges();
129129
}
130130
});
131131
});
@@ -189,7 +189,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
189189
*/
190190
@Input()
191191
get minHeight(): string {
192-
if (this._minHeight || this._minHeight === 0) {
192+
if (this._minHeight || this._minHeight === 0) {
193193
return this._minHeight;
194194
}
195195

@@ -406,20 +406,20 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
406406
private areExpressionsSelectable () {
407407
if (this.expressionsList.length === 1 &&
408408
(this.expressionsList[0].expression.condition.name === 'equals' ||
409-
this.expressionsList[0].expression.condition.name === 'true' ||
410-
this.expressionsList[0].expression.condition.name === 'false' ||
411-
this.expressionsList[0].expression.condition.name === 'empty' ||
412-
this.expressionsList[0].expression.condition.name === 'in')) {
409+
this.expressionsList[0].expression.condition.name === 'true' ||
410+
this.expressionsList[0].expression.condition.name === 'false' ||
411+
this.expressionsList[0].expression.condition.name === 'empty' ||
412+
this.expressionsList[0].expression.condition.name === 'in')) {
413413
return true;
414414
}
415415

416416
const selectableExpressionsCount = this.expressionsList.filter(exp =>
417417
(exp.beforeOperator === 1 || exp.afterOperator === 1) &&
418418
(exp.expression.condition.name === 'equals' ||
419-
exp.expression.condition.name === 'true' ||
420-
exp.expression.condition.name === 'false' ||
421-
exp.expression.condition.name === 'empty' ||
422-
exp.expression.condition.name === 'in')).length;
419+
exp.expression.condition.name === 'true' ||
420+
exp.expression.condition.name === 'false' ||
421+
exp.expression.condition.name === 'empty' ||
422+
exp.expression.condition.name === 'in')).length;
423423

424424
return selectableExpressionsCount === this.expressionsList.length;
425425
}
@@ -459,7 +459,12 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
459459
this.loadingStart.emit();
460460
const expressionsTree: FilteringExpressionsTree = this.getColumnFilterExpressionsTree();
461461

462+
const prevColumn = this.column;
462463
this.grid.uniqueColumnValuesStrategy(this.column, expressionsTree, (colVals: any[]) => {
464+
if (!this.column || this.column !== prevColumn) {
465+
return;
466+
}
467+
463468
const columnValues = (this.column.dataType === DataType.Date) ?
464469
colVals.map(val => val ? val.toDateString() : val) : colVals;
465470

@@ -494,9 +499,9 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
494499

495500
private generateUniqueValues(columnValues: any[]) {
496501
if (this.column.dataType === DataType.String && this.column.filteringIgnoreCase) {
497-
const filteredUniqueValues = columnValues.map(s => s?.toLowerCase())
502+
const filteredUniqueValues = columnValues.map(s => s?.toString().toLowerCase())
498503
.reduce((map, val, i) => map.get(val) ? map : map.set(val, columnValues[i]),
499-
new Map);
504+
new Map);
500505

501506
this.uniqueValues = Array.from(filteredUniqueValues.values());
502507
} else {

0 commit comments

Comments
 (0)