Skip to content

Commit 04bc015

Browse files
committed
feat(angular15): removed deprecated package "@angular/flex-layout"
Removed the deprecated package "@angular/flex-layout" and reconstruct the used functionality in "plain" scss
1 parent 70879c4 commit 04bc015

File tree

7 files changed

+63
-36
lines changed

7 files changed

+63
-36
lines changed

package-lock.json

Lines changed: 0 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"@angular/common": "^14.0.6",
2323
"@angular/compiler": "^14.0.6",
2424
"@angular/core": "^14.0.6",
25-
"@angular/flex-layout": "^14.0.0-beta.40",
2625
"@angular/forms": "^14.0.6",
2726
"@angular/material": "^14.0.5",
2827
"@angular/platform-browser": "^14.0.6",

src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { MatToolbarModule } from '@angular/material/toolbar';
77
import { MatCardModule } from '@angular/material/card';
88
import { MatChipsModule } from '@angular/material/chips';
99
import { MatButtonModule } from '@angular/material/button';
10-
import { FlexModule } from '@angular/flex-layout';
1110
import { MatIconModule } from '@angular/material/icon';
1211
import { MatDialogModule } from '@angular/material/dialog';
1312
import { MatSelectModule } from '@angular/material/select';
@@ -53,7 +52,6 @@ import { ScrollDialogComponent } from './scroll-dialog/scroll-dialog.component';
5352
NgxPageScrollModule,
5453
MatChipsModule,
5554
MatButtonModule,
56-
FlexModule,
5755
MatIconModule,
5856
MatDialogModule,
5957
MatSelectModule,

src/app/namespace-scroll/namespace-scroll.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
</p>
1010
</mat-card>
1111

12-
<mat-card fxLayout="row" fxLayoutGap="5px">
12+
<mat-card class="flex-mat-card-container">
1313

14-
<div fxFlex fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutGap="5px" fxLayoutAlign.gt-sm="center">
15-
<h3 fxFlex.gt-sm="grow">Namespace <code>default</code></h3>
14+
<div class="flex-container">
15+
<h3 class="flex-header">Namespace <code>default</code></h3>
1616
<button mat-raised-button color="primary" (click)="startDefaultNamespaceScrolls()"
1717
id="startDefaultNamespaceScrollsButton" matTooltip="Start scroll animation">
1818
<mat-icon>play_arrow</mat-icon>
@@ -27,8 +27,8 @@ <h3 fxFlex.gt-sm="grow">Namespace <code>default</code></h3>
2727
</button>
2828
</div>
2929

30-
<div fxFlex fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutGap="5px" fxLayoutAlign.gt-sm="center">
31-
<h3 fxFlex.gt-sm="grow">Namespace <code>customSpace</code></h3>
30+
<div class="flex-container">
31+
<h3 class="flex-header">Namespace <code>customSpace</code></h3>
3232
<button mat-raised-button color="primary" (click)="startCustomNamespaceScroll()"
3333
id="startCustomNamespaceScrollsButton" matTooltip="Start scroll animation">
3434
<mat-icon>play_arrow</mat-icon>
@@ -42,16 +42,16 @@ <h3 fxFlex.gt-sm="grow">Namespace <code>customSpace</code></h3>
4242
<mat-icon>replay</mat-icon>
4343
</button>
4444
</div>
45-
<div fxFlex fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutGap="5px" fxLayoutAlign.gt-sm="center">
46-
<h3 fxFlex.gt-sm="grow">All Namespaces</h3>
45+
<div class="flex-container">
46+
<h3 class="flex-header">All Namespaces</h3>
4747
<button mat-raised-button color="primary" (click)="pageScrollService.stopAll()"
4848
id="stopAllNamespaceScrollsButton" matTooltip="Stop all scroll animations">
4949
<mat-icon>stop</mat-icon>
5050
</button>
5151
</div>
5252
</mat-card>
5353

54-
<mat-card fxLayout="row" fxLayoutGap="5px">
54+
<mat-card class="flex-mat-card-container">
5555
<div>
5656
<h4>Namespace default</h4>
5757
<div #container1 id="container1" class="scrollContainer">

src/app/namespace-scroll/namespace-scroll.component.scss

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,46 @@
33
overflow: auto;
44
position: relative;
55
}
6+
7+
.flex-mat-card-container {
8+
display: flex;
9+
flex-direction: row;
10+
box-sizing: border-box;
11+
}
12+
13+
.flex-mat-card-container div {
14+
margin-right: 5px;
15+
16+
&:nth-last-child(1) {
17+
margin-right: 0;
18+
}
19+
}
20+
21+
.flex-container {
22+
box-sizing: border-box;
23+
flex: 1 1 0%;
24+
}
25+
26+
.flex-header {
27+
flex: 1 1 100%;
28+
box-sizing: border-box;
29+
max-width: 100%;
30+
}
31+
32+
@media screen and (min-width: 960px) {
33+
.flex-container {
34+
display: flex;
35+
flex-flow: row wrap;
36+
place-content: stretch center;
37+
}
38+
39+
.flex-header {
40+
margin-right: 5px;
41+
}
42+
}
43+
44+
@media screen and (max-width: 959px) {
45+
.flex-header {
46+
margin-bottom: 5px;
47+
}
48+
}

src/app/nested-scroll/nested-scroll.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</button>
1818
</mat-card>
1919

20-
<div fxLayout="column" fxLayout.gt-sm="row">
20+
<div class="flex-container">
2121
<mat-card>
2222
<mat-card-title>A basic card</mat-card-title>
2323
<mat-card-content #basicContainer id="basicContainer" class="scrollContainer">

src/app/nested-scroll/nested-scroll.component.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@
1010
#complexContainer.scrollContainer {
1111
height: 300px;
1212
}
13+
14+
.flex-container {
15+
display: flex;
16+
flex-direction: column;
17+
}
18+
19+
@media screen and (min-width: 960px) {
20+
.flex-container {
21+
flex-direction: row;
22+
}
23+
}

0 commit comments

Comments
 (0)