Skip to content

Commit 15ded93

Browse files
Updating the getting started sample for DashboardLayout component
1 parent 4379629 commit 15ded93

17 files changed

+368
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
# getting-started-with-the-angular-dashboard-layout-component
22
A quick-start Angular project that shows how to add the Angular Dashboard Layout Component to a Angular app.This project contains code to add multiple panels and configure them, drag, and resize the panels dynamically.
3+
4+
5+
# Getting Started with the Angular Dashboard Layout Component
6+
A quick-start Angular project that shows how to add the Angular Dashboard Layout Component to a Angular app.This project contains code to add multiple panels and configure them, drag, and resize the panels dynamically.
7+
8+
Refer to the following documentation to learn about the Angular Dashboard Layout component:
9+
https://ej2.syncfusion.com/angular/documentation/dashboard-layout/getting-started
10+
11+
Check out this online example of the Angular Dashboard Layout component:
12+
https://ej2.syncfusion.com/angular/demos/#/bootstrap5/dashboard-layout/default
13+
14+
## Project prerequisites
15+
Make sure that you have the compatible versions of [Visual Studio Code](https://code.visualstudio.com/download ) and [NodeJS](https://nodejs.org/en/download) or later version in your machine before starting to work on this project.
16+
17+
## How to run this application
18+
To run this application, you need to first clone the `getting-started-with-the-angular-dashboard-layout-component` repository and then open it in Visual Studio Code. Now, simply build and run your project using `ng serve` command to view the output.

angular.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"my-dashboard-app": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:application",
15+
"options": {
16+
"outputPath": "dist/my-dashboard-app",
17+
"index": "src/index.html",
18+
"browser": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
{
25+
"glob": "**/*",
26+
"input": "public"
27+
}
28+
],
29+
"styles": [
30+
"src/styles.css"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"budgets": [
37+
{
38+
"type": "initial",
39+
"maximumWarning": "500kB",
40+
"maximumError": "1MB"
41+
},
42+
{
43+
"type": "anyComponentStyle",
44+
"maximumWarning": "2kB",
45+
"maximumError": "4kB"
46+
}
47+
],
48+
"outputHashing": "all"
49+
},
50+
"development": {
51+
"optimization": false,
52+
"extractLicenses": false,
53+
"sourceMap": true
54+
}
55+
},
56+
"defaultConfiguration": "production"
57+
},
58+
"serve": {
59+
"builder": "@angular-devkit/build-angular:dev-server",
60+
"configurations": {
61+
"production": {
62+
"buildTarget": "my-dashboard-app:build:production"
63+
},
64+
"development": {
65+
"buildTarget": "my-dashboard-app:build:development"
66+
}
67+
},
68+
"defaultConfiguration": "development"
69+
},
70+
"extract-i18n": {
71+
"builder": "@angular-devkit/build-angular:extract-i18n"
72+
},
73+
"test": {
74+
"builder": "@angular-devkit/build-angular:karma",
75+
"options": {
76+
"polyfills": [
77+
"zone.js",
78+
"zone.js/testing"
79+
],
80+
"tsConfig": "tsconfig.spec.json",
81+
"assets": [
82+
{
83+
"glob": "**/*",
84+
"input": "public"
85+
}
86+
],
87+
"styles": [
88+
"src/styles.css"
89+
],
90+
"scripts": []
91+
}
92+
}
93+
}
94+
}
95+
},
96+
"cli": {
97+
"analytics": false
98+
}
99+
}

package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "my-dashboard-app",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test"
10+
},
11+
"private": true,
12+
"dependencies": {
13+
"@angular/animations": "^18.0.0",
14+
"@angular/common": "^18.0.0",
15+
"@angular/compiler": "^18.0.0",
16+
"@angular/core": "^18.0.0",
17+
"@angular/forms": "^18.0.0",
18+
"@angular/platform-browser": "^18.0.0",
19+
"@angular/platform-browser-dynamic": "^18.0.0",
20+
"@angular/router": "^18.0.0",
21+
"@syncfusion/ej2-angular-layouts": "^25.2.3",
22+
"rxjs": "~7.8.0",
23+
"tslib": "^2.3.0",
24+
"zone.js": "~0.14.3"
25+
},
26+
"devDependencies": {
27+
"@angular-devkit/build-angular": "^18.0.2",
28+
"@angular/cli": "^18.0.2",
29+
"@angular/compiler-cli": "^18.0.0",
30+
"@types/jasmine": "~5.1.0",
31+
"jasmine-core": "~5.1.0",
32+
"karma": "~6.4.0",
33+
"karma-chrome-launcher": "~3.2.0",
34+
"karma-coverage": "~2.2.0",
35+
"karma-jasmine": "~5.1.0",
36+
"karma-jasmine-html-reporter": "~2.1.0",
37+
"typescript": "~5.4.2"
38+
}
39+
}

src/app/app.component.css

Whitespace-only changes.

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ejs-dashboardlayout [panels]='panels' [columns]="3" [allowDragging]="false" [allowResizing]="true"></ejs-dashboardlayout>

src/app/app.component.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { AppComponent } from './app.component';
3+
4+
describe('AppComponent', () => {
5+
beforeEach(async () => {
6+
await TestBed.configureTestingModule({
7+
imports: [AppComponent],
8+
}).compileComponents();
9+
});
10+
11+
it('should create the app', () => {
12+
const fixture = TestBed.createComponent(AppComponent);
13+
const app = fixture.componentInstance;
14+
expect(app).toBeTruthy();
15+
});
16+
17+
it(`should have the 'my-dashboard-app' title`, () => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.componentInstance;
20+
expect(app.title).toEqual('my-dashboard-app');
21+
});
22+
23+
it('should render title', () => {
24+
const fixture = TestBed.createComponent(AppComponent);
25+
fixture.detectChanges();
26+
const compiled = fixture.nativeElement as HTMLElement;
27+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, my-dashboard-app');
28+
});
29+
});

src/app/app.component.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component } from '@angular/core';
2+
import { RouterOutlet } from '@angular/router';
3+
import { DashboardLayoutAllModule } from '@syncfusion/ej2-angular-layouts';
4+
5+
@Component({
6+
selector: 'app-root',
7+
standalone: true,
8+
imports: [RouterOutlet, DashboardLayoutAllModule],
9+
templateUrl: './app.component.html',
10+
styleUrl: './app.component.css'
11+
})
12+
export class AppComponent {
13+
public panels: Object[] = [
14+
{ id: "Panel 1", header: "<div>Panel 1</div>", content: "<div>Content of panel 1</div>", col: 0, sizeY: 2, minSizeY: 1, maxSizeY: 2 },
15+
{ id: "Panel 2", header: "<div>Panel 2</div>", content: "<div>Content of panel 2</div>", col: 1, row: 0 },
16+
{ id: "Panel 3", header: "<div>Panel 3</div>", content: "<div>Content of panel 3</div>", col: 2 },
17+
{ id: "Panel 4", header: "<div>Panel 4</div>", content: "<div>Content of panel 4</div>", col: 1, row: 1, sizeX: 2, minSizeX: 1, maxSizeX: 2 }
18+
];
19+
}

src/app/app.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
4+
import { routes } from './app.routes';
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
8+
};

src/app/app.routes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Routes } from '@angular/router';
2+
3+
export const routes: Routes = [];

src/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>MyDashboardApp</title>
6+
<base href="/">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>

src/main.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { appConfig } from './app/app.config';
3+
import { AppComponent } from './app/app.component';
4+
import { registerLicense } from '@syncfusion/ej2-base';
5+
6+
registerLicense('Ngo9BigBOggjHTQxAR8/V1NBaF1cXmhPYVFwWmFZfVpgcl9GY1ZRQWYuP1ZhSXxXdkBhXn1fdHFXTmFeU0A=')
7+
8+
bootstrapApplication(AppComponent, appConfig)
9+
.catch((err) => console.error(err));

src/styles.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* You can add global styles to this file, and also import other style files */
2+
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
3+
@import "../node_modules/@syncfusion/ej2-angular-layouts/styles/material.css";
4+
5+
6+
.e-panel-header {
7+
text-align: center;
8+
padding: 10px;
9+
}
10+
11+
.e-panel-content {
12+
text-align: center;
13+
margin-top: 10px;
14+
}

tsconfig.app.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
2+
{
3+
"extends": "./tsconfig.json",
4+
"compilerOptions": {
5+
"outDir": "./out-tsc/app",
6+
"types": []
7+
},
8+
"files": [
9+
"src/main.ts"
10+
],
11+
"include": [
12+
"src/**/*.d.ts"
13+
]
14+
}

tsconfig.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
2+
{
3+
"compileOnSave": false,
4+
"compilerOptions": {
5+
"outDir": "./dist/out-tsc",
6+
"strict": true,
7+
"noImplicitOverride": true,
8+
"noPropertyAccessFromIndexSignature": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"skipLibCheck": true,
12+
"esModuleInterop": true,
13+
"sourceMap": true,
14+
"declaration": false,
15+
"experimentalDecorators": true,
16+
"moduleResolution": "bundler",
17+
"importHelpers": true,
18+
"target": "ES2022",
19+
"module": "ES2022",
20+
"useDefineForClassFields": false,
21+
"lib": [
22+
"ES2022",
23+
"dom"
24+
]
25+
},
26+
"angularCompilerOptions": {
27+
"enableI18nLegacyMessageIdFormat": false,
28+
"strictInjectionParameters": true,
29+
"strictInputAccessModifiers": true,
30+
"strictTemplates": true
31+
}
32+
}

tsconfig.spec.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
2+
{
3+
"extends": "./tsconfig.json",
4+
"compilerOptions": {
5+
"outDir": "./out-tsc/spec",
6+
"types": [
7+
"jasmine"
8+
]
9+
},
10+
"include": [
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts"
13+
]
14+
}

0 commit comments

Comments
 (0)