Initial commit for the Angular part. We are nowhere yet.
This commit is contained in:
21
bookie/src/app/tables/table-list/table-list.component.css
Normal file
21
bookie/src/app/tables/table-list/table-list.component.css
Normal file
@ -0,0 +1,21 @@
|
||||
.grid-container {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.dashboard-card {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
}
|
||||
|
||||
.more-button {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.dashboard-card-content {
|
||||
text-align: center;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<!--?<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">-->
|
||||
<!--?<div class="example-box" *ngFor="let movie of movies" cdkDrag>{{movie}}</div>-->
|
||||
<!--?</div>-->
|
||||
|
||||
<!--?<div fxLayout="row wrap" fxLayoutGap="10px" fxLayoutAlign="flex-start">-->
|
||||
<!--?<button fxFlex="0 1 calc(20% - 10px)" *ngFor="let table of tables">{{table.name}}</button>-->
|
||||
<!--?</div>-->
|
||||
33
bookie/src/app/tables/table-list/table-list.component.ts
Normal file
33
bookie/src/app/tables/table-list/table-list.component.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
|
||||
|
||||
@Component({
|
||||
selector: 'app-table-list',
|
||||
templateUrl: './table-list.component.html',
|
||||
styleUrls: ['./table-list.component.css']
|
||||
})
|
||||
export class TableListComponent {
|
||||
/** Based on the screen size, switch from standard to one column per row */
|
||||
cards = this.breakpointObserver.observe(Breakpoints.Handset).pipe(
|
||||
map(({ matches }) => {
|
||||
if (matches) {
|
||||
return [
|
||||
{ title: 'Card 1', cols: 1, rows: 1 },
|
||||
{ title: 'Card 2', cols: 1, rows: 1 },
|
||||
{ title: 'Card 3', cols: 1, rows: 1 },
|
||||
{ title: 'Card 4', cols: 1, rows: 1 }
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
{ title: 'Card 1', cols: 2, rows: 1 },
|
||||
{ title: 'Card 2', cols: 1, rows: 1 },
|
||||
{ title: 'Card 3', cols: 1, rows: 2 },
|
||||
{ title: 'Card 4', cols: 1, rows: 1 }
|
||||
];
|
||||
})
|
||||
);
|
||||
|
||||
constructor(private breakpointObserver: BreakpointObserver) {}
|
||||
}
|
||||
23
bookie/src/app/tables/tables.module.ts
Normal file
23
bookie/src/app/tables/tables.module.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TableListComponent } from './table-list/table-list.component';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { LayoutModule } from '@angular/cdk/layout';
|
||||
|
||||
@NgModule({
|
||||
declarations: [TableListComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatGridListModule,
|
||||
MatCardModule,
|
||||
MatMenuModule,
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
LayoutModule
|
||||
]
|
||||
})
|
||||
export class TablesModule { }
|
||||
Reference in New Issue
Block a user