Skip to content

Commit 353da1c

Browse files
authored
Merge branch 'master' into roadmap-update-28jul21
2 parents bc3965f + 272fb73 commit 353da1c

36 files changed

+402
-167
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test:lib:azure:tgrid": "ng test igniteui-angular --watch=false --no-progress --karma-config=./projects/igniteui-angular/karma.azure.tree-grid.conf.js",
2121
"test:lib:azure:hgrid": "ng test igniteui-angular --watch=false --no-progress --karma-config=./projects/igniteui-angular/karma.azure.hierarchical-grid.conf.js",
2222
"test:lib:azure:others": "ng test igniteui-angular --watch=false --no-progress --karma-config=./projects/igniteui-angular/karma.azure.non-grid.conf.js",
23-
"test:lib:watch": "ng test igniteui-angular",
23+
"test:lib:watch": "ng test igniteui-angular --karma-config=./projects/igniteui-angular/karma.watch.conf.js",
2424
"test:schematics": "ts-node --project projects/igniteui-angular/migrations/tsconfig.json ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/migrations/**/*.spec.ts ./projects/igniteui-angular/schematics/**/*.spec.ts",
2525
"test:styles": "ts-node --skip-project ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/src/lib/core/styles/spec/tests.ts",
2626
"build:lib": "ng build igniteui-angular --configuration production && gulp buildStyle",
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', 'jasmine-spec-tags', '@angular-devkit/build-angular'],
8+
files: [
9+
{ pattern: '../../node_modules/hammerjs/hammer.min.js', watched: false },
10+
{ pattern: '../../node_modules/hammer-simulator/index.js', watched: false },
11+
{ pattern: './test.css', watched: false },
12+
{ pattern: '../../dist/igniteui-angular/styles/igniteui-angular.css', watched: false }
13+
],
14+
plugins: [
15+
require('karma-jasmine'),
16+
require('karma-chrome-launcher'),
17+
require('karma-jasmine-spec-tags'),
18+
require('karma-jasmine-html-reporter'),
19+
require('karma-spec-reporter'),
20+
require('@angular-devkit/build-angular/plugins/karma')
21+
],
22+
client: {
23+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
24+
jasmine: {
25+
random: false
26+
},
27+
tagPrefix: '#',
28+
skipTags: 'perf'
29+
},
30+
reporters: ['progress'],
31+
specReporter: {
32+
suppressSkipped: true,
33+
suppressErrorSummary: false,
34+
suppressFailed: false,
35+
suppressPassed: false,
36+
showSpecTiming: false,
37+
failFast: false
38+
},
39+
port: 9876,
40+
colors: true,
41+
logLevel: config.LOG_INFO,
42+
autoWatch: true,
43+
browsers: ['Chrome'],
44+
singleRun: false
45+
});
46+
};

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,16 +489,15 @@ export class UpdateChanges {
489489
return;
490490
}
491491
let content;
492-
try {
493-
// there could be comments in the json file and JSON.parse would fail
494-
// TODO: use some 3rd party parser or write our own.
495-
// @angular-devkit/core.parseJson is deprecated
496-
content = JSON.parse(originalContent);
497-
} catch (e: any) {
492+
// use ts parser as it handles jsonc-style files w/ comments
493+
const result = ts.parseConfigFileTextToJson(TSCONFIG_PATH, originalContent);
494+
if (!result.error) {
495+
content = result.config;
496+
} else {
498497
this.context?.logger
499498
.warn(`Could not parse ${TSCONFIG_PATH}. Angular Ivy language service might be unavailable during migrations.`);
500499
this.context?.logger
501-
.warn(`Error:\n${e}`);
500+
.warn(`Error:\n${result.error}`);
502501
return;
503502
}
504503
if (!content.angularCompilerOptions) {

projects/igniteui-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"web-animations-js": "^2.3.2"
8585
},
8686
"igxDevDependencies": {
87-
"@igniteui/angular-schematics": "~12.1.810-beta.0"
87+
"@igniteui/angular-schematics": "~12.1.810"
8888
},
8989
"ng-update": {
9090
"migrations": "./migrations/migration-collection.json"

projects/igniteui-angular/src/lib/checkbox/checkbox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ export class IgxCheckboxComponent implements ControlValueAccessor, EditorProvide
376376
}
377377
/** @hidden @internal */
378378
@HostListener('click', ['$event'])
379-
public _onCheckboxClick(event: MouseEvent) {
379+
public _onCheckboxClick(event: PointerEvent | MouseEvent) {
380380
// Since the original checkbox is hidden and the label
381381
// is used for styling and to change the checked state of the checkbox,
382382
// we need to prevent the checkbox click event from bubbling up

projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@
578578

579579
%igx-chip__ghost {
580580
position: absolute;
581-
z-index: 10;
582581
box-shadow: --var($theme, 'ghost-shadow');
583582
overflow: hidden;
584583
color: --var($theme, 'focus-text-color');
@@ -606,6 +605,14 @@
606605
padding: map-get($chip-padding, 'compact');
607606
}
608607
}
608+
609+
// Remark: If z-index is not set, the chip would
610+
// hide behind it's parent grid as it has a z-index of 1
611+
%igx-chip__ghost,
612+
%igx-chip__ghost--cosy,
613+
%igx-chip__ghost--compact {
614+
z-index: 10;
615+
}
609616
}
610617

611618
/// Adds typography styles for the igx-chip component.

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { IgxCalendarContainerModule } from '../date-common/calendar-container/ca
4343
IgxDateRangeEndComponent,
4444
IgxDateRangeSeparatorDirective,
4545
IgxDateTimeEditorModule,
46+
IgxPickersCommonModule,
4647
IgxInputGroupModule
4748
]
4849
})

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
238238
*/
239239
@Input()
240240
@HostBinding('class.igx-button--disabled')
241-
public get disabled() {
241+
public get disabled(): boolean {
242242
return this._disabled;
243243
}
244244

@@ -251,7 +251,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
251251
* ```
252252
*/
253253
public set disabled(val: boolean) {
254-
this._disabled = !!val;
254+
this._disabled = (val as any === '') || val;
255255
}
256256

257257
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('igxMask', () => {
158158
UIInteractions.simulateCompositionEvent('09062021', input, 0, 10);
159159
fixture.detectChanges();
160160

161-
input.triggerEventHandler('blur', {});
161+
input.triggerEventHandler('blur', { target: input.nativeElement });
162162
tick();
163163
fixture.detectChanges();
164164

@@ -178,7 +178,7 @@ describe('igxMask', () => {
178178
UIInteractions.simulateCompositionEvent('あんs', input, 0, 3);
179179
fixture.detectChanges();
180180

181-
input.triggerEventHandler('blur', {});
181+
input.triggerEventHandler('blur', { target: input.nativeElement });
182182
tick();
183183
fixture.detectChanges();
184184

projects/igniteui-angular/src/lib/directives/template-outlet/template_outlet.directive.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ export class IgxTemplateOutletDirective implements OnChanges {
3131

3232
/**
3333
* The embedded views cache. Collection is key-value paired.
34-
* Key is the template id, value is the embedded view for the related template.
34+
* Key is the template type, value is another key-value paired collection
35+
* where the key is the template id and value is the embedded view for the related template.
3536
*/
36-
private _embeddedViewsMap: Map<string, EmbeddedViewRef<any>> = new Map();
37+
private _embeddedViewsMap: Map<string, Map<any, EmbeddedViewRef<any>>> = new Map();
3738

3839
constructor(public _viewContainerRef: ViewContainerRef, private _zone: NgZone, public cdr: ChangeDetectorRef) {
3940
}
@@ -49,19 +50,23 @@ export class IgxTemplateOutletDirective implements OnChanges {
4950
}
5051

5152
public cleanCache() {
52-
this._embeddedViewsMap.forEach((item) => {
53-
if (!item.destroyed) {
54-
item.destroy();
55-
}
53+
this._embeddedViewsMap.forEach((collection) => {
54+
collection.forEach((item => {
55+
if (!item.destroyed) {
56+
item.destroy();
57+
}
58+
}));
59+
collection.clear();
5660
});
5761
this._embeddedViewsMap.clear();
5862
}
5963

6064
public cleanView(tmplID) {
61-
const embView = this._embeddedViewsMap.get(tmplID);
65+
const embViewCollection = this._embeddedViewsMap.get(tmplID.type);
66+
const embView = embViewCollection?.get(tmplID.id);
6267
if (embView) {
6368
embView.destroy();
64-
this._embeddedViewsMap.delete(tmplID);
69+
this._embeddedViewsMap.get(tmplID.type).delete(tmplID.id);
6570
}
6671
}
6772

@@ -81,9 +86,11 @@ export class IgxTemplateOutletDirective implements OnChanges {
8186
// if context contains a template id, check if we have a view for that template already stored in the cache
8287
// if not create a copy and add it to the cache in detached state.
8388
// Note: Views in detached state do not appear in the DOM, however they remain stored in memory.
84-
const res = this._embeddedViewsMap.get(this.igxTemplateOutletContext['templateID']);
89+
const resCollection = this._embeddedViewsMap.get(this.igxTemplateOutletContext['templateID'].type);
90+
const res = resCollection?.get(this.igxTemplateOutletContext['templateID'].id);
8591
if (!res) {
86-
this._embeddedViewsMap.set(this.igxTemplateOutletContext['templateID'], this._viewRef);
92+
this._embeddedViewsMap.set(this.igxTemplateOutletContext['templateID'].type,
93+
new Map([[this.igxTemplateOutletContext['templateID'].id, this._viewRef]]));
8794
}
8895
}
8996
}
@@ -115,7 +122,7 @@ export class IgxTemplateOutletDirective implements OnChanges {
115122
// use view for specific template cached in the current template outlet
116123
const tmplID = this.igxTemplateOutletContext['templateID'];
117124
const cachedView = tmplID ?
118-
this._embeddedViewsMap.get(tmplID) :
125+
this._embeddedViewsMap.get(tmplID.type)?.get(tmplID.id) :
119126
null;
120127
// if view exists, but template has been changed and there is a view in the cache with the related template
121128
// then detach old view and insert the stored one with the matching template
@@ -171,7 +178,7 @@ export class IgxTemplateOutletDirective implements OnChanges {
171178
const movedView = this.igxTemplateOutletContext['moveView'];
172179
const tmplID = this.igxTemplateOutletContext['templateID'];
173180
const cachedView = tmplID ?
174-
this._embeddedViewsMap.get(tmplID) :
181+
this._embeddedViewsMap.get(tmplID.type)?.get(tmplID.id) :
175182
null;
176183
const shouldRecreate = this._shouldRecreateView(changes);
177184
if (movedView) {

0 commit comments

Comments
 (0)