-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(public): use perfect-scrollbar in sbb-table (#173)
Closes #35
- Loading branch information
1 parent
f25430f
commit b817f21
Showing
31 changed files
with
329 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
projects/angular-showcase/src/app/business/component-viewer/component-viewer.component.scss
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
projects/angular-showcase/src/app/business/component-viewer/component-viewer.component.ts
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
projects/angular-showcase/src/app/core/component-viewer/component-viewer.component.html
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
projects/angular-showcase/src/app/core/component-viewer/component-viewer.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...mple-viewer/example-viewer.component.scss → ...ewer/public-example-viewer.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ts/angular-showcase/src/app/features/public-component-viewer/ps-chrome-patch.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Directive, ElementRef, Self } from '@angular/core'; | ||
import { PerfectScrollbarComponent } from 'ngx-perfect-scrollbar'; | ||
|
||
@Directive({ | ||
// tslint:disable-next-line: directive-selector | ||
selector: 'perfect-scrollbar' | ||
}) | ||
export class PsChromePatchDirective { | ||
constructor(elementRef: ElementRef, @Self() perfectScrollbar: PerfectScrollbarComponent) { | ||
const element: HTMLElement = elementRef.nativeElement; | ||
perfectScrollbar.psXReachEnd.subscribe(() => { | ||
if ( | ||
perfectScrollbar.directiveRef.elementRef.nativeElement.getBoundingClientRect().top < 0 && | ||
element.scrollTo | ||
) { | ||
element.scrollTo(0, 0); | ||
} | ||
}); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...gular-showcase/src/app/features/public-component-viewer/public-component-viewer.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { PortalModule } from '@angular/cdk/portal'; | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { ScrollingModule } from '@sbb-esta/angular-core/scrolling'; | ||
import { TabsModule } from '@sbb-esta/angular-public/tabs'; | ||
|
||
import { PublicExampleViewerComponent } from './example-viewer/public-example-viewer.component'; | ||
import { PsChromePatchDirective } from './ps-chrome-patch.directive'; | ||
import { PublicComponentViewerComponent } from './public-component-viewer/public-component-viewer.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
PublicExampleViewerComponent, | ||
PublicComponentViewerComponent, | ||
PsChromePatchDirective | ||
], | ||
imports: [CommonModule, PortalModule, ScrollingModule, TabsModule] | ||
}) | ||
export class PublicComponentViewerModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...nt-viewer/component-viewer.component.scss → ...er/public-component-viewer.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
:host { | ||
display: block; | ||
height: calc(100vh - 48px); | ||
overflow-y: hidden; | ||
margin-left: 300px; | ||
} | ||
|
||
perfect-scrollbar { | ||
height: calc(100vh - 48px); | ||
} | ||
|
||
article { | ||
padding: 3rem; | ||
} |
22 changes: 22 additions & 0 deletions
22
...ures/public-component-viewer/public-component-viewer/public-component-viewer.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, Renderer2 } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
|
||
import { ComponentViewerBase } from '../../../shared/component-viewer-base'; | ||
import { ExampleProvider } from '../../../shared/example-provider'; | ||
import { HtmlLoader } from '../../../shared/html-loader.service'; | ||
|
||
@Component({ | ||
selector: 'sbb-public-component-viewer', | ||
templateUrl: './public-component-viewer.component.html', | ||
styleUrls: ['./public-component-viewer.component.scss'] | ||
}) | ||
export class PublicComponentViewerComponent extends ComponentViewerBase { | ||
constructor( | ||
htmlLoader: HtmlLoader, | ||
exampleProvider: ExampleProvider, | ||
route: ActivatedRoute, | ||
renderer: Renderer2 | ||
) { | ||
super(htmlLoader, exampleProvider, route, renderer); | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
projects/angular-showcase/src/app/public/component-viewer/component-viewer.component.html
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
projects/angular-showcase/src/app/public/component-viewer/component-viewer.component.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.