diff --git a/projects/material-addons/src/lib/content-panel/content-header/content-header.component.html b/projects/material-addons/src/lib/content-panel/content-header/content-header.component.html new file mode 100644 index 00000000..f2edca73 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-header/content-header.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/projects/material-addons/src/lib/content-panel/content-header/content-header.component.scss b/projects/material-addons/src/lib/content-panel/content-header/content-header.component.scss new file mode 100644 index 00000000..6fe369d9 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-header/content-header.component.scss @@ -0,0 +1,3 @@ +.content-header { + padding-right: 0.5rem; +} \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/content-header/content-header.component.ts b/projects/material-addons/src/lib/content-panel/content-header/content-header.component.ts new file mode 100644 index 00000000..08102e4a --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-header/content-header.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'mad-content-header', + templateUrl: './content-header.component.html', + styleUrls: ['./content-header.component.scss'] +}) +export class ContentHeaderComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.html b/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.html new file mode 100644 index 00000000..95a0b70b --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.scss b/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.scss new file mode 100644 index 00000000..3156cf95 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.scss @@ -0,0 +1,7 @@ +:host { + flex: 1 1 auto; + overflow-y: auto; + border-top: 0.05rem solid #cccccc; + padding: 1rem; + height: 1rem; +} \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.ts b/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.ts new file mode 100644 index 00000000..feaec665 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container-content/content-panel-container-content.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'mad-content-panel-container-content', + templateUrl: './content-panel-container-content.component.html', + styleUrls: ['./content-panel-container-content.component.scss'] +}) +export class ContentPanelContainerContentComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.html b/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.html new file mode 100644 index 00000000..95a0b70b --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.scss b/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.scss new file mode 100644 index 00000000..bc672b6a --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.scss @@ -0,0 +1,9 @@ +:host { + border-top: 0.05rem solid #cccccc; + padding: 0.25rem 1rem; + min-height: 2rem; + display: flex; + flex: 0 0 auto; + align-items: center; + min-height: 2rem; +} \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.ts b/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.ts new file mode 100644 index 00000000..72af3b86 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'mad-content-panel-container-footer', + templateUrl: './content-panel-container-footer.component.html', + styleUrls: ['./content-panel-container-footer.component.scss'] +}) +export class ContentPanelContainerFooterComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.html b/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.html new file mode 100644 index 00000000..b75bfb58 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.scss b/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.scss new file mode 100644 index 00000000..9b93179b --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.scss @@ -0,0 +1,13 @@ +:host { + position: relative; + overflow: hidden; + display: flex; + flex: 1 1 auto; + min-height: .05rem; +} + +.content-panel-outer-wrapper { + display: flex; + flex: 1 1 auto; + flex-direction: column; +} \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.ts b/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.ts new file mode 100644 index 00000000..d2939c6d --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel-container/content-panel-container.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'mad-content-panel-container', + templateUrl: './content-panel-container.component.html', + styleUrls: ['./content-panel-container.component.scss'] +}) +export class ContentPanelContainerComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/projects/material-addons/src/lib/content-panel/content-panel.module.ts b/projects/material-addons/src/lib/content-panel/content-panel.module.ts new file mode 100644 index 00000000..108fce61 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/content-panel.module.ts @@ -0,0 +1,26 @@ +import { ContentHeaderComponent } from './content-header/content-header.component'; +import { ContentPanelContainerComponent } from './content-panel-container/content-panel-container.component'; +import { ContentPanelContainerContentComponent } from './content-panel-container-content/content-panel-container-content.component'; +import { ContentPanelContainerFooterComponent } from './content-panel-container-footer/content-panel-container-footer.component'; +import { MainContainerComponent } from './main-container/main-container.component'; +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@NgModule({ + declarations: [ + ContentHeaderComponent, + ContentPanelContainerComponent, + ContentPanelContainerContentComponent, + ContentPanelContainerFooterComponent, + MainContainerComponent, + ], + imports: [CommonModule], + exports: [ + ContentHeaderComponent, + ContentPanelContainerComponent, + ContentPanelContainerContentComponent, + ContentPanelContainerFooterComponent, + MainContainerComponent, + ], +}) +export class ContentPanelModule {} diff --git a/projects/material-addons/src/lib/content-panel/main-container/main-container.component.html b/projects/material-addons/src/lib/content-panel/main-container/main-container.component.html new file mode 100644 index 00000000..c9cc8510 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/main-container/main-container.component.html @@ -0,0 +1,5 @@ +
+ + + +
diff --git a/projects/material-addons/src/lib/content-panel/main-container/main-container.component.scss b/projects/material-addons/src/lib/content-panel/main-container/main-container.component.scss new file mode 100644 index 00000000..77770504 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/main-container/main-container.component.scss @@ -0,0 +1,5 @@ +.main-container { + height: 100%; + display: flex; + flex-direction: column +} \ No newline at end of file diff --git a/projects/material-addons/src/lib/content-panel/main-container/main-container.component.ts b/projects/material-addons/src/lib/content-panel/main-container/main-container.component.ts new file mode 100644 index 00000000..bdc98e04 --- /dev/null +++ b/projects/material-addons/src/lib/content-panel/main-container/main-container.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'mad-main-container', + templateUrl: './main-container.component.html', + styleUrls: ['./main-container.component.scss'] +}) +export class MainContainerComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/projects/material-addons/src/lib/flowbar/flowbar.component.html b/projects/material-addons/src/lib/flowbar/flowbar.component.html new file mode 100644 index 00000000..77364fb9 --- /dev/null +++ b/projects/material-addons/src/lib/flowbar/flowbar.component.html @@ -0,0 +1,10 @@ +
+ + + +
+ {{step.label}} +
+
+
+
diff --git a/projects/material-addons/src/lib/flowbar/flowbar.component.scss b/projects/material-addons/src/lib/flowbar/flowbar.component.scss new file mode 100644 index 00000000..47cdad88 --- /dev/null +++ b/projects/material-addons/src/lib/flowbar/flowbar.component.scss @@ -0,0 +1,29 @@ +.stepper-container { + display: flex; + padding: 0 1rem; +} + +::ng-deep .mat-stepper-horizontal .mat-horizontal-stepper-header { + padding: 0; + height:auto; +} + +::ng-deep .mat-step-header[aria-labelledby="disabled"] { + pointer-events: none !important; + cursor: not-allowed; +} + +::ng-deep .mat-stepper-horizontal .mat-horizontal-content-container { + padding: 0 0 10px 0; +} + +::ng-deep .mat-stepper-horizontal .mat-stepper-horizontal-line { + margin: 0 5px; + border-top-width: 4px; +} + +.step-header-overlay { + position: absolute; + width: 100%; + height: 100%; +} diff --git a/projects/material-addons/src/lib/flowbar/flowbar.component.ts b/projects/material-addons/src/lib/flowbar/flowbar.component.ts new file mode 100644 index 00000000..6e72b63b --- /dev/null +++ b/projects/material-addons/src/lib/flowbar/flowbar.component.ts @@ -0,0 +1,202 @@ +import { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; +import { MatStepper} from '@angular/material/stepper'; + +export interface IStep { + label: string, + enabled?: boolean, + subSteps?: IStep[], + activeSubStep?: IStep +} + +@Component({ + selector: 'mad-flowbar', + templateUrl: './flowbar.component.html', + styleUrls: ['./flowbar.component.scss'] +}) +export class FlowbarComponent implements OnInit, AfterViewInit { + @ViewChild('stepper') private stepper: MatStepper; + + @Input('steps') _steps: IStep[] = []; + @Input('activeStep') _activeStep: IStep; + @Output('activeStepChange') _activeStepChange: EventEmitter = new EventEmitter(true); + /** + * Event emitted when a step header is clicked. + * When defined header navigation has to be implemented programmatically. + * e.g. {@see changeActiveStepOnHeader} + */ + @Output('headerClick') _headerClick: EventEmitter = new EventEmitter(true); + + + ngOnInit(): void { + // If no active step is set as input or the active step is not enabled, select the first enabled step + if (!this._activeStep || !this._activeStep.enabled) { + this._activeStep = this._steps.find(step => { + return step.enabled; + }); + if (this._activeStep) { + // If sub steps exist then set the first non disabled sub step per default + if (this.activeTabHasSubSteps()) { + this._activeStep.activeSubStep = this._activeStep.subSteps.find(step => { + return step.enabled; + }); + } + this._activeStepChange.emit(this._activeStep); + } + } + } + + ngAfterViewInit() { + this.stepper._getIndicatorType = () => 'number'; + } + + public changeActiveStep(step: IStep): void { + const previousIndex = this._steps.indexOf(this._activeStep); + this._activeStep = step; + if (this.activeTabHasSubSteps()) { + if (previousIndex < this._steps.indexOf(this._activeStep)) { + this._activeStep.activeSubStep = this._activeStep.subSteps[0]; + } else { + this._activeStep.activeSubStep = this._activeStep.subSteps[this._activeStep.subSteps.length - 1]; + } + } + this._activeStepChange.emit(this._activeStep); + } + + public changeActiveStepOnHeader(step: IStep): void { + const stepIndex = this._steps.indexOf(step); + this._activeStep = step; + this.stepper.selected = this.stepper._steps.find((_, i) => i === stepIndex); + } + + public changeActiveSubStep(subStep: IStep): void { + this._activeStep.activeSubStep = subStep; + } + + public previous(): void { + if (this.isPreviousAvailable()) { + // If active step has no sub steps or first sub step is selected -> go to previous main step + if (!this.activeTabHasSubSteps() || this.isFirstSubStep()) { + const previousEnabledStep = this.findPreviousEnabledStep(); + this.changeActiveStep(previousEnabledStep); + this.stepper.selectedIndex = this._steps.indexOf(previousEnabledStep); + } else { + const subStepIndex = this._activeStep.subSteps.indexOf(this._activeStep.activeSubStep); + this._activeStep.activeSubStep = this._activeStep.subSteps[subStepIndex - 1]; + } + } + } + + public next(): void { + if (this.isNextAvailable()) { + // If active step has no sub steps or last sub step is selected -> go to next main step + if (!this.activeTabHasSubSteps() || this.isLastSubStep()) { + const nextEnabledStep = this.findNextEnabledStep(); + this.changeActiveStep(nextEnabledStep); + this.stepper.selectedIndex = this._steps.indexOf(nextEnabledStep); + } else { + const subStepIndex = this._activeStep.subSteps.indexOf(this._activeStep.activeSubStep); + this._activeStep.activeSubStep = this._activeStep.subSteps[subStepIndex + 1]; + } + } + } + + public isPreviousAvailable(): boolean { + if (this._activeStep) { + if (!this.activeTabHasSubSteps() || this.isFirstSubStep()) { + const index = this.getCurrentIndex(); + return index > 0 && this.isAnyPreviousStepEnabled(index); + } else { + return true; + } + } + return false; + } + + public isNextAvailable(): boolean { + if (this._activeStep) { + if (!this.activeTabHasSubSteps() || this.isLastSubStep()) { + const index = this.getCurrentIndex(); + return index < this._steps.length - 1 && this.isAnyFollowingStepEnabled(index); + } else { + return true; + } + } + return false; + } + + public isLastStep(): boolean { + if (this.getCurrentIndex() === this._steps.length - 1) { + if (this.activeTabHasSubSteps()) { + return this.isLastSubStep(); + } else { + return true; + } + } + return false; + } + + public getCurrentIndex(): number { + return this._steps.findIndex(value => { + return value === this._activeStep; + }); + } + + public getCurrentSubStepIndex(): number { + return this._activeStep.subSteps.findIndex(value => { + return value === this._activeStep.activeSubStep; + }); + } + + public triggerClick(): void { + const selectedStep = this._steps[this.stepper.selectedIndex]; + this.changeActiveStep(selectedStep); + } + + public headerClick(event: any, step: IStep): void { + event.stopPropagation(); //stop processing current header click event + this._headerClick.emit(step); + } + + get currentStepLabel(): string { + return this._activeStep.label; + } + + get currentSubStepLabel(): string { + return this._activeStep.activeSubStep?.label; + } + + private activeTabHasSubSteps(): boolean { + return this._activeStep.subSteps && this._activeStep.subSteps.length > 0; + } + + private isFirstSubStep(): boolean { + return this._activeStep.activeSubStep === this._activeStep.subSteps[0]; + } + + private isLastSubStep(): boolean { + return this._activeStep.activeSubStep === this._activeStep.subSteps[this._activeStep.subSteps.length - 1]; + } + + private isAnyPreviousStepEnabled(index: number): boolean { + // eslint-disable-next-line id-blacklist + return this._steps.slice(0, index).find(step => step.enabled) !== undefined; + } + + private isAnyFollowingStepEnabled(index: number): boolean { + // eslint-disable-next-line id-blacklist + return this._steps.slice(index + 1, this._steps.length).find(step => step.enabled) !== undefined; + } + + private findPreviousEnabledStep(): IStep { + const index = this.getCurrentIndex(); + return this._steps + .slice(0, index) + .reverse() + .find(step => step.enabled); + } + + private findNextEnabledStep(): IStep { + const index = this.getCurrentIndex(); + return this._steps.slice(index + 1, this._steps.length).find(step => step.enabled); + } +} diff --git a/projects/material-addons/src/lib/flowbar/flowbar.module.ts b/projects/material-addons/src/lib/flowbar/flowbar.module.ts new file mode 100644 index 00000000..b4f81124 --- /dev/null +++ b/projects/material-addons/src/lib/flowbar/flowbar.module.ts @@ -0,0 +1,11 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {MatStepperModule} from '@angular/material/stepper'; +import {FlowbarComponent} from './flowbar.component'; + +@NgModule({ + declarations: [FlowbarComponent], + imports: [CommonModule, MatStepperModule], + exports: [FlowbarComponent], +}) +export class FlowbarModule {} diff --git a/projects/material-addons/src/public-api.ts b/projects/material-addons/src/public-api.ts index 19a43a6b..e46b63bc 100644 --- a/projects/material-addons/src/public-api.ts +++ b/projects/material-addons/src/public-api.ts @@ -23,4 +23,12 @@ export * from './lib/stepper/stepper.component'; export * from './lib/stepper/step-header/step-header.component'; export * from './lib/stepper/mad-stepper-animation'; export * from './lib/stepper/stepper.module'; +export * from './lib/content-panel/content-header/content-header.component'; +export * from './lib/content-panel/content-panel-container/content-panel-container.component'; +export * from './lib/content-panel/content-panel-container-content/content-panel-container-content.component'; +export * from './lib/content-panel/content-panel-container-footer/content-panel-container-footer.component'; +export * from './lib/content-panel/main-container/main-container.component'; +export * from './lib/content-panel/content-panel.module'; +export * from './lib/flowbar/flowbar.component'; +export * from './lib/flowbar/flowbar.module'; export * from './lib/material-addons.module'; diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0f53c735..b74bb338 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { IntroComponent } from './intro/intro.component'; import { HomeComponent } from './home/home.component'; import { ReadOnlyDemoComponent } from './component-demos/read-only-demo/read-only-demo.component'; @@ -12,111 +12,131 @@ import { QuickListDemoComponent } from './component-demos/quick-list-demo/quick- import { TableDemoComponent } from './component-demos/table-demo/table-demo.component'; import { MadButtonsDemoComponent } from "./component-demos/mad-buttons-demo/mad-buttons-demo.component"; import { ThrottleClickDemoComponent } from './component-demos/throttle-click-demo/throttle-click-demo.component'; -import {StepperDemoComponent} from './component-demos/stepper-demo/stepper-demo.component'; +import { StepperDemoComponent } from './component-demos/stepper-demo/stepper-demo.component'; +import { PageLayoutsComponent } from './component-demos/page-layouts/page-layouts.component'; +import { ExampleComponentsLayoutComponent } from './example-components-layout/example-components-layout.component'; const routes: Routes = [ { - path: 'intro', - component: IntroComponent, - pathMatch: 'full', - data: { - i18n: 'intro.title', - }, + path: '', + component: ExampleComponentsLayoutComponent, + children: [ + { + path: '', + redirectTo: 'intro', + pathMatch: 'full', + }, + { + path: 'intro', + component: IntroComponent, + pathMatch: 'full', + data: { + i18n: 'intro.title', + }, + }, + { + path: 'internationalization', + component: InternationalizationComponent, + pathMatch: 'full', + data: { + i18n: 'internationalization.title', + }, + }, + { + path: 'readonly', + component: ReadOnlyDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.readonly', + }, + }, + { + path: 'numeric-field', + component: NumericFieldDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.numeric-field', + }, + }, + { + path: 'toolbar', + component: ToolbarDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.toolbar', + }, + }, + { + path: 'action-button', + component: ActionButtonDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.card', + }, + }, + { + path: 'card', + component: CardDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.card', + }, + }, + { + path: 'quick-list', + component: QuickListDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.quick-list', + }, + }, + { + path: 'mad-buttons', + component: MadButtonsDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.buttons', + }, + }, + { + path: 'table', + component: TableDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.table', + }, + }, + { + path: 'stepper', + component: StepperDemoComponent, + pathMatch: 'full', + data: { + i18n: 'components.demos.stepper', + }, + }, + { + path: 'throttle-click', + component: ThrottleClickDemoComponent, + pathMatch: 'full', + data: { + i18n: 'directives.demos.throttle-click', + }, + }, + { + path: 'page-layouts', + component: PageLayoutsComponent, + pathMatch: 'full', + data: { + i18n: 'layouts.demos.page-layouts', + }, + }, + { + path: 'home', + component: HomeComponent, + pathMatch: 'full', + }, + ], }, - { - path: 'internationalization', - component: InternationalizationComponent, - pathMatch: 'full', - data: { - i18n: 'internationalization.title', - }, - }, - { - path: 'readonly', - component: ReadOnlyDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.readonly', - }, - }, - { - path: 'numeric-field', - component: NumericFieldDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.numeric-field', - }, - }, - { - path: 'toolbar', - component: ToolbarDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.toolbar', - }, - }, - { - path: 'action-button', - component: ActionButtonDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.card', - }, - }, - { - path: 'card', - component: CardDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.card', - }, - }, - { - path: 'quick-list', - component: QuickListDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.quick-list', - }, - }, - { - path: 'mad-buttons', - component: MadButtonsDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.buttons', - }, - }, - { - path: 'table', - component: TableDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.table', - }, - }, - { - path: 'stepper', - component: StepperDemoComponent, - pathMatch: 'full', - data: { - i18n: 'components.demos.stepper', - }, - }, - { - path: 'throttle-click', - component: ThrottleClickDemoComponent, - pathMatch: 'full', - data: { - i18n: 'directives.demos.throttle-click', - }, - }, - { - path: 'home', - component: HomeComponent, - pathMatch: 'full', - }, - { path: '**', redirectTo: 'intro' }, ]; @NgModule({ diff --git a/src/app/app.component.html b/src/app/app.component.html index f8214a36..944ca47e 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,3 +1,3 @@
- +
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5f67ade6..2fda2ff1 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,4 @@ import { Component } from '@angular/core'; -import { ModuleEntries } from 'src/module-entries'; -import { NavigationEntries } from 'src/navigation-entries'; -import { TranslateService } from '@ngx-translate/core'; -import { Router, ActivatedRoute, NavigationEnd } from '@angular/router'; -import { Title } from '@angular/platform-browser'; @Component({ selector: 'app-root', @@ -11,41 +6,4 @@ import { Title } from '@angular/platform-browser'; styleUrls: ['./app.component.scss'], }) export class AppComponent { - moduleName = 'MATERIAL_ADDONS_DEMO'; - - moduleEntries = ModuleEntries.MODULE_ENTRIES; - navEntries = NavigationEntries.NAVIGATION_ENTRIES; - - constructor( - private translate: TranslateService, - private router: Router, - private titleService: Title, - private activatedRoute: ActivatedRoute, - ) { - this.translate.setDefaultLang('en'); - - this.router.events.subscribe(event => { - if (event instanceof NavigationEnd) { - this.setPageTitle(); - } - }); - } - - private setPageTitle(): void { - // TODO: find type - let route = this.activatedRoute; - while (route.firstChild) { - route = route.firstChild; - } - route.data.subscribe(value => { - if (value.i18n) { - this.translate - .get(value.i18n) - .toPromise() - .then(title => { - this.titleService.setTitle(title); - }); - } - }); - } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 85260d8b..41b51cfb 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -49,6 +49,8 @@ import { ToolbarModule, TableModule, ThrottleClickModule, + ContentPanelModule, + FlowbarModule, } from '@porscheinformatik/material-addons'; import { ReadOnlyFieldComponent } from './example-components/read-only-field/read-only-field.component'; import { ReadOnlyFieldWrapperComponent } from './example-components/read-only-field-wrapper/read-only-field-wrapper.component'; @@ -76,12 +78,15 @@ import { MadButtonsComponent } from './example-components/mad-buttons/mad-button import { MadButtonsDemoComponent } from './component-demos/mad-buttons-demo/mad-buttons-demo.component'; import { ThrottleClickComponent } from './example-components/throttle-click/throttle-click.component'; import { ThrottleClickDemoComponent } from './component-demos/throttle-click-demo/throttle-click-demo.component'; -import { QuickListCompactBasicComponent } from './example-components/quick-list-compact-basic/quick-list-compact-basic.component'; import { StepperModule } from '../../projects/material-addons/src/lib/stepper/stepper.module'; import { StepperComponent } from './example-components/stepper/stepper.component'; import { StepperDemoComponent } from './component-demos/stepper-demo/stepper-demo.component'; import { CdkStepperModule } from '@angular/cdk/stepper'; import { MatStepperModule } from '@angular/material/stepper'; +import { QuickListCompactBasicComponent } from './example-components/quick-list-compact-basic/quick-list-compact-basic.component'; +import { PageLayoutsComponent } from './component-demos/page-layouts/page-layouts.component'; +import { FullPageLayoutsModule } from './full-page-layouts/full-page-layouts.module'; +import { ExampleComponentsLayoutComponent } from './example-components-layout/example-components-layout.component'; export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { return new TranslateHttpLoader(http, './assets/i18n/'); @@ -127,6 +132,8 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { QuickListCompactBasicComponent, StepperComponent, StepperDemoComponent, + PageLayoutsComponent, + ExampleComponentsLayoutComponent, ], imports: [ CommonModule, @@ -181,6 +188,9 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { CdkStepperModule, MatStepperModule, StepperModule, + ContentPanelModule, + FullPageLayoutsModule, + FlowbarModule, ], providers: [], bootstrap: [AppComponent], diff --git a/src/app/component-demos/page-layouts/page-layouts.component.html b/src/app/component-demos/page-layouts/page-layouts.component.html new file mode 100644 index 00000000..5551199e --- /dev/null +++ b/src/app/component-demos/page-layouts/page-layouts.component.html @@ -0,0 +1,73 @@ +

Base Pagelayout

+

+ Following example shows a base page layout without multiple pages. If you have different pages (different header, ...) + with routing see next example. +

+
+

Design Guidelines

+

All pages in an application should follow a common layout structure to ensure a consistent user experience across + applications.

+

The Base Pagelayout includes the following components:

+
    +
  • Main Navigation
  • +
  • Pagetitle
  • +
  • Content Area
  • +
+

Further components may complete the pagelayout as needed:

+
    +
  • Back Button
  • +
  • Command bar
  • +
  • Content-Panel
  • +
+

Command Bar

+
    +
  • The Command Bar comprises the most common users tasks.
  • +
  • The most important ones are shown, additional ones are accessible in an overflow-menu.
  • +
  • Other commands, either less common ones or where the proximity to an ui element is crucial, are provided within + the content area. +
  • +
+
+ +

Demo

+Base Pagelayout
+{{ basePageLayout }} +
+

Flow Bar Layout

+

The Flow Bar Layout extends the Base Page Layout by adding a wizard-like navigation control.

+

+ This layout that can be used to highlight the current progress a user is making throughout multiple steps. The Flow + Bar allows the user to navigate between steps, by either clicking on a specific step or using the previous or next + button. +

+
+

Usage

+

Use this layout if you want to guide the user through a sequence of multiple steps. Each step requires the user to + perform a complex task like filling out a form. Don't use this layout if the user's steps are mutually exclusive; in + this case use Tabs instead.

+

When implementing a flow bar on your page, you will need to insert a mad-flowbar + right below your content-header but above your content-container.

+

Following inputs & outputs are available:

+
    +
  • + [steps] - an array of FlowBarStep. + You can extend/implement this interface to save even more information in your steps. +
  • +
  • + [(activeStep)] two way binding of the active step. +
  • +
+

You can use the @ViewChild() annotation to get a reference of your FlowBarComponent, which will allow you to call its methods:

+
    +
  • previous() - open the previous step.
  • +
  • next() - opens the next step.
  • +
  • isPreviousAvailable() - returns true if the previous step can be opened.
  • +
  • isNextAvailable() - returns true if the next step can be opened.
  • +
  • isLastStep() - returns true if the current step is the last.
  • +
+
+
+

Demo

+Base Pagelayout with a Flow Bar
+{{ flowBarLayout }} diff --git a/src/app/component-demos/page-layouts/page-layouts.component.scss b/src/app/component-demos/page-layouts/page-layouts.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/component-demos/page-layouts/page-layouts.component.ts b/src/app/component-demos/page-layouts/page-layouts.component.ts new file mode 100644 index 00000000..9711f3bd --- /dev/null +++ b/src/app/component-demos/page-layouts/page-layouts.component.ts @@ -0,0 +1,77 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-page-layouts', + templateUrl: './page-layouts.component.html', + styleUrls: ['./page-layouts.component.scss'], +}) +export class PageLayoutsComponent { + basePageLayout = + ` + +
+
+ +

Base Pagelayout

+
+
+
+ + +

Define the page content here

+
+ +

Footer here

+
+
+
`; + + flowBarLayout = ` + + +
+
+ +

Flow Bar layout

+
+ + + + + +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut + labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et + ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit + amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna + aliquyam + erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd + gubergren, + no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur + sadipscing + elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam + voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea + takimata sanctus + est + Lorem ipsum dolor sit amet. +

+
+ +
+ + Previous + + + Next + +
+
+
+ `; +} diff --git a/src/app/example-components-layout/example-components-layout.component.html b/src/app/example-components-layout/example-components-layout.component.html new file mode 100644 index 00000000..f8214a36 --- /dev/null +++ b/src/app/example-components-layout/example-components-layout.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/app/example-components-layout/example-components-layout.component.scss b/src/app/example-components-layout/example-components-layout.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/example-components-layout/example-components-layout.component.ts b/src/app/example-components-layout/example-components-layout.component.ts new file mode 100644 index 00000000..4b9d2598 --- /dev/null +++ b/src/app/example-components-layout/example-components-layout.component.ts @@ -0,0 +1,51 @@ +import { Component } from '@angular/core'; +import { ModuleEntries } from 'src/module-entries'; +import { NavigationEntries } from 'src/navigation-entries'; +import { TranslateService } from '@ngx-translate/core'; +import { Router, ActivatedRoute, NavigationEnd } from '@angular/router'; +import { Title } from '@angular/platform-browser'; + +@Component({ + selector: 'app-example-components-layout', + templateUrl: './example-components-layout.component.html', + styleUrls: ['./example-components-layout.component.scss'], +}) +export class ExampleComponentsLayoutComponent { + moduleName = 'MATERIAL_ADDONS_DEMO'; + + moduleEntries = ModuleEntries.MODULE_ENTRIES; + navEntries = NavigationEntries.NAVIGATION_ENTRIES; + + constructor( + private translate: TranslateService, + private router: Router, + private titleService: Title, + private activatedRoute: ActivatedRoute, + ) { + this.translate.setDefaultLang('en'); + + this.router.events.subscribe(event => { + if (event instanceof NavigationEnd) { + this.setPageTitle(); + } + }); + } + + private setPageTitle(): void { + // TODO: find type + let route = this.activatedRoute; + while (route.firstChild) { + route = route.firstChild; + } + route.data.subscribe(value => { + if (value.i18n) { + this.translate + .get(value.i18n) + .toPromise() + .then(title => { + this.titleService.setTitle(title); + }); + } + }); + } +} diff --git a/src/app/full-page-layouts/base-page-layout/base-page-layout.component.html b/src/app/full-page-layouts/base-page-layout/base-page-layout.component.html new file mode 100644 index 00000000..7fbe2693 --- /dev/null +++ b/src/app/full-page-layouts/base-page-layout/base-page-layout.component.html @@ -0,0 +1,62 @@ + + +
+
+ +

Base Pagelayout

+
+
+
+ + +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. +

+
+
+
diff --git a/src/app/full-page-layouts/base-page-layout/base-page-layout.component.scss b/src/app/full-page-layouts/base-page-layout/base-page-layout.component.scss new file mode 100644 index 00000000..dc450bd3 --- /dev/null +++ b/src/app/full-page-layouts/base-page-layout/base-page-layout.component.scss @@ -0,0 +1,8 @@ +.title { + font-weight: unset; + margin-top: 15px; +} + +mad-content-panel-container-content { + height: 100%; +} diff --git a/src/app/full-page-layouts/base-page-layout/base-page-layout.component.ts b/src/app/full-page-layouts/base-page-layout/base-page-layout.component.ts new file mode 100644 index 00000000..af306390 --- /dev/null +++ b/src/app/full-page-layouts/base-page-layout/base-page-layout.component.ts @@ -0,0 +1,20 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; +import { Location } from '@angular/common'; + +@Component({ + selector: 'app-base-page-layout', + templateUrl: './base-page-layout.component.html', + styleUrls: ['./base-page-layout.component.scss'] +}) +export class BasePageLayoutComponent { + constructor(private router: Router, private location: Location) {} + + public goToPreviousPage(): void { + this.router.navigate([''], { skipLocationChange: true }).then(canRedirect => { + if (canRedirect) { + this.location.back(); + } + }); + } +} diff --git a/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.html b/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.html new file mode 100644 index 00000000..7d789baa --- /dev/null +++ b/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.html @@ -0,0 +1,48 @@ + + +
+
+ +

Flow Bar layout

+
+
+
+ + + + +

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut + labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et + ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit + amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna + aliquyam + erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd + gubergren, + no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur + sadipscing + elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam + voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea + takimata sanctus + est + Lorem ipsum dolor sit amet. +

+
+ +
+ Current Step Info +
+
+ + Previous + + + Next + +
+
+
+
diff --git a/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.scss b/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.scss new file mode 100644 index 00000000..dc450bd3 --- /dev/null +++ b/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.scss @@ -0,0 +1,8 @@ +.title { + font-weight: unset; + margin-top: 15px; +} + +mad-content-panel-container-content { + height: 100%; +} diff --git a/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.ts b/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.ts new file mode 100644 index 00000000..a87f9117 --- /dev/null +++ b/src/app/full-page-layouts/flowbar-page-layout/flowbar-page-layout.component.ts @@ -0,0 +1,36 @@ +import { Component, OnInit } from '@angular/core'; +import { IStep } from 'material-addons'; +import { Router } from '@angular/router'; +import { Location } from '@angular/common'; + +@Component({ + selector: 'app-flowbar-page-layout', + templateUrl: './flowbar-page-layout.component.html', + styleUrls: ['./flowbar-page-layout.component.scss'], +}) +export class FlowbarPageLayoutComponent implements OnInit { + steps: IStep[]; + activeStep: IStep; + + constructor(private router: Router, private location: Location) {} + + ngOnInit(): void { + this.steps = [ + { label: '1. Step', enabled: true }, + { label: '2. Step', enabled: true }, + { label: '3. Step', enabled: true }, + ]; + } + + activeStepChanged(step: IStep): void { + this.activeStep = step; + } + + public goToPreviousPage(): void { + this.router.navigate([''], { skipLocationChange: true }).then(canRedirect => { + if (canRedirect) { + this.location.back(); + } + }); + } +} diff --git a/src/app/full-page-layouts/full-page-layouts-routing.module.ts b/src/app/full-page-layouts/full-page-layouts-routing.module.ts new file mode 100644 index 00000000..8bd52d10 --- /dev/null +++ b/src/app/full-page-layouts/full-page-layouts-routing.module.ts @@ -0,0 +1,28 @@ +import { FullPageLayoutsComponent } from './full-page-layouts.component'; +import { BasePageLayoutComponent } from './base-page-layout/base-page-layout.component'; +import {RouterModule, Routes} from '@angular/router'; +import {NgModule} from '@angular/core'; +import {FlowbarPageLayoutComponent} from './flowbar-page-layout/flowbar-page-layout.component'; + +const routes: Routes = [ + { + path: 'full-page-layouts', + component: FullPageLayoutsComponent, + children: [ + { + path: 'base-page-layout', + component: BasePageLayoutComponent, + }, + { + path: 'flowbar-page-layout', + component: FlowbarPageLayoutComponent, + }, + ], + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class FullPageLayoutsRoutingModule { } diff --git a/src/app/full-page-layouts/full-page-layouts.component.html b/src/app/full-page-layouts/full-page-layouts.component.html new file mode 100644 index 00000000..4d37ff0a --- /dev/null +++ b/src/app/full-page-layouts/full-page-layouts.component.html @@ -0,0 +1,58 @@ +
+
+ + + +
+ + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + +
+
+
+
+
+
+ +
+
diff --git a/src/app/full-page-layouts/full-page-layouts.component.scss b/src/app/full-page-layouts/full-page-layouts.component.scss new file mode 100644 index 00000000..1641a7e3 --- /dev/null +++ b/src/app/full-page-layouts/full-page-layouts.component.scss @@ -0,0 +1,10 @@ +.content-container { + display: flex; + flex-direction: column; +} + +.project-title{ + display: flex; + justify-content: center; + align-items: center; +} diff --git a/src/app/full-page-layouts/full-page-layouts.component.ts b/src/app/full-page-layouts/full-page-layouts.component.ts new file mode 100644 index 00000000..293f1387 --- /dev/null +++ b/src/app/full-page-layouts/full-page-layouts.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-full-page-layouts', + templateUrl: './full-page-layouts.component.html', + styleUrls: ['./full-page-layouts.component.scss'], +}) +export class FullPageLayoutsComponent { + +} diff --git a/src/app/full-page-layouts/full-page-layouts.module.ts b/src/app/full-page-layouts/full-page-layouts.module.ts new file mode 100644 index 00000000..427f68de --- /dev/null +++ b/src/app/full-page-layouts/full-page-layouts.module.ts @@ -0,0 +1,82 @@ +import { CommonModule } from '@angular/common'; +import { FullPageLayoutsRoutingModule } from './full-page-layouts-routing.module'; +import { FullPageLayoutsComponent } from './full-page-layouts.component'; +import { BasePageLayoutComponent } from './base-page-layout/base-page-layout.component'; +import { NgModule } from '@angular/core'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {MatButtonModule} from '@angular/material/button'; +import {MatIconModule} from '@angular/material/icon'; +import {MatListModule} from '@angular/material/list'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatFormFieldModule} from '@angular/material/form-field'; +import {MatInputModule} from '@angular/material/input'; +import {MatSidenavModule} from '@angular/material/sidenav'; +import {MatToolbarModule} from '@angular/material/toolbar'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatTooltipModule} from '@angular/material/tooltip'; +import {MatSnackBarModule} from '@angular/material/snack-bar'; +import {MatCardModule} from '@angular/material/card'; +import {FlexLayoutModule} from '@angular/flex-layout'; +import {MatTableModule} from '@angular/material/table'; +import {MatPaginatorModule} from '@angular/material/paginator'; +import {MatSortModule} from '@angular/material/sort'; +import {MatSelectModule} from '@angular/material/select'; +import {MatDatepickerModule} from '@angular/material/datepicker'; +import {PortalModule} from '@angular/cdk/portal'; +import {MatTabsModule} from '@angular/material/tabs'; +import { + ButtonModule, + CardModule, FlowbarModule, + NumericFieldModule, + QuickListModule, + TableModule, + ThrottleClickModule +} from 'material-addons'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import {ContentPanelModule} from '../../../projects/material-addons/src/lib/content-panel/content-panel.module'; +import { FlowbarPageLayoutComponent } from './flowbar-page-layout/flowbar-page-layout.component'; + +@NgModule({ + imports: [ + CommonModule, + FullPageLayoutsRoutingModule, + BrowserAnimationsModule, + FormsModule, + ReactiveFormsModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatDialogModule, + MatCheckboxModule, + MatFormFieldModule, + MatInputModule, + MatSidenavModule, + MatToolbarModule, + MatMenuModule, + MatTooltipModule, + MatSnackBarModule, + MatCardModule, + FlexLayoutModule, + MatTableModule, + MatPaginatorModule, + MatSortModule, + MatSelectModule, + MatDatepickerModule, + PortalModule, + MatTabsModule, + FlexLayoutModule, + NumericFieldModule.forRoot(), + CardModule, + MatProgressSpinnerModule, + QuickListModule, + TableModule, + ButtonModule, + ThrottleClickModule, + ContentPanelModule, + FlowbarModule, + ], + declarations: [FullPageLayoutsComponent, BasePageLayoutComponent, FlowbarPageLayoutComponent], +}) +export class FullPageLayoutsModule { } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 311d0313..03e38a53 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -38,5 +38,11 @@ "demos": { "throttle-click": "Throttle Click" } + }, + "layouts": { + "title": "Layout", + "demos": { + "page-layouts": "Page Layouts" + } } } diff --git a/src/navigation-entries.ts b/src/navigation-entries.ts index c0f5b908..f15f2d16 100644 --- a/src/navigation-entries.ts +++ b/src/navigation-entries.ts @@ -16,6 +16,21 @@ export class NavigationEntries { route: '/internationalization', roles: ['TEST', 'TEST2'], }, + { + name: 'layout', + i18n: 'layouts.title', + matIcon: 'library_books', + roles: ['TEST', 'TEST2'], + children: [ + { + name: 'page layouts', + i18n: 'layouts.demos.page-layouts', + matIcon: 'insert_drive_file', + route: '/page-layouts', + roles: ['TEST3'], + }, + ], + }, { name: 'components', i18n: 'components.title',