Skip to content

Commit 14b5d11

Browse files
authored
Merge branch '10.1.x' into dTsvetkov/fix-issue-8320-10.1.x
2 parents 58c3a0d + bd4d87c commit 14b5d11

24 files changed

+140
-90
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/migrations/common/UpdateChanges.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ describe('UpdateChanges', () => {
390390
});
391391
spyOn<any>(fs, 'readFileSync').and.callFake(() => JSON.stringify(classJson));
392392

393-
const fileContent =
393+
let fileContent =
394394
`import { Size, Type as someThg } from "igniteui-angular";
395395
import { IgxService, IgxDiffService as eDiffService, Calendar as Calendar } from 'igniteui-angular';
396396
import { Type } from "@angular/core";
@@ -411,7 +411,7 @@ export class Test {
411411
expect(update.getClassChanges()).toEqual(classJson);
412412

413413
update.applyChanges();
414-
expect(appTree.readContent('test.component.ts')).toEqual(
414+
let expectedFileContent =
415415
`import { IgxSize, IgxType as someThg } from "igniteui-angular";
416416
import { IgxService1, IgxNewDiffService as eDiffService, CalendarActual as Calendar } from 'igniteui-angular';
417417
import { Type } from "@angular/core";
@@ -423,8 +423,15 @@ export class Test {
423423
cal: Calendar;
424424
425425
constructor (public router: Router, private _iconService: IgxService1) {}
426-
}`
427-
);
426+
}`;
427+
expect(appTree.readContent('test.component.ts')).toEqual(expectedFileContent);
428+
429+
// with ig feed package:
430+
fileContent = fileContent.replace(/igniteui-angular/g, '@infragistics/igniteui-angular');
431+
expectedFileContent = expectedFileContent.replace(/igniteui-angular/g, '@infragistics/igniteui-angular');
432+
appTree.overwrite('test.component.ts', fileContent);
433+
update.applyChanges();
434+
expect(appTree.readContent('test.component.ts')).toEqual(expectedFileContent);
428435
});
429436

430437
it('should move property value between element tags', done => {

projects/igniteui-angular/migrations/common/tsUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function getImportModulePositions(sourceText: string, startsWith: string)
6464
/** Filters out statements to named imports (e.g. `import {x, y}`) from PACKAGE_IMPORT */
6565
const namedImportFilter = (statement: ts.Statement) => {
6666
if (statement.kind === ts.SyntaxKind.ImportDeclaration &&
67-
((statement as ts.ImportDeclaration).moduleSpecifier as ts.StringLiteral).text === PACKAGE_IMPORT) {
67+
((statement as ts.ImportDeclaration).moduleSpecifier as ts.StringLiteral).text.endsWith(PACKAGE_IMPORT)) {
6868

6969
const clause = (statement as ts.ImportDeclaration).importClause;
7070
return clause && clause.namedBindings && clause.namedBindings.kind === ts.SyntaxKind.NamedImports;

projects/igniteui-angular/src/lib/calendar/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './calendar';
2+
export * from './calendar-base';
23
export * from './calendar.component';
34
export * from './days-view/days-view.component';
45
export * from './months-view/months-view.component';

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/cell.component.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
>
99
</ng-template>
1010
<ng-template #defaultCell>
11-
<div
11+
<div *ngIf="column.dataType !== 'boolean'"
1212
igxTextHighlight
1313
class="igx-grid__td-text"
1414
style="pointer-events: none;"
@@ -35,8 +35,6 @@
3535
? (value | number:column.pipeArgs.digitsInfo:grid.locale)
3636
: column.dataType === "date"
3737
? (value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale)
38-
: column.dataType === "boolean"
39-
? ""
4038
: value
4139
}}</div>
4240
<igx-icon

0 commit comments

Comments
 (0)