Skip to content

Commit 255d9b8

Browse files
authored
Merge pull request #15 from fullstack-devops/feature/add-calendar-table
add calendar table
2 parents 3974c97 + 9e5602b commit 255d9b8

31 files changed

+1107
-597
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"editor.formatOnSave": true,
33
"editor.renderWhitespace": "all",
44
"prettier.arrowParens": "avoid",
5-
"prettier.printWidth": 120,
5+
"prettier.printWidth": 130,
66
"editor.tabSize": 2,
77
"files.trimTrailingWhitespace": true,
88
"files.trimFinalNewlines": true,

angular.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,5 @@
143143
}
144144
}
145145
}
146-
},
147-
"defaultProject": "ng-mat-components"
146+
}
148147
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ng": "ng",
1111
"start": "ng serve",
1212
"prebuild": "cp README.md projects/ng-mat-components/",
13-
"build": "ng build",
13+
"build": "ng build --project ng-mat-components",
1414
"build:workspace": "ng build --project lib-workspace",
1515
"watch": "ng build --watch --configuration development",
1616
"test": "ng test"

projects/lib-workspace/src/app/app-routing.module.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgModule } from '@angular/core';
22
import { PreloadAllModules, RouterModule } from '@angular/router';
33
import { FrameRoutes } from 'projects/ng-mat-components/src/public-api';
4+
import { CalendarTableComponent } from './content/calendar-table/calendar-table.component';
45
import { CalenderShowcaseComponent } from './content/calender-showcase/calender-showcase.component';
56
import { HomeComponent } from './content/home/home.component';
67
import { SubComponent } from './content/home/sub/sub.component';
@@ -32,14 +33,23 @@ export const routes: FrameRoutes = [
3233
},
3334
},
3435
{
35-
path: 'calendar-showcase',
36+
path: 'calendar-panels',
3637
component: CalenderShowcaseComponent,
3738
data: {
3839
displaySidemenu: true,
3940
sidenavIcon: 'calendar_month',
4041
sidenavText: 'Calendar',
4142
},
4243
},
44+
{
45+
path: 'calendar-table',
46+
component: CalendarTableComponent,
47+
data: {
48+
displaySidemenu: true,
49+
sidenavIcon: 'event_note',
50+
sidenavText: 'Calendar Table',
51+
},
52+
},
4353
{
4454
path: '**',
4555
redirectTo: 'home',

projects/lib-workspace/src/app/app.component.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
<fs-ui-frame [frameConfig]="frameConfig" [navUser]="navUser" [appRoutes]="appRoutes" (event)="onEvent($event)">
1+
<fs-ui-frame
2+
[frameConfig]="frameConfig"
3+
[navUser]="navUser"
4+
[appRoutes]="appRoutes"
5+
(event)="onEvent($event)"
6+
>
27
<fs-ui-frame-toolbar>
38
<fs-ui-frame-toolbar-title>Current App Title</fs-ui-frame-toolbar-title>
49

@@ -17,15 +22,13 @@
1722
<fs-ui-frame-toolbar-side>
1823
<!-- <a>Test the side</a> -->
1924
<mat-form-field appearance="outline">
20-
<input matInput placeholder="Search" type="search">
25+
<input matInput placeholder="Search" type="search" />
2126
<!-- <mat-icon matSuffix>close</mat-icon> -->
2227
</mat-form-field>
2328
</fs-ui-frame-toolbar-side>
24-
2529
</fs-ui-frame-toolbar>
2630

2731
<fs-ui-frame-content>
2832
<router-outlet></router-outlet>
2933
</fs-ui-frame-content>
30-
3134
</fs-ui-frame>

projects/lib-workspace/src/app/app.component.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1-
import { Component } from '@angular/core';
2-
import { FrameConfig, NavUser, FrameEvent, FrameEvents } from 'projects/ng-mat-components/src/public-api';
1+
import { registerLocaleData } from '@angular/common';
2+
import localeDe from '@angular/common/locales/de';
3+
import localeDeExtra from '@angular/common/locales/extra/de';
4+
import { Component, OnInit } from '@angular/core';
5+
import {
6+
FrameConfig,
7+
FrameEvent,
8+
FrameEvents,
9+
NavUser,
10+
} from 'projects/ng-mat-components/src/public-api';
311
import { routes } from './app-routing.module';
412

513
@Component({
614
selector: 'app-root',
715
templateUrl: './app.component.html',
8-
styleUrls: ['./app.component.scss']
16+
styleUrls: ['./app.component.scss'],
917
})
10-
export class AppComponent {
18+
export class AppComponent implements OnInit {
1119
title = 'FS DevOps`s ng mat components';
1220
appRoutes = routes;
1321

1422
frameConfig: FrameConfig = {
1523
appName: 'Dummy App',
1624
// appNameShort: stringOfLength('DUMMY', 0, 6),
17-
logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/1024px-Angular_full_color_logo.svg.png'
25+
logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/1024px-Angular_full_color_logo.svg.png',
1826
};
1927
navUser: NavUser = {
20-
profilePicture: 'https://material.angular.io/assets/img/examples/shiba1.jpg',
28+
profilePicture:
29+
'https://material.angular.io/assets/img/examples/shiba1.jpg',
2130
name: 'Some User',
22-
role: 'Engineer'
31+
role: 'Engineer',
32+
};
33+
34+
ngOnInit() {
35+
registerLocaleData(localeDe, 'de-DE', localeDeExtra);
2336
}
2437

2538
onEvent(frameEvent: FrameEvent) {

projects/lib-workspace/src/app/app.module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
88
import { de } from 'date-fns/locale';
99
import { AppRoutingModule } from './app-routing.module';
1010
import { AppComponent } from './app.component';
11-
import { MaterialModule } from './material.module';
1211

12+
import { MAT_DATE_LOCALE } from '@angular/material/core';
1313
import {
1414
FsCalendarModule,
1515
FsCalendarService,
16+
FsMaterialFullModule,
1617
FsUiFrameContentModule,
1718
FsUiFrameModule,
1819
FsUiFrameToolbarModule,
1920
} from 'projects/ng-mat-components/src/public-api';
21+
import { CalendarTableComponent } from './content/calendar-table/calendar-table.component';
2022
import { HomeComponent } from './content/home/home.component';
2123
import { SubComponent } from './content/home/sub/sub.component';
2224
import { TestComponent } from './content/test/test.component';
@@ -28,15 +30,16 @@ import { TestComponent } from './content/test/test.component';
2830
TestComponent,
2931
SubComponent,
3032
CalenderShowcaseComponent,
33+
CalendarTableComponent,
3134
],
3235
imports: [
3336
FormsModule,
3437
BrowserModule,
35-
MaterialModule,
3638
AppRoutingModule,
3739
BrowserAnimationsModule,
3840
ReactiveFormsModule,
3941
/* Lib modules */
42+
FsMaterialFullModule,
4043
FsUiFrameModule,
4144
FsUiFrameContentModule,
4245
FsUiFrameToolbarModule,
@@ -48,6 +51,7 @@ import { TestComponent } from './content/test/test.component';
4851
useValue: '.',
4952
},
5053
{ provide: LOCALE_ID, useValue: 'de-DE' },
54+
{ provide: MAT_DATE_LOCALE, useValue: 'de-DE' },
5155
{
5256
provide: 'FS_DATE_LOCALE',
5357
useClass: FsCalendarService,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.test {
2+
color: #22ff0e
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<section class="mat-elevation-z4">
2+
<fs-calendar-table [dataSource]="calTableData">
3+
<fs-calendar-table-name> Persons </fs-calendar-table-name>
4+
</fs-calendar-table>
5+
</section>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { CalendarTableEntry } from 'projects/ng-mat-components/src/public-api';
3+
4+
@Component({
5+
selector: 'lib-calendar-table',
6+
templateUrl: './calendar-table.component.html',
7+
styleUrls: ['./calendar-table.component.css'],
8+
})
9+
export class CalendarTableComponent implements OnInit {
10+
today = new Date();
11+
12+
calTableData: CalendarTableEntry[] = [
13+
{
14+
name: 'Test User',
15+
data: [
16+
{
17+
date: new Date(this.today.getFullYear(), this.today.getMonth(), 20),
18+
toolTip: 'Some longer text',
19+
char: '',
20+
colors: {
21+
backgroundColor: '#FFFFFF',
22+
color: '#000',
23+
},
24+
},
25+
],
26+
},
27+
{
28+
name: 'Test User 2',
29+
data: [
30+
{
31+
date: new Date(this.today.getFullYear(), this.today.getMonth(), 3),
32+
toolTip: 'Some text',
33+
char: 'T',
34+
colors: {
35+
backgroundColor: '#FFFFFF',
36+
color: '#000',
37+
},
38+
},
39+
{
40+
date: new Date(this.today.getFullYear(), this.today.getMonth(), 10),
41+
toolTip: 'Some text',
42+
char: 'U',
43+
colors: {
44+
backgroundColor: '#22ff0e',
45+
color: '#000',
46+
},
47+
},
48+
],
49+
},
50+
];
51+
52+
constructor() {}
53+
54+
ngOnInit() {}
55+
}

0 commit comments

Comments
 (0)