From f910615831dc5269e1d69f2b122f365b5bc41d5c Mon Sep 17 00:00:00 2001 From: sercan Date: Mon, 6 Sep 2021 23:32:50 +0300 Subject: [PATCH] (@fuse/loading-bar) First iteration of the FuseLoadingBar component, service, interceptor and their documentation --- src/@fuse/components/loading-bar/index.ts | 1 + .../loading-bar/loading-bar.component.html | 5 + .../loading-bar/loading-bar.component.scss | 7 + .../loading-bar/loading-bar.component.ts | 83 +++ .../loading-bar/loading-bar.interceptor.ts | 49 ++ .../loading-bar/loading-bar.module.ts | 29 ++ .../loading-bar/loading-bar.service.ts | 146 ++++++ .../components/loading-bar/public-api.ts | 3 + src/app/layout/layout.module.ts | 10 +- .../layout/layouts/empty/empty.component.html | 3 + src/app/layout/layouts/empty/empty.module.ts | 2 + .../centered/centered.component.html | 3 + .../horizontal/centered/centered.module.ts | 2 + .../enterprise/enterprise.component.html | 3 + .../enterprise/enterprise.module.ts | 2 + .../material/material.component.html | 3 + .../horizontal/material/material.module.ts | 2 + .../horizontal/modern/modern.component.html | 3 + .../horizontal/modern/modern.module.ts | 2 + .../vertical/classic/classic.component.html | 3 + .../vertical/classic/classic.module.ts | 2 + .../vertical/classy/classy.component.html | 3 + .../layouts/vertical/classy/classy.module.ts | 2 + .../vertical/compact/compact.component.html | 3 + .../vertical/compact/compact.module.ts | 2 + .../vertical/dense/dense.component.html | 3 + .../layouts/vertical/dense/dense.module.ts | 2 + .../futuristic/futuristic.component.html | 3 + .../vertical/futuristic/futuristic.module.ts | 2 + .../layouts/vertical/thin/thin.component.html | 3 + .../layouts/vertical/thin/thin.module.ts | 2 + .../loading-bar/loading-bar.component.html | 484 ++++++++++++++++++ .../loading-bar/loading-bar.component.ts | 109 ++++ .../fuse-components.component.ts | 21 +- .../fuse-components/fuse-components.module.ts | 8 +- .../fuse-components.routing.ts | 5 + 36 files changed, 996 insertions(+), 19 deletions(-) create mode 100644 src/@fuse/components/loading-bar/index.ts create mode 100644 src/@fuse/components/loading-bar/loading-bar.component.html create mode 100644 src/@fuse/components/loading-bar/loading-bar.component.scss create mode 100644 src/@fuse/components/loading-bar/loading-bar.component.ts create mode 100644 src/@fuse/components/loading-bar/loading-bar.interceptor.ts create mode 100644 src/@fuse/components/loading-bar/loading-bar.module.ts create mode 100644 src/@fuse/components/loading-bar/loading-bar.service.ts create mode 100644 src/@fuse/components/loading-bar/public-api.ts create mode 100644 src/app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component.html create mode 100644 src/app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component.ts diff --git a/src/@fuse/components/loading-bar/index.ts b/src/@fuse/components/loading-bar/index.ts new file mode 100644 index 00000000..780b263a --- /dev/null +++ b/src/@fuse/components/loading-bar/index.ts @@ -0,0 +1 @@ +export * from '@fuse/components/loading-bar/public-api'; diff --git a/src/@fuse/components/loading-bar/loading-bar.component.html b/src/@fuse/components/loading-bar/loading-bar.component.html new file mode 100644 index 00000000..3f884fef --- /dev/null +++ b/src/@fuse/components/loading-bar/loading-bar.component.html @@ -0,0 +1,5 @@ + + + diff --git a/src/@fuse/components/loading-bar/loading-bar.component.scss b/src/@fuse/components/loading-bar/loading-bar.component.scss new file mode 100644 index 00000000..7a46ec0e --- /dev/null +++ b/src/@fuse/components/loading-bar/loading-bar.component.scss @@ -0,0 +1,7 @@ +fuse-loading-bar { + position: fixed; + top: 0; + z-index: 999; + width: 100%; + height: 6px; +} diff --git a/src/@fuse/components/loading-bar/loading-bar.component.ts b/src/@fuse/components/loading-bar/loading-bar.component.ts new file mode 100644 index 00000000..c6a14e0e --- /dev/null +++ b/src/@fuse/components/loading-bar/loading-bar.component.ts @@ -0,0 +1,83 @@ +import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewEncapsulation } from '@angular/core'; +import { coerceBooleanProperty } from '@angular/cdk/coercion'; +import { FuseLoadingBarService } from '@fuse/components/loading-bar/loading-bar.service'; +import { takeUntil } from 'rxjs/operators'; +import { Subject } from 'rxjs'; + +@Component({ + selector : 'fuse-loading-bar', + templateUrl : './loading-bar.component.html', + styleUrls : ['./loading-bar.component.scss'], + encapsulation: ViewEncapsulation.None, + exportAs : 'fuseLoadingBar' +}) +export class FuseLoadingBarComponent implements OnChanges, OnInit, OnDestroy +{ + @Input() autoMode: boolean = true; + mode: 'determinate' | 'indeterminate'; + progress: number = 0; + show: boolean = false; + private _unsubscribeAll: Subject = new Subject(); + + /** + * Constructor + */ + constructor(private _fuseLoadingBarService: FuseLoadingBarService) + { + } + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On changes + * + * @param changes + */ + ngOnChanges(changes: SimpleChanges): void + { + // Auto mode + if ( 'autoMode' in changes ) + { + // Set the auto mode in the service + this._fuseLoadingBarService.setAutoMode(coerceBooleanProperty(changes.autoMode.currentValue)); + } + } + + /** + * On init + */ + ngOnInit(): void + { + // Subscribe to the service + this._fuseLoadingBarService.mode$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((value) => { + this.mode = value; + }); + + this._fuseLoadingBarService.progress$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((value) => { + this.progress = value; + }); + + this._fuseLoadingBarService.show$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((value) => { + this.show = value; + }); + + } + + /** + * On destroy + */ + ngOnDestroy(): void + { + // Unsubscribe from all subscriptions + this._unsubscribeAll.next(); + this._unsubscribeAll.complete(); + } +} diff --git a/src/@fuse/components/loading-bar/loading-bar.interceptor.ts b/src/@fuse/components/loading-bar/loading-bar.interceptor.ts new file mode 100644 index 00000000..6c9ba4b0 --- /dev/null +++ b/src/@fuse/components/loading-bar/loading-bar.interceptor.ts @@ -0,0 +1,49 @@ +import { Injectable } from '@angular/core'; +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { finalize } from 'rxjs/operators'; +import { FuseLoadingBarService } from '@fuse/components/loading-bar/loading-bar.service'; + +@Injectable() +export class FuseLoadingBarInterceptor implements HttpInterceptor +{ + handleRequestsAutomatically: boolean; + + /** + * Constructor + */ + constructor( + private _fuseLoadingBarService: FuseLoadingBarService + ) + { + // Subscribe to the auto + this._fuseLoadingBarService.auto$ + .subscribe((value) => { + this.handleRequestsAutomatically = value; + }); + } + + /** + * Intercept + * + * @param req + * @param next + */ + intercept(req: HttpRequest, next: HttpHandler): Observable> + { + // If the Auto mode is turned off, do nothing + if ( !this.handleRequestsAutomatically ) + { + return next.handle(req); + } + + // Set the loading status to true + this._fuseLoadingBarService._setLoadingStatus(true, req.url); + + return next.handle(req).pipe( + finalize(() => { + // Set the status to false if there are any errors or the request is completed + this._fuseLoadingBarService._setLoadingStatus(false, req.url); + })); + } +} diff --git a/src/@fuse/components/loading-bar/loading-bar.module.ts b/src/@fuse/components/loading-bar/loading-bar.module.ts new file mode 100644 index 00000000..4baab4c3 --- /dev/null +++ b/src/@fuse/components/loading-bar/loading-bar.module.ts @@ -0,0 +1,29 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { HTTP_INTERCEPTORS } from '@angular/common/http'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { FuseLoadingBarComponent } from '@fuse/components/loading-bar/loading-bar.component'; +import { FuseLoadingBarInterceptor } from '@fuse/components/loading-bar/loading-bar.interceptor'; + +@NgModule({ + declarations: [ + FuseLoadingBarComponent + ], + imports : [ + CommonModule, + MatProgressBarModule + ], + exports : [ + FuseLoadingBarComponent + ], + providers : [ + { + provide : HTTP_INTERCEPTORS, + useClass: FuseLoadingBarInterceptor, + multi : true + } + ] +}) +export class FuseLoadingBarModule +{ +} diff --git a/src/@fuse/components/loading-bar/loading-bar.service.ts b/src/@fuse/components/loading-bar/loading-bar.service.ts new file mode 100644 index 00000000..88ec2a9b --- /dev/null +++ b/src/@fuse/components/loading-bar/loading-bar.service.ts @@ -0,0 +1,146 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { BehaviorSubject, Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class FuseLoadingBarService +{ + private _auto$: BehaviorSubject = new BehaviorSubject(true); + private _mode$: BehaviorSubject<'determinate' | 'indeterminate'> = new BehaviorSubject<'determinate' | 'indeterminate'>('indeterminate'); + private _progress$: BehaviorSubject = new BehaviorSubject(0); + private _show$: BehaviorSubject = new BehaviorSubject(false); + private _urlMap: Map = new Map(); + + /** + * Constructor + */ + constructor(private _httpClient: HttpClient) + { + } + + // ----------------------------------------------------------------------------------------------------- + // @ Accessors + // ----------------------------------------------------------------------------------------------------- + + /** + * Getter for auto mode + */ + get auto$(): Observable + { + return this._auto$.asObservable(); + } + + /** + * Getter for mode + */ + get mode$(): Observable<'determinate' | 'indeterminate'> + { + return this._mode$.asObservable(); + } + + /** + * Getter for progress + */ + get progress$(): Observable + { + return this._progress$.asObservable(); + } + + /** + * Getter for show + */ + get show$(): Observable + { + return this._show$.asObservable(); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Show the loading bar + */ + show(): void + { + this._show$.next(true); + } + + /** + * Hide the loading bar + */ + hide(): void + { + this._show$.next(false); + } + + /** + * Set the auto mode + * + * @param value + */ + setAutoMode(value: boolean): void + { + this._auto$.next(value); + } + + /** + * Set the mode + * + * @param value + */ + setMode(value: 'determinate' | 'indeterminate'): void + { + this._mode$.next(value); + } + + /** + * Set the progress of the bar manually + * + * @param value + */ + setProgress(value: number): void + { + if ( value < 0 || value > 100 ) + { + console.error('Progress value must be between 0 and 100!'); + return; + } + + this._progress$.next(value); + } + + /** + * Sets the loading status on the given url + * + * @param status + * @param url + */ + _setLoadingStatus(status: boolean, url: string): void + { + // Return if the url was not provided + if ( !url ) + { + console.error('The request URL must be provided!'); + return; + } + + if ( status === true ) + { + this._urlMap.set(url, status); + this._show$.next(true); + } + else if ( status === false && this._urlMap.has(url) ) + { + this._urlMap.delete(url); + } + + // Only set the status to 'false' if all outgoing requests are completed + if ( this._urlMap.size === 0 ) + { + this._show$.next(false); + } + } +} diff --git a/src/@fuse/components/loading-bar/public-api.ts b/src/@fuse/components/loading-bar/public-api.ts new file mode 100644 index 00000000..d13b3a63 --- /dev/null +++ b/src/@fuse/components/loading-bar/public-api.ts @@ -0,0 +1,3 @@ +export * from '@fuse/components/loading-bar/loading-bar.component'; +export * from '@fuse/components/loading-bar/loading-bar.service'; +export * from '@fuse/components/loading-bar/loading-bar.module'; diff --git a/src/app/layout/layout.module.ts b/src/app/layout/layout.module.ts index 426c45ad..88211cab 100644 --- a/src/app/layout/layout.module.ts +++ b/src/app/layout/layout.module.ts @@ -1,7 +1,4 @@ import { NgModule } from '@angular/core'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { FuseDrawerModule } from '@fuse/components/drawer'; import { LayoutComponent } from 'app/layout/layout.component'; import { EmptyLayoutModule } from 'app/layout/layouts/empty/empty.module'; import { CenteredLayoutModule } from 'app/layout/layouts/horizontal/centered/centered.module'; @@ -40,13 +37,10 @@ const layoutModules = [ declarations: [ LayoutComponent ], - imports: [ - MatIconModule, - MatTooltipModule, - FuseDrawerModule, + imports : [ SharedModule, SettingsModule, - ...layoutModules, + ...layoutModules ], exports : [ LayoutComponent, diff --git a/src/app/layout/layouts/empty/empty.component.html b/src/app/layout/layouts/empty/empty.component.html index 3dbd8494..214217fc 100644 --- a/src/app/layout/layouts/empty/empty.component.html +++ b/src/app/layout/layouts/empty/empty.component.html @@ -1,3 +1,6 @@ + + +
diff --git a/src/app/layout/layouts/empty/empty.module.ts b/src/app/layout/layouts/empty/empty.module.ts index 339f5cc6..12153080 100644 --- a/src/app/layout/layouts/empty/empty.module.ts +++ b/src/app/layout/layouts/empty/empty.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; +import { FuseLoadingBarModule } from '@fuse/components/loading-bar'; import { SharedModule } from 'app/shared/shared.module'; import { EmptyLayoutComponent } from 'app/layout/layouts/empty/empty.component'; @@ -9,6 +10,7 @@ import { EmptyLayoutComponent } from 'app/layout/layouts/empty/empty.component'; ], imports : [ RouterModule, + FuseLoadingBarModule, SharedModule ], exports : [ diff --git a/src/app/layout/layouts/horizontal/centered/centered.component.html b/src/app/layout/layouts/horizontal/centered/centered.component.html index 8b2ca444..c6c8ca70 100644 --- a/src/app/layout/layouts/horizontal/centered/centered.component.html +++ b/src/app/layout/layouts/horizontal/centered/centered.component.html @@ -1,3 +1,6 @@ + + +
diff --git a/src/app/layout/layouts/horizontal/centered/centered.module.ts b/src/app/layout/layouts/horizontal/centered/centered.module.ts index b1d952f4..cc4bc461 100644 --- a/src/app/layout/layouts/horizontal/centered/centered.module.ts +++ b/src/app/layout/layouts/horizontal/centered/centered.module.ts @@ -6,6 +6,7 @@ import { MatDividerModule } from '@angular/material/divider'; import { MatIconModule } from '@angular/material/icon'; import { MatMenuModule } from '@angular/material/menu'; import { FuseFullscreenModule } from '@fuse/components/fullscreen'; +import { FuseLoadingBarModule } from '@fuse/components/loading-bar'; import { FuseNavigationModule } from '@fuse/components/navigation'; import { LanguagesModule } from 'app/layout/common/languages/languages.module'; import { MessagesModule } from 'app/layout/common/messages/messages.module'; @@ -28,6 +29,7 @@ import { CenteredLayoutComponent } from 'app/layout/layouts/horizontal/centered/ MatIconModule, MatMenuModule, FuseFullscreenModule, + FuseLoadingBarModule, FuseNavigationModule, LanguagesModule, MessagesModule, diff --git a/src/app/layout/layouts/horizontal/enterprise/enterprise.component.html b/src/app/layout/layouts/horizontal/enterprise/enterprise.component.html index 4f376812..45b3fb3f 100644 --- a/src/app/layout/layouts/horizontal/enterprise/enterprise.component.html +++ b/src/app/layout/layouts/horizontal/enterprise/enterprise.component.html @@ -1,3 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + +
+ + Components +
+
+ +
+

+ Loading Bar +

+
+
+ +
+ +
+ +

+ fuse-loading-bar is a small component to show the loading status at the top of the page. It can be configured to the + Auto Mode to show/hide automatically on each HTTP request. It can also be toggled manually using its service. +

+

+ Exported as: fuseLoadingBar +

+ +

Module

+ + +

Usage

+

+ Here's the basic usage of the fuse-loading-bar. We already placed the component to the + layout templates for you but you can always move it! +

+ + + + +

Properties

+
+ + + + + + + + + + + + + + + +
NameDescriptionDefault
+
@Input()
+
autoMode: boolean
+
+ Turn on or off the Auto Mode. + + true +
+
+ +

Service

+

+ FuseLoadingBarService can be injected to control the loading bar from anywhere. +

+
+
+ show(): void; +
+
+ Shows the loading bar +
+
+
+
+ hide(): void; +
+
+ Hides the loading bar +
+
+
+
+ setAutoMode(value: boolean): void; +
+
+ Sets the Auto Mode. In Auto mode, loading bar will show when there is an HTTP request and it will + hide when all HTTP requests are completed or failed. +
+
+
+
+ setMode(value: 'determinate' | 'indeterminate'): void; +
+
+ Sets the mode of the underlying MatProgressBar component. +
+
+
+
+ setProgress(value: number): void; +
+
+ Sets the progress manually. Only available on determinate mode. +
+
+ +

Examples

+
+ +
+
Show / hide the loading bar manually
+
+ + + + + + + +
+
+ + + + + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
Toggle the Auto Mode
+
+ + + + + + + +
+
+ + + Auto Mode + + +
+ + + +
API call status: {{apiCallStatus}}
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
Manually set the progress
+
+ + + + + + + +
+
+ +
+ + + +
+ + + Toggle determinate mode + + + + Progress value + + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +
diff --git a/src/app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component.ts b/src/app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component.ts new file mode 100644 index 00000000..b52d5258 --- /dev/null +++ b/src/app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component.ts @@ -0,0 +1,109 @@ +import { Component } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { MatSliderChange } from '@angular/material/slider'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; +import { finalize } from 'rxjs/operators'; +import { FuseLoadingBarService } from '@fuse/components/loading-bar'; +import { FuseComponentsComponent } from 'app/modules/admin/ui/fuse-components/fuse-components.component'; + +@Component({ + selector : 'loading-bar', + templateUrl: './loading-bar.component.html' +}) +export class LoadingBarComponent +{ + apiCallStatus: string = '-'; + mode: 'determinate' | 'indeterminate' = 'indeterminate'; + + /** + * Constructor + */ + constructor( + private _httpClient: HttpClient, + private _fuseComponentsComponent: FuseComponentsComponent, + private _fuseLoadingBarService: FuseLoadingBarService + ) + { + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Toggle the drawer + */ + toggleDrawer(): void + { + // Toggle the drawer + this._fuseComponentsComponent.matDrawer.toggle(); + } + + /** + * Show the loading bar + */ + showLoadingBar(): void + { + this._fuseLoadingBarService.show(); + } + + /** + * Hide the loading bar + */ + hideLoadingBar(): void + { + this._fuseLoadingBarService.hide(); + } + + /** + * Set the auto mode + * + * @param change + */ + setAutoMode(change: MatSlideToggleChange): void + { + this._fuseLoadingBarService.setAutoMode(change.checked); + } + + /** + * Make a fake API call + */ + makeAPICall(): void + { + this.apiCallStatus = 'Waiting...'; + + this._httpClient.get('https://jsonplaceholder.typicode.com/posts?_delay=2000') + .pipe(finalize(() => { + this.apiCallStatus = 'Finished!'; + })) + .subscribe((response) => { + console.log(response); + }); + } + + /** + * Toggle the mode + */ + toggleMode(): void + { + // Show the loading bar + this._fuseLoadingBarService.show(); + + // Turn off the auto mode + this._fuseLoadingBarService.setAutoMode(false); + + // Set the mode + this.mode = this.mode === 'indeterminate' ? 'determinate' : 'indeterminate'; + this._fuseLoadingBarService.setMode(this.mode); + } + + /** + * Set the progress + * + * @param change + */ + setProgress(change: MatSliderChange): void + { + this._fuseLoadingBarService.setProgress(change.value); + } +} diff --git a/src/app/modules/admin/ui/fuse-components/fuse-components.component.ts b/src/app/modules/admin/ui/fuse-components/fuse-components.component.ts index 017d93da..df3f0781 100644 --- a/src/app/modules/admin/ui/fuse-components/fuse-components.component.ts +++ b/src/app/modules/admin/ui/fuse-components/fuse-components.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; +import { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { FuseNavigationItem } from '@fuse/components/navigation'; import { MatDrawer } from '@angular/material/sidenav'; import { Subject } from 'rxjs'; @@ -6,11 +6,10 @@ import { FuseMediaWatcherService } from '@fuse/services/media-watcher'; import { takeUntil } from 'rxjs/operators'; @Component({ - selector : 'fuse-components', - templateUrl : './fuse-components.component.html', - styleUrls : ['./fuse-components.component.scss'], - encapsulation : ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush + selector : 'fuse-components', + templateUrl : './fuse-components.component.html', + styleUrls : ['./fuse-components.component.scss'], + encapsulation: ViewEncapsulation.None }) export class FuseComponentsComponent implements OnInit, OnDestroy { @@ -24,7 +23,6 @@ export class FuseComponentsComponent implements OnInit, OnDestroy * Constructor */ constructor( - private _changeDetectorRef: ChangeDetectorRef, private _fuseMediaWatcherService: FuseMediaWatcherService ) { @@ -83,6 +81,12 @@ export class FuseComponentsComponent implements OnInit, OnDestroy type : 'basic', link : '/ui/fuse-components/components/highlight' }, + { + id : 'fuse-components.components.loading-bar', + title: 'Loading Bar', + type : 'basic', + link : '/ui/fuse-components/components/loading-bar' + }, { id : 'fuse-components.components.masonry', title: 'Masonry', @@ -201,9 +205,6 @@ export class FuseComponentsComponent implements OnInit, OnDestroy this.drawerMode = 'over'; this.drawerOpened = false; } - - // Mark for check - this._changeDetectorRef.markForCheck(); }); } diff --git a/src/app/modules/admin/ui/fuse-components/fuse-components.module.ts b/src/app/modules/admin/ui/fuse-components/fuse-components.module.ts index 113c0e58..0007cb8b 100644 --- a/src/app/modules/admin/ui/fuse-components/fuse-components.module.ts +++ b/src/app/modules/admin/ui/fuse-components/fuse-components.module.ts @@ -5,6 +5,8 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSliderModule } from '@angular/material/slider'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; import { MatTreeModule } from '@angular/material/tree'; @@ -31,6 +33,7 @@ import { ScrollbarComponent } from 'app/modules/admin/ui/fuse-components/directi import { ScrollResetComponent } from 'app/modules/admin/ui/fuse-components/directives/scroll-reset/scroll-reset.component'; import { ConfigComponent } from 'app/modules/admin/ui/fuse-components/services/config/config.component'; import { ConfirmationComponent } from 'app/modules/admin/ui/fuse-components/services/confirmation/confirmation.component'; +import { LoadingBarComponent } from 'app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component'; import { MediaWatcherComponent } from 'app/modules/admin/ui/fuse-components/services/media-watcher/media-watcher.component'; import { SplashScreenComponent } from 'app/modules/admin/ui/fuse-components/services/splash-screen/splash-screen.component'; import { FindByKeyComponent } from 'app/modules/admin/ui/fuse-components/pipes/find-by-key/find-by-key.component'; @@ -47,6 +50,7 @@ import { fuseComponentsRoutes } from 'app/modules/admin/ui/fuse-components/fuse- DrawerComponent, FullscreenComponent, HighlightComponent, + LoadingBarComponent, MasonryComponent, NavigationComponent, ScrollbarComponent, @@ -58,13 +62,15 @@ import { fuseComponentsRoutes } from 'app/modules/admin/ui/fuse-components/fuse- FindByKeyComponent, MustMatchComponent ], - imports: [ + imports : [ RouterModule.forChild(fuseComponentsRoutes), MatButtonModule, MatFormFieldModule, MatIconModule, MatInputModule, MatSelectModule, + MatSlideToggleModule, + MatSliderModule, MatSidenavModule, MatTabsModule, MatTreeModule, diff --git a/src/app/modules/admin/ui/fuse-components/fuse-components.routing.ts b/src/app/modules/admin/ui/fuse-components/fuse-components.routing.ts index c8c27748..21a8b83a 100644 --- a/src/app/modules/admin/ui/fuse-components/fuse-components.routing.ts +++ b/src/app/modules/admin/ui/fuse-components/fuse-components.routing.ts @@ -7,6 +7,7 @@ import { DateRangeComponent } from 'app/modules/admin/ui/fuse-components/compone import { DrawerComponent } from 'app/modules/admin/ui/fuse-components/components/drawer/drawer.component'; import { FullscreenComponent } from 'app/modules/admin/ui/fuse-components/components/fullscreen/fullscreen.component'; import { HighlightComponent } from 'app/modules/admin/ui/fuse-components/components/highlight/highlight.component'; +import { LoadingBarComponent } from 'app/modules/admin/ui/fuse-components/components/loading-bar/loading-bar.component'; import { MasonryComponent } from 'app/modules/admin/ui/fuse-components/components/masonry/masonry.component'; import { NavigationComponent } from 'app/modules/admin/ui/fuse-components/components/navigation/navigation.component'; import { ScrollbarComponent } from 'app/modules/admin/ui/fuse-components/directives/scrollbar/scrollbar.component'; @@ -69,6 +70,10 @@ export const fuseComponentsRoutes: Route[] = [ path : 'highlight', component: HighlightComponent }, + { + path : 'loading-bar', + component: LoadingBarComponent + }, { path : 'masonry', component: MasonryComponent