Skip to content

Commit 68e9e75

Browse files
docs: new docs app (CirclonGroup#865)
1 parent 815159a commit 68e9e75

File tree

132 files changed

+4739
-12
lines changed

Some content is hidden

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

132 files changed

+4739
-12
lines changed

angular.json

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@
9696
"projects/example-app/src/favicon.ico",
9797
"projects/example-app/src/assets"
9898
],
99-
"styles": ["projects/example-app/src/styles.scss"],
99+
"styles": [
100+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
101+
"projects/example-app/src/styles.scss"
102+
],
100103
"scripts": []
101104
}
102105
},
@@ -144,6 +147,109 @@
144147
}
145148
}
146149
}
150+
},
151+
"docs-app": {
152+
"projectType": "application",
153+
"schematics": {
154+
"@schematics/angular:component": {
155+
"style": "scss"
156+
}
157+
},
158+
"root": "projects/docs-app",
159+
"sourceRoot": "projects/docs-app/src",
160+
"prefix": "app",
161+
"architect": {
162+
"build": {
163+
"builder": "@angular-devkit/build-angular:browser",
164+
"options": {
165+
"outputPath": "dist/docs-app",
166+
"index": "projects/docs-app/src/index.html",
167+
"main": "projects/docs-app/src/main.ts",
168+
"polyfills": "projects/docs-app/src/polyfills.ts",
169+
"tsConfig": "projects/docs-app/tsconfig.app.json",
170+
"aot": false,
171+
"assets": [
172+
"projects/docs-app/src/favicon.ico",
173+
"projects/docs-app/src/assets"
174+
],
175+
"styles": ["projects/docs-app/src/styles.scss"],
176+
"scripts": []
177+
},
178+
"configurations": {
179+
"production": {
180+
"fileReplacements": [
181+
{
182+
"replace": "projects/docs-app/src/environments/environment.ts",
183+
"with": "projects/docs-app/src/environments/environment.prod.ts"
184+
}
185+
],
186+
"optimization": true,
187+
"outputHashing": "all",
188+
"sourceMap": false,
189+
"extractCss": true,
190+
"namedChunks": false,
191+
"extractLicenses": true,
192+
"vendorChunk": false,
193+
"buildOptimizer": true,
194+
"budgets": [
195+
{
196+
"type": "initial",
197+
"maximumWarning": "2mb",
198+
"maximumError": "5mb"
199+
},
200+
{
201+
"type": "anyComponentStyle",
202+
"maximumWarning": "6kb",
203+
"maximumError": "10kb"
204+
}
205+
]
206+
}
207+
}
208+
},
209+
"serve": {
210+
"builder": "@angular-devkit/build-angular:dev-server",
211+
"options": {
212+
"browserTarget": "docs-app:build"
213+
},
214+
"configurations": {
215+
"production": {
216+
"browserTarget": "docs-app:build:production"
217+
}
218+
}
219+
},
220+
"extract-i18n": {
221+
"builder": "@angular-devkit/build-angular:extract-i18n",
222+
"options": {
223+
"browserTarget": "docs-app:build"
224+
}
225+
},
226+
"test": {
227+
"builder": "@angular-devkit/build-angular:karma",
228+
"options": {
229+
"main": "projects/docs-app/src/test.ts",
230+
"polyfills": "projects/docs-app/src/polyfills.ts",
231+
"tsConfig": "projects/docs-app/tsconfig.spec.json",
232+
"karmaConfig": "projects/docs-app/karma.conf.js",
233+
"assets": [
234+
"projects/docs-app/src/favicon.ico",
235+
"projects/docs-app/src/assets"
236+
],
237+
"styles": ["projects/docs-app/src/styles.scss"],
238+
"scripts": []
239+
}
240+
},
241+
"lint": {
242+
"builder": "@angular-devkit/build-angular:tslint",
243+
"options": {
244+
"tsConfig": [
245+
"projects/docs-app/tsconfig.app.json",
246+
"projects/docs-app/tsconfig.spec.json",
247+
"projects/docs-app/e2e/tsconfig.json"
248+
],
249+
"exclude": ["**/node_modules/**"]
250+
}
251+
}
252+
}
147253
}
148254
},
149255
"defaultProject": "example-app"

package-lock.json

Lines changed: 27 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
"prepublish:lib:win": "npm run build:lib && npm run copy:files:win",
4343
"start:example-app": "ng serve",
4444
"start:example-app:es5": "ng serve --configuration=es5",
45+
"start:docs-app": "ng serve --project=docs-app",
46+
"build:docs-app": "ng build docs-app",
4547
"example:cli:build": "npm run build && cd example/cli && npm install && cp -rf ../../dist node_modules/angular-tree-component/ && cp src/index.build.html src/index.html && ./node_modules/.bin/ng build --aot && cp src/index.dev.html src/index.html && mkdir -p 500tech/angular-tree-component/master/example/cli/ && cp -rf dist 500tech/angular-tree-component/master/example/cli/",
4648
"test:ci:local": "testcafe chrome:headless e2e/*.testcafe.js --app \"ng serve\" -r xunit:./xunit/res.xml -c 4 --assertion-timeout 10000 --app-init-delay 20000 --page-load-timeout 10000 --selector-timeout 20000",
4749
"test:dev": "testcafe chrome:headless e2e/*.testcafe.js",
@@ -59,6 +61,10 @@
5961
"Adam Klein <adam@500tech.com>"
6062
],
6163
"dependencies": {
64+
"@angular/animations": "^10.0.0 || ^11.0.0-0",
65+
"@angular/cdk": "^10.1.3",
66+
"@angular/forms": "^10.0.0 || ^11.0.0-0",
67+
"@angular/material": "^10.1.3",
6268
"lodash-es": "^4.17.15",
6369
"mobx": "~4.14.1"
6470
},
@@ -71,6 +77,7 @@
7177
"@angular/compiler": "^10.0.4",
7278
"@angular/compiler-cli": "^10.0.4",
7379
"@angular/core": "^10.0.4",
80+
"@angular/elements": "^10.0.4",
7481
"@angular/forms": "^10.0.4",
7582
"@angular/platform-browser": "^10.0.4",
7683
"@angular/platform-browser-dynamic": "^10.0.4",
@@ -132,11 +139,5 @@
132139
"*.ts": [
133140
"tslint"
134141
]
135-
},
136-
"husky": {
137-
"hooks": {
138-
"post-commit": "git reset",
139-
"pre-commit": "lint-staged"
140-
}
141142
}
142143
}

projects/docs-app/.browserslistrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
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.
18+
IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

projects/docs-app/karma.conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function(config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, '../../coverage/docs-app'),
20+
reports: ['html', 'lcovonly', 'text-summary'],
21+
fixWebpackSourcePaths: true
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: true,
28+
browsers: ['Chrome'],
29+
singleRun: false,
30+
restartOnFileChange: true
31+
});
32+
};
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { NgModule } from '@angular/core';
2+
import { RouterModule, Routes } from '@angular/router';
3+
import { GettingStartedComponent } from './getting-started/getting-started.component';
4+
import { BasicUsageComponent } from './examples/basic-usage/basic-usage.component';
5+
import { NodesComponent } from './fundamentals/nodes/nodes.component';
6+
import { OptionsComponent } from './fundamentals/options/options.component';
7+
import { ActionsComponent } from './fundamentals/actions/actions.component';
8+
import { TemplatesComponent } from './fundamentals/templates/templates.component';
9+
import { EventsComponent } from './fundamentals/events/events.component';
10+
import { StateBindingComponent } from './fundamentals/state-binding/state-binding.component';
11+
import { ApiComponent } from './fundamentals/api/api.component';
12+
import { StylingComponent } from './fundamentals/styling/styling.component';
13+
import { FocusComponent } from './fundamentals/focus/focus.component';
14+
import { IssuesComponent } from './fundamentals/issues/issues.component';
15+
16+
const routes: Routes = [
17+
{
18+
path: '',
19+
component: GettingStartedComponent,
20+
pathMatch: 'full',
21+
},
22+
{
23+
path: 'examples',
24+
children: [
25+
{ path: 'basic', component: BasicUsageComponent }
26+
]
27+
},
28+
{
29+
path: 'fundamentals',
30+
children: [
31+
{ path: 'nodes', component: NodesComponent },
32+
{ path: 'options', component: OptionsComponent },
33+
{ path: 'actions', component: ActionsComponent },
34+
{ path: 'templates', component: TemplatesComponent },
35+
{ path: 'events', component: EventsComponent },
36+
{ path: 'state', component: StateBindingComponent },
37+
{ path: 'api', component: ApiComponent },
38+
{ path: 'styling', component: StylingComponent },
39+
{ path: 'focus', component: FocusComponent },
40+
{ path: 'issues', component: IssuesComponent },
41+
]
42+
},
43+
];
44+
45+
@NgModule({
46+
imports: [
47+
RouterModule.forRoot(
48+
routes,
49+
{
50+
scrollPositionRestoration: 'enabled'
51+
}
52+
),
53+
],
54+
exports: [
55+
RouterModule,
56+
]
57+
})
58+
export class AppRoutingModule {
59+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<mat-toolbar class="toolbar mat-primary">
2+
<button mat-icon-button class="example-icon" aria-label="Example icon-button with menu icon" (click)="sidenav.toggle()">
3+
<mat-icon>menu</mat-icon>
4+
</button>
5+
<mat-icon svgIcon="tree-logo" aria-hidden="false" class="main-logo"></mat-icon>
6+
<span>Angular Tree Component</span>
7+
<span class="example-spacer"></span>
8+
<a href="https://github.com/CirclonGroup/angular-tree-component" title="GitHub" target="_blank" class="toolbar-link">
9+
<mat-icon svgIcon="github" aria-hidden="false" aria-label="Example thumbs up SVG icon"></mat-icon>
10+
</a>
11+
</mat-toolbar>
12+
13+
<mat-sidenav-container class="sidenav-container">
14+
<mat-sidenav #sidenav mode="side" opened class="sidenav">
15+
<div class="sidenav-menu">
16+
<app-nav-item *ngFor="let navEntry of nav"
17+
[node]="navEntry" [selectedNodes]="currentNodes"></app-nav-item>
18+
</div>
19+
</mat-sidenav>
20+
<mat-sidenav-content class="sidenav-content" [ngClass]="{'sidenav-open': sidenav.opened}">
21+
<main role="main" class="main-content">
22+
<router-outlet></router-outlet>
23+
</main>
24+
</mat-sidenav-content>
25+
</mat-sidenav-container>
26+
27+
<footer>
28+
<app-footer></app-footer>
29+
</footer>

0 commit comments

Comments
 (0)