Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit e982fa6

Browse files
committed
build: upgrade to Angular and CDK v14
Also bump TS target to ES2020 and remove deprecated angular.json option.
1 parent ee5d93a commit e982fa6

File tree

36 files changed

+3121
-2356
lines changed

36 files changed

+3121
-2356
lines changed

angular.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,5 @@
249249
}
250250
}
251251
}
252-
},
253-
"defaultProject": "@angular/flex-layout"
252+
}
254253
}

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"license": "MIT",
1212
"engines": {
13-
"node": "^12.20.0 || ^14.15.0 || >=16.10.0",
13+
"node": "^14.15.0 || >=16.10.0",
1414
"yarn": ">=1.22.4 <2",
1515
"npm": "Please use yarn instead of NPM to install dependencies"
1616
},
@@ -29,36 +29,36 @@
2929
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
3030
},
3131
"private": true,
32-
"requiredAngularVersion": "^13.0.0",
32+
"requiredAngularVersion": "^14.0.0",
3333
"dependencies": {
34-
"@angular/animations": "~13.0.0",
35-
"@angular/common": "~13.0.0",
36-
"@angular/compiler": "~13.0.0",
37-
"@angular/core": "~13.0.0",
38-
"@angular/forms": "~13.0.0",
39-
"@angular/material": "^13.0.2",
40-
"@angular/platform-browser": "~13.0.0",
41-
"@angular/platform-browser-dynamic": "~13.0.0",
42-
"@angular/platform-server": "~13.0.0",
43-
"@angular/router": "~13.0.0",
44-
"@nguniversal/builders": "^13.0.1",
45-
"@nguniversal/express-engine": "^13.0.1",
34+
"@angular/animations": "~14.0.0",
35+
"@angular/common": "~14.0.0",
36+
"@angular/compiler": "~14.0.0",
37+
"@angular/core": "~14.0.0",
38+
"@angular/forms": "~14.0.0",
39+
"@angular/material": "^14.0.0",
40+
"@angular/platform-browser": "~14.0.0",
41+
"@angular/platform-browser-dynamic": "~14.0.0",
42+
"@angular/platform-server": "~14.0.0",
43+
"@angular/router": "~14.0.0",
44+
"@nguniversal/builders": "^14.0.0",
45+
"@nguniversal/express-engine": "^14.0.0",
4646
"express": "^4.17.1",
4747
"rxjs": "~7.4.0",
4848
"tslib": "^2.3.0",
49-
"zone.js": "~0.11.4"
49+
"zone.js": "~0.11.5"
5050
},
5151
"devDependencies": {
52-
"@angular-devkit/build-angular": "~13.0.0",
53-
"@angular/cdk": "^13.0.2",
54-
"@angular/cli": "~13.0.0",
55-
"@angular/compiler-cli": "~13.0.0",
56-
"@ngtools/webpack": "^13.0.3",
57-
"@nguniversal/builders": "^13.0.1",
52+
"@angular-devkit/build-angular": "~14.0.0",
53+
"@angular/cdk": "^14.0.0",
54+
"@angular/cli": "~14.0.0",
55+
"@angular/compiler-cli": "~14.0.0",
56+
"@ngtools/webpack": "^14.0.0",
57+
"@nguniversal/builders": "^14.0.0",
5858
"@types/express": "^4.17.0",
5959
"@types/jasmine": "~3.10.0",
6060
"@types/minimatch": "^3.0.5",
61-
"@types/node": "^12.11.1",
61+
"@types/node": "^14.18.21",
6262
"conventional-changelog-cli": "^2.1.1",
6363
"jasmine-core": "~3.10.0",
6464
"karma": "~6.3.0",
@@ -71,14 +71,14 @@
7171
"karma-parallel": "^0.3.1",
7272
"karma-sauce-launcher": "^2.0.2",
7373
"minimatch": "^3.0.4",
74-
"ng-packagr": "^13.0.0",
74+
"ng-packagr": "^14.0.0",
7575
"postcss": "^8.3.3",
7676
"postcss-scss": "^4.0.2",
7777
"protractor": "^7.0.0",
78-
"stylelint": "^14.1.0",
79-
"ts-node": "^10.4.0",
78+
"stylelint": "^14.9.1",
79+
"ts-node": "^10.8.1",
8080
"tslint": "^6.1.3",
81-
"typescript": "~4.4.3",
81+
"typescript": "~4.7.3",
8282
"webpack": "^5.64.1",
8383
"webpack-cli": "^4.9.1"
8484
}

projects/libs/flex-layout/core/match-media/mock/mock-match-media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class MockMatchMedia extends MatchMedia {
150150
* Call window.matchMedia() to build a MediaQueryList; which
151151
* supports 0..n listeners for activation/deactivation
152152
*/
153-
protected buildMQL(query: string): MediaQueryList {
153+
protected override buildMQL(query: string): MediaQueryList {
154154
return new MockMediaQueryList(query);
155155
}
156156

projects/libs/flex-layout/extended/class/class.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {BaseDirective2, StyleUtils, MediaMarshaller} from '@angular/flex-layout/
2222
@Directive()
2323
export class ClassDirective extends BaseDirective2 implements DoCheck {
2424

25-
protected DIRECTIVE_KEY = 'ngClass';
25+
protected override DIRECTIVE_KEY = 'ngClass';
2626

2727
/**
2828
* Capture class assignments so we cache the default classes
@@ -51,7 +51,7 @@ export class ClassDirective extends BaseDirective2 implements DoCheck {
5151
this.setValue('', '');
5252
}
5353

54-
protected updateWithValue(value: any) {
54+
protected override updateWithValue(value: any) {
5555
this.ngClassInstance.ngClass = value;
5656
this.ngClassInstance.ngDoCheck();
5757
}
@@ -87,5 +87,5 @@ const selector = `
8787
*/
8888
@Directive({selector, inputs})
8989
export class DefaultClassDirective extends ClassDirective {
90-
protected inputs = inputs;
90+
protected override inputs = inputs;
9191
}

projects/libs/flex-layout/extended/img-src/img-src.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ImgSrcStyleBuilder extends StyleBuilder {
2525

2626
@Directive()
2727
export class ImgSrcDirective extends BaseDirective2 {
28-
protected DIRECTIVE_KEY = 'img-src';
28+
protected override DIRECTIVE_KEY = 'img-src';
2929
protected defaultSrc = '';
3030

3131
@Input('src')
@@ -56,7 +56,7 @@ export class ImgSrcDirective extends BaseDirective2 {
5656
* Do nothing to standard `<img src="">` usages, only when responsive
5757
* keys are present do we actually call `setAttribute()`
5858
*/
59-
protected updateWithValue(value?: string) {
59+
protected override updateWithValue(value?: string) {
6060
const url = value || this.defaultSrc;
6161
if (isPlatformServer(this.platformId) && this.serverModuleLoaded) {
6262
this.addStyles(url);
@@ -65,7 +65,7 @@ export class ImgSrcDirective extends BaseDirective2 {
6565
}
6666
}
6767

68-
protected styleCache = imgSrcCache;
68+
protected override styleCache = imgSrcCache;
6969
}
7070

7171
const imgSrcCache: Map<string, StyleDefinition> = new Map();
@@ -93,5 +93,5 @@ const selector = `
9393
*/
9494
@Directive({selector, inputs})
9595
export class DefaultImgSrcDirective extends ImgSrcDirective {
96-
protected inputs = inputs;
96+
protected override inputs = inputs;
9797
}

projects/libs/flex-layout/extended/show-hide/show-hide.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ShowHideStyleBuilder extends StyleBuilder {
4343

4444
@Directive()
4545
export class ShowHideDirective extends BaseDirective2 implements AfterViewInit, OnChanges {
46-
protected DIRECTIVE_KEY = 'show-hide';
46+
protected override DIRECTIVE_KEY = 'show-hide';
4747

4848
/** Original DOM Element CSS display style */
4949
protected display: string = '';
@@ -97,7 +97,7 @@ export class ShowHideDirective extends BaseDirective2 implements AfterViewInit,
9797
* Default to use the non-responsive Input value ('fxShow')
9898
* Then conditionally override with the mq-activated Input's current value
9999
*/
100-
ngOnChanges(changes: SimpleChanges) {
100+
override ngOnChanges(changes: SimpleChanges) {
101101
Object.keys(changes).forEach(key => {
102102
if (this.inputs.indexOf(key) !== -1) {
103103
const inputKey = key.split('.');
@@ -143,7 +143,7 @@ export class ShowHideDirective extends BaseDirective2 implements AfterViewInit,
143143
}
144144

145145
/** Validate the visibility value and then update the host's inline display style */
146-
protected updateWithValue(value: boolean | string = true) {
146+
protected override updateWithValue(value: boolean | string = true) {
147147
if (value === '') {
148148
return;
149149
}
@@ -185,5 +185,5 @@ const selector = `
185185
*/
186186
@Directive({selector, inputs})
187187
export class DefaultShowHideDirective extends ShowHideDirective {
188-
protected inputs = inputs;
188+
protected override inputs = inputs;
189189
}

projects/libs/flex-layout/extended/show-hide/show.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ const selector = `[fxShow.sm-md], [fxHide.sm-md], [fxShow.sm.lg], [fxHide.sm.lg]
386386
// Used to test custom breakpoint functionality
387387
@Directive({inputs, selector})
388388
class FxShowHideDirective extends ShowHideDirective {
389-
protected inputs = inputs;
389+
protected override inputs = inputs;
390390
}
391391

392392

projects/libs/flex-layout/extended/style/style.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
@Directive()
4343
export class StyleDirective extends BaseDirective2 implements DoCheck {
4444

45-
protected DIRECTIVE_KEY = 'ngStyle';
45+
protected override DIRECTIVE_KEY = 'ngStyle';
4646
protected fallbackStyles: NgStyleMap;
4747
protected isServer: boolean;
4848

@@ -68,7 +68,7 @@ export class StyleDirective extends BaseDirective2 implements DoCheck {
6868
}
6969

7070
/** Add generated styles */
71-
protected updateWithValue(value: any) {
71+
protected override updateWithValue(value: any) {
7272
const styles = this.buildStyleMap(value);
7373
this.ngStyleInstance.ngStyle = {...this.fallbackStyles, ...styles};
7474
if (this.isServer) {
@@ -78,7 +78,7 @@ export class StyleDirective extends BaseDirective2 implements DoCheck {
7878
}
7979

8080
/** Remove generated styles */
81-
protected clearStyles() {
81+
protected override clearStyles() {
8282
this.ngStyleInstance.ngStyle = this.fallbackStyles;
8383
this.ngStyleInstance.ngDoCheck();
8484
}
@@ -136,7 +136,7 @@ const selector = `
136136
*/
137137
@Directive({selector, inputs})
138138
export class DefaultStyleDirective extends StyleDirective implements DoCheck {
139-
protected inputs = inputs;
139+
protected override inputs = inputs;
140140
}
141141

142142
/** Build a styles map from a list of styles, while sanitizing bad values first */

projects/libs/flex-layout/flex/flex-align/flex-align.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const selector = `
5858
@Directive()
5959
export class FlexAlignDirective extends BaseDirective2 {
6060

61-
protected DIRECTIVE_KEY = 'flex-align';
61+
protected override DIRECTIVE_KEY = 'flex-align';
6262

6363
constructor(elRef: ElementRef,
6464
styleUtils: StyleUtils,
@@ -68,12 +68,12 @@ export class FlexAlignDirective extends BaseDirective2 {
6868
this.init();
6969
}
7070

71-
protected styleCache = flexAlignCache;
71+
protected override styleCache = flexAlignCache;
7272
}
7373

7474
const flexAlignCache: Map<string, StyleDefinition> = new Map();
7575

7676
@Directive({selector, inputs})
7777
export class DefaultFlexAlignDirective extends FlexAlignDirective {
78-
protected inputs = inputs;
78+
protected override inputs = inputs;
7979
}

projects/libs/flex-layout/flex/flex-fill/flex-fill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class FlexFillDirective extends BaseDirective2 {
4545
this.addStyles('');
4646
}
4747

48-
protected styleCache = flexFillCache;
48+
protected override styleCache = flexFillCache;
4949
}
5050

5151
const flexFillCache: Map<string, StyleDefinition> = new Map();

0 commit comments

Comments
 (0)