Skip to content

Commit 52347ac

Browse files
authored
Merge pull request #5 from fullstack-devops/bugfix/switch-to-modules
switch fs-calendar to module
2 parents 4a2fa5a + 0c0bc00 commit 52347ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+362
-237
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<fs-ui-frame [frameConfig]="frameConfig" [navUser]="navUser" [appRoutes]="appRoutes" (event)="onEvent($event)">
2-
<frame-toolbar>
3-
<frame-toolbar-title>Current App Title</frame-toolbar-title>
2+
<fs-ui-frame-toolbar>
3+
<fs-ui-frame-toolbar-title>Current App Title</fs-ui-frame-toolbar-title>
44

5-
<frame-toolbar-center>
5+
<fs-ui-frame-toolbar-center>
66
<button mat-icon-button>
77
<mat-icon>help</mat-icon>
88
</button>
@@ -12,20 +12,20 @@
1212
<button mat-icon-button>
1313
<mat-icon>call</mat-icon>
1414
</button>
15-
</frame-toolbar-center>
15+
</fs-ui-frame-toolbar-center>
1616

17-
<frame-toolbar-side>
17+
<fs-ui-frame-toolbar-side>
1818
<!-- <a>Test the side</a> -->
1919
<mat-form-field appearance="outline">
2020
<input matInput placeholder="Search" type="search">
2121
<!-- <mat-icon matSuffix>close</mat-icon> -->
2222
</mat-form-field>
23-
</frame-toolbar-side>
23+
</fs-ui-frame-toolbar-side>
2424

25-
</frame-toolbar>
25+
</fs-ui-frame-toolbar>
2626

27-
<frame-content>
27+
<fs-ui-frame-content>
2828
<router-outlet></router-outlet>
29-
</frame-content>
29+
</fs-ui-frame-content>
3030

3131
</fs-ui-frame>

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
99
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
1010
import { MaterialModule } from './material.module';
1111

12-
import { NgMatComponentsModule } from 'projects/ng-mat-components/src/public-api';
12+
import {
13+
FsCalendarModule,
14+
FsUiFrameModule,
15+
FsUiFrameContentModule,
16+
FsUiFrameToolbarModule
17+
} from 'projects/ng-mat-components/src/public-api';
1318
import { HomeComponent } from './content/home/home.component';
1419
import { SubComponent } from './content/home/sub/sub.component';
1520
import { TestComponent } from './content/test/test.component';
16-
import { MatFormFieldModule } from '@angular/material/form-field';
17-
1821

1922
@NgModule({
2023
declarations: [
@@ -25,14 +28,17 @@ import { MatFormFieldModule } from '@angular/material/form-field';
2528
CalenderShowcaseComponent,
2629
],
2730
imports: [
31+
FormsModule,
2832
BrowserModule,
33+
MaterialModule,
2934
AppRoutingModule,
3035
BrowserAnimationsModule,
31-
MaterialModule,
32-
FormsModule,
33-
MatFormFieldModule,
3436
ReactiveFormsModule,
35-
NgMatComponentsModule,
37+
/* Lib modules */
38+
FsUiFrameModule,
39+
FsUiFrameContentModule,
40+
FsUiFrameToolbarModule,
41+
FsCalendarModule,
3642
],
3743
providers: [
3844
{

projects/lib-workspace/src/app/content/calender-showcase/calender-showcase.component.ts

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
import { OverlayContainer } from '@angular/cdk/overlay';
2-
import { Component, HostBinding, OnInit } from '@angular/core';
3-
import { FormControl } from '@angular/forms';
4-
import { CalendarConfig, calendarSelected, Day, selectedDate } from 'projects/ng-mat-components/src/public-api';
1+
import { CalendarConfig, Day, calendarSelected } from 'projects/ng-mat-components/src/public-api';
2+
import { Component, OnInit } from '@angular/core';
53

64
@Component({
75
selector: 'lib-calender-showcase',
86
templateUrl: './calender-showcase.component.html',
97
styleUrls: ['./calender-showcase.component.scss']
108
})
119
export class CalenderShowcaseComponent implements OnInit {
12-
13-
// Theming
14-
toggleControl = new FormControl(false);
15-
@HostBinding('class') className = '';
16-
10+
docsApi = "./assets/docs/calendar/api.md"
1711
range: any
1812

1913
placeholder = false // boolean
@@ -62,18 +56,8 @@ export class CalenderShowcaseComponent implements OnInit {
6256
}
6357
]
6458

65-
constructor(private overlay: OverlayContainer) { }
59+
constructor() { }
6660
ngOnInit(): void {
67-
this.toggleControl.valueChanges.subscribe((darkMode) => {
68-
const darkClassName = 'darkMode';
69-
this.className = darkMode ? darkClassName : '';
70-
if (darkMode) {
71-
this.overlay.getContainerElement().classList.add(darkClassName);
72-
} else {
73-
this.overlay.getContainerElement().classList.remove(darkClassName);
74-
}
75-
});
76-
7761
console.log(this.dataSource)
7862
this.isLoading = false
7963
}
@@ -82,10 +66,10 @@ export class CalenderShowcaseComponent implements OnInit {
8266
switch (event.type) {
8367
case "range":
8468
this.range = event;
85-
break;
69+
break;
8670
case "date":
8771
this.range = event;
88-
break;
72+
break;
8973
}
9074
console.log(event)
9175
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# API reference for Angular @fullstack-devops calendar
2+
3+
```javascript
4+
import { MatTabsModule } from '@fullstack-devops/ng-mat-components';
5+
```
6+
7+
# Test

projects/lib-workspace/src/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ body {
1616
}
1717

1818
@include mat.core();
19-
@import "../../ng-mat-components/fs-mat-components-theme.scss";
19+
@import "../../ng-mat-components/src/fs-mat-components-theme.scss";
2020

2121
// Define a light theme
2222
$light-primary: mat.define-palette(mat.$indigo-palette);
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# ng-mat-components
2+
Components for @angular/material
3+
4+
5+
## Usage
6+
7+
add to your local `.npmrc` the following line to be able to use this package:
8+
```javascript
9+
@fullstack-devops:registry=https://npm.pkg.github.com
10+
```
11+
12+
And install it:
13+
- yarn
14+
```javascript
15+
yarn add @fullstack-devops/ng-mat-components
16+
```
17+
- npm
18+
```javascript
19+
npm install @fullstack-devops/ng-mat-components
20+
```
21+
22+
## Documentation
23+
24+
Live Demo with all current modules at https://fullstack-devops.github.io/ng-mat-components (still in dev)
25+
26+
Documentation will be done later when the api is fixed.
27+
28+
## Development server
29+
30+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
31+
32+
## Code scaffolding
33+
34+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
35+
36+
## Build
37+
38+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
39+
40+
## Running unit tests
41+
42+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
43+
44+
## Running end-to-end tests
45+
46+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
47+
48+
## Further help
49+
50+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

projects/ng-mat-components/ng-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"entryFile": "src/public-api.ts"
66
},
77
"assets": [
8-
"./fs-mat-components-theme.scss"
8+
"./src/fs-mat-components-theme.scss"
99
]
1010
}

projects/ng-mat-components/fs-mat-components-theme.scss renamed to projects/ng-mat-components/src/fs-mat-components-theme.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
fill: mat-color($foreground, text);
1616
}
1717

18-
.frame-toolbar-logo,
19-
.frame-toolbar-logo .logo-span {
18+
.fs-ui-frame-toolbar-logo,
19+
.fs-ui-frame-toolbar-logo .logo-span {
2020
background-color: mat-color($background, app-bar);
2121
color: mat-color($foreground, text);
2222
}
2323

24-
.frame-toolbar {
24+
.fs-ui-frame-toolbar {
2525
background-color: mat-color($background, background);
2626
color: mat-color($foreground, text);
2727
}
@@ -45,7 +45,7 @@
4545
// background-color: rgba($color: mat-color($primary, default), $alpha: 0.1);
4646
}
4747

48-
.frame-content {
48+
.fs-ui-frame-content {
4949
color: mat-color($foreground, text);
5050
background-color: lighten($color: mat-color($background, background), $amount: 3%);
5151
}

projects/ng-mat-components/src/lib/components/ui-frame-toolbar/directives/frame-toolbar-center.directive.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

projects/ng-mat-components/src/lib/components/ui-frame-toolbar/directives/frame-toolbar-side.directive.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)