-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experiments): added new example to showcase flex-layout with grid
- Loading branch information
Showing
34 changed files
with
355 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,3 @@ Thumbs.db | |
======= | ||
# Local | ||
todo | ||
backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
libs/experiments/src/lib/components/card/card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div | ||
gdAreas="header header | side content | footer footer" | ||
gdGap="16px" | ||
gdRows="auto auto auto" | ||
gdAreas.lt-md="header | side | content | footer" | ||
gdRows.lt-md="auto auto auto auto" | ||
> | ||
|
||
<div class="header" gdArea="header"> | ||
Header | ||
</div> | ||
|
||
<div class="side" gdArea="side"> | ||
Side | ||
</div> | ||
|
||
<div class="content" gdArea="content"> | ||
Content | ||
</div> | ||
|
||
<div class="footer" gdArea="footer"> | ||
Footer | ||
</div> | ||
</div> |
18 changes: 18 additions & 0 deletions
18
libs/experiments/src/lib/components/card/card.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:host { | ||
display: block; | ||
padding: 32px; | ||
border: 1px solid black; | ||
border-radius: 8px; | ||
} | ||
.header { | ||
background-color: #e3e3e3; | ||
} | ||
.side { | ||
background-color: #e3e3ff; | ||
} | ||
.content { | ||
background-color: #e3ffe3; | ||
} | ||
.footer { | ||
background-color: #ffe3e3; | ||
} |
25 changes: 25 additions & 0 deletions
25
libs/experiments/src/lib/components/card/card.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CardComponent } from './card.component'; | ||
|
||
describe('CardComponent', () => { | ||
let component: CardComponent; | ||
let fixture: ComponentFixture<CardComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ CardComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
libs/experiments/src/lib/components/card/card.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ngx-card', | ||
templateUrl: './card.component.html', | ||
styleUrls: ['./card.component.scss'] | ||
}) | ||
export class CardComponent { | ||
|
||
constructor() { } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
libs/experiments/src/lib/containers/file-upload/file-upload.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||
import { environment } from '@env/environment'; | ||
|
||
|
||
@Injectable() | ||
export class FileUploadService { | ||
baseUrl = environment.DOCS_BASE_URL; | ||
constructor(private httpClient: HttpClient) {} | ||
|
||
uploadFile(file, user, tenantId) { | ||
const formData = new FormData(); | ||
formData.append('file', file); | ||
formData.append('tenant', tenantId); | ||
formData.append('user', user); | ||
const headers = new HttpHeaders(); | ||
return this.httpClient.post(`${this.baseUrl}/upload`, formData, { headers, responseType: 'text' }); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
libs/experiments/src/lib/containers/image-comp/image-comp.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
libs/experiments/src/lib/containers/image-comp/image-comp.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
libs/experiments/src/lib/containers/knob-demo/knob-demo.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
libs/experiments/src/lib/containers/knob-demo/knob-demo.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
libs/experiments/src/lib/containers/layout/layout.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<ngx-breadcrumbs title="Experiments" [crumbs]="crumbs"></ngx-breadcrumbs> | ||
|
||
<div | ||
fxLayout="row wrap" | ||
fxLayout.lt-sm="column" | ||
fxLayoutGap="32px grid"> | ||
|
||
<!-- dummy loop --> | ||
<ng-container *ngFor="let _ of [1,2,3,4,5,6]"> | ||
|
||
<div fxFlex="0 1 calc(33.3% - 32px)" | ||
fxFlex.lt-md="0 1 calc(50% - 32px)" | ||
fxFlex.lt-sm="100%"> | ||
<ngx-card></ngx-card> | ||
<!--TODO remove div and move fxXXX to ngx-card--> | ||
</div> | ||
|
||
</ng-container> | ||
</div> | ||
|
||
<br/><br/><br/> | ||
|
||
|
||
|
6 changes: 6 additions & 0 deletions
6
libs/experiments/src/lib/containers/layout/layout.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:host { | ||
display: block; | ||
padding: 1.5%; | ||
position: relative; | ||
} | ||
|
Oops, something went wrong.