Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,115 @@
}
}
}
},
"documentation": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "projects/documentation",
"sourceRoot": "projects/documentation/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/documentation",
"index": "projects/documentation/src/index.html",
"main": "projects/documentation/src/main.ts",
"polyfills": "projects/documentation/src/polyfills.ts",
"tsConfig": "projects/documentation/tsconfig.app.json",
"aot": true,
"assets": ["projects/documentation/src/favicon.ico", "projects/documentation/src/assets"],
"styles": ["projects/documentation/src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "projects/documentation/src/environments/environment.ts",
"with": "projects/documentation/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "documentation:build"
},
"configurations": {
"production": {
"browserTarget": "documentation:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "documentation:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/documentation/src/test.ts",
"polyfills": "projects/documentation/src/polyfills.ts",
"tsConfig": "projects/documentation/tsconfig.spec.json",
"karmaConfig": "projects/documentation/karma.conf.js",
"assets": ["projects/documentation/src/favicon.ico", "projects/documentation/src/assets"],
"styles": ["projects/documentation/src/styles.scss"],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/documentation/tsconfig.app.json",
"projects/documentation/tsconfig.spec.json",
"projects/documentation/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "projects/documentation/e2e/protractor.conf.js",
"devServerTarget": "documentation:serve"
},
"configurations": {
"production": {
"devServerTarget": "documentation:serve:production"
}
}
}
}
}
},
"defaultProject": "prosoft-components-demo",
Expand Down
18 changes: 18 additions & 0 deletions projects/documentation/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
36 changes: 36 additions & 0 deletions projects/documentation/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};
25 changes: 25 additions & 0 deletions projects/documentation/e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('documentation app is running!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(
jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry)
);
});
});
10 changes: 10 additions & 0 deletions projects/documentation/e2e/src/app.e2e-spec.ts.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff a/projects/documentation/e2e/src/app.e2e-spec.ts b/projects/documentation/e2e/src/app.e2e-spec.ts (rejected hunks)
@@ -19,3 +19,5 @@ describe('workspace-project App', () => {
- expect(logs).not.toContain(jasmine.objectContaining({
- level: logging.Level.SEVERE,
- } as logging.Entry));
+ expect(logs).not.toContain(
+ jasmine.objectContaining({
+ level: logging.Level.SEVERE,
+ } as logging.Entry)
+ );
11 changes: 11 additions & 0 deletions projects/documentation/e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}

getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
10 changes: 10 additions & 0 deletions projects/documentation/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../../out-tsc/e2e",
"module": "commonjs",
"target": "es2018",
"types": ["jasmine", "jasminewd2", "node"]
}
}
32 changes: 32 additions & 0 deletions projects/documentation/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/documentation'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
20 changes: 20 additions & 0 deletions projects/documentation/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<mat-toolbar color="primary" style="display: flex; justify-content: space-between;">
<a style="color: white;" [routerLink]="['/']">@prosoft/components</a>
<div>
<span style="font-size: 14px; margin-right: 1em; vertical-align: text-bottom;">Current version: {{ currentVersion }}</span>
<a style="color: white;" href="https://github.com/prosoft-edv/components">
<img [src]="'assets/github-light.png'" />
<span style="margin-left: 0.5em; vertical-align: text-bottom;">GitHub</span>
</a>
</div>
</mat-toolbar>
<mat-sidenav-container style="height: calc(100% - 64px);">
<mat-sidenav mode="side" opened style="width: 200px;">
<mat-nav-list role="list">
<a mat-list-item *ngFor="let component of components" [routerLink]="component.routerLink">{{ component.name }}</a>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav-content style="padding: 1em; box-sizing: border-box;">
<router-outlet></router-outlet>
</mat-sidenav-content>
</mat-sidenav-container>
Empty file.
12 changes: 12 additions & 0 deletions projects/documentation/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component } from '@angular/core';
import { components } from './component-route.definition';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
currentVersion = '2.0.0-alpha.11';
components = components;
}
49 changes: 49 additions & 0 deletions projects/documentation/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { NgModule } from '@angular/core';
import { MatCardModule } from '@angular/material/card';
import { MatListModule } from '@angular/material/list';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { HomePage } from './pages/home/home.page';

const appRoutes: Routes = [
{ path: '', component: HomePage },
{ path: 'block-ui', loadChildren: () => import('./pages/block-ui/block-ui.module').then((m) => m.BlockUiModule) },
{ path: 'card', loadChildren: () => import('./pages/card/card.module').then((m) => m.CardModule) },
{ path: 'dialog-wrapper', loadChildren: () => import('./pages/dialog-wrapper/dialog-wrapper.module').then((m) => m.DialogWrapperModule) },
{ path: 'flip-container', loadChildren: () => import('./pages/flip-container/flip-container.module').then((m) => m.FlipContainerModule) },
{ path: 'form', loadChildren: () => import('./pages/form/form.module').then((m) => m.FormModule) },
{ path: 'form-errors', loadChildren: () => import('./pages/form-errors/form-errors.module').then((m) => m.FormErrorsModule) },
{ path: 'form-field', loadChildren: () => import('./pages/form-field/form-field.module').then((m) => m.FormFieldModule) },
{ path: 'header', loadChildren: () => import('./pages/header/header.module').then((m) => m.HeaderModule) },
{ path: 'number-input', loadChildren: () => import('./pages/number-input/number-input.module').then((m) => m.NumberInputModule) },
{ path: 'savebar', loadChildren: () => import('./pages/savebar/savebar.module').then((m) => m.SavebarModule) },
{ path: 'select', loadChildren: () => import('./pages/select/select.module').then((m) => m.SelectModule) },
{ path: 'slider', loadChildren: () => import('./pages/slider/slider.module').then((m) => m.SliderModule) },
{ path: 'table', loadChildren: () => import('./pages/table/table.module').then((m) => m.TableModule) },
{ path: 'view', loadChildren: () => import('./pages/view/view.module').then((m) => m.ViewModule) },
];

@NgModule({
declarations: [AppComponent, HomePage],
imports: [
// Angular stuff
BrowserModule,
BrowserAnimationsModule,
RouterModule.forRoot(appRoutes),

// Material stuff
MatCardModule,
MatSidenavModule,
MatToolbarModule,
MatListModule,
MatTabsModule,
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
Loading