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

Commit 354c282

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 354c282

File tree

37 files changed

+4921
-2579
lines changed

37 files changed

+4921
-2579
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: 44 additions & 44 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,57 +29,57 @@
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",
46-
"express": "^4.17.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",
46+
"express": "^4.18.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",
58-
"@types/express": "^4.17.0",
59-
"@types/jasmine": "~3.10.0",
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",
58+
"@types/express": "^4.17.13",
59+
"@types/jasmine": "~4.0.3",
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",
63-
"jasmine-core": "~3.10.0",
64-
"karma": "~6.3.0",
65-
"karma-browserstack-launcher": "^1.6.0",
66-
"karma-chrome-launcher": "~3.1.0",
67-
"karma-coverage": "~2.0.3",
68-
"karma-firefox-launcher": "^2.1.2",
69-
"karma-jasmine": "~4.0.0",
70-
"karma-jasmine-html-reporter": "~1.7.0",
71-
"karma-parallel": "^0.3.1",
72-
"karma-sauce-launcher": "^2.0.2",
73-
"minimatch": "^3.0.4",
74-
"ng-packagr": "^13.0.0",
75-
"postcss": "^8.3.3",
76-
"postcss-scss": "^4.0.2",
63+
"jasmine-core": "~4.2.0",
64+
"karma": "~6.4.0",
65+
"karma-browserstack-launcher": "~1.6.0",
66+
"karma-chrome-launcher": "~3.1.1",
67+
"karma-coverage": "~2.2.0",
68+
"karma-firefox-launcher": "~2.1.2",
69+
"karma-jasmine": "~5.1.0",
70+
"karma-jasmine-html-reporter": "~2.0.0",
71+
"karma-parallel": "~0.3.1",
72+
"karma-sauce-launcher": "~4.3.6",
73+
"minimatch": "^5.1.0",
74+
"ng-packagr": "^14.0.2",
75+
"postcss": "^8.4.14",
76+
"postcss-scss": "^4.0.4",
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",
82-
"webpack": "^5.64.1",
83-
"webpack-cli": "^4.9.1"
81+
"typescript": "~4.7.3",
82+
"webpack": "^5.73.0",
83+
"webpack-cli": "^4.10.0"
8484
}
8585
}

projects/apps/demo-app/src/app/stack-overflow/hide-custom-bp/hide-with-custom-bp.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const selector = `[fxHide], [fxHide.yba]`;
1919

2020
@Directive({selector, inputs})
2121
export class CustomHideDirective extends ShowHideDirective {
22-
protected inputs = inputs;
22+
protected override inputs = inputs;
2323
}
2424

2525
@Component({

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();

projects/libs/flex-layout/flex/flex-offset/flex-offset.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe('flex-offset directive', () => {
237237

238238
@Injectable({providedIn: FlexModule})
239239
export class MockFlexOffsetStyleBuilder extends StyleBuilder {
240-
shouldCache = false;
240+
override shouldCache = false;
241241
buildStyles(_input: string) {
242242
return {'margin-top': '10px'};
243243
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const selector = `
6767
*/
6868
@Directive()
6969
export class FlexOffsetDirective extends BaseDirective2 implements OnChanges {
70-
protected DIRECTIVE_KEY = 'flex-offset';
70+
protected override DIRECTIVE_KEY = 'flex-offset';
7171

7272
constructor(elRef: ElementRef,
7373
protected directionality: Directionality,
@@ -94,7 +94,7 @@ export class FlexOffsetDirective extends BaseDirective2 implements OnChanges {
9494
* NOTE: this will assign `margin-left` if the parent flex-direction == 'row',
9595
* otherwise `margin-top` is used for the offset.
9696
*/
97-
protected updateWithValue(value: string|number = ''): void {
97+
protected override updateWithValue(value: string|number = ''): void {
9898
// The flex-direction of this element's flex container. Defaults to 'row'.
9999
const layout = this.getFlexFlowDirection(this.parentElement!, true);
100100
const isRtl = this.directionality.value === 'rtl';
@@ -113,7 +113,7 @@ export class FlexOffsetDirective extends BaseDirective2 implements OnChanges {
113113

114114
@Directive({selector, inputs})
115115
export class DefaultFlexOffsetDirective extends FlexOffsetDirective {
116-
protected inputs = inputs;
116+
protected override inputs = inputs;
117117
}
118118

119119
const flexOffsetCacheRowRtl: Map<string, StyleDefinition> = new Map();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const selector = `
4242
@Directive()
4343
export class FlexOrderDirective extends BaseDirective2 implements OnChanges {
4444

45-
protected DIRECTIVE_KEY = 'flex-order';
45+
protected override DIRECTIVE_KEY = 'flex-order';
4646

4747
constructor(elRef: ElementRef,
4848
styleUtils: StyleUtils,
@@ -52,12 +52,12 @@ export class FlexOrderDirective extends BaseDirective2 implements OnChanges {
5252
this.init();
5353
}
5454

55-
protected styleCache = flexOrderCache;
55+
protected override styleCache = flexOrderCache;
5656
}
5757

5858
const flexOrderCache: Map<string, StyleDefinition> = new Map();
5959

6060
@Directive({selector, inputs})
6161
export class DefaultFlexOrderDirective extends FlexOrderDirective {
62-
protected inputs = inputs;
62+
protected override inputs = inputs;
6363
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ describe('flex directive', () => {
10991099

11001100
@Injectable()
11011101
export class MockFlexStyleBuilder extends StyleBuilder {
1102-
shouldCache = false;
1102+
override shouldCache = false;
11031103

11041104
buildStyles(_input: string) {
11051105
return {'flex': '1 1 30%'};

0 commit comments

Comments
 (0)