-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from kreuzerk/feature/customScrollPoints
Feature/custom scroll points
- Loading branch information
Showing
61 changed files
with
459 additions
and
225 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {RouterModule} from '@angular/router'; | ||
|
||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot([ | ||
{path: '', loadChildren: './introduction/introduction.module#IntroductionModule'}, | ||
{path: 'scrolling', loadChildren: './scrolling/scrolling.module#ScrollingModule'} | ||
])], | ||
exports: [RouterModule] | ||
}) | ||
export class AppRoutingModule { | ||
} |
20 changes: 0 additions & 20 deletions
20
projects/ng-sortgrid-demo/src/app/examples/memory-demo.css
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
projects/ng-sortgrid-demo/src/app/examples/step/step.component.html
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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.
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.
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.
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
39 changes: 39 additions & 0 deletions
39
projects/ng-sortgrid-demo/src/app/introduction/introduction.component.html
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,39 @@ | ||
<ngsg-demo-nav></ngsg-demo-nav> | ||
<ngsg-demo-header></ngsg-demo-header> | ||
|
||
<div class="container"> | ||
<h1>1. Getting started</h1> | ||
<ngsg-demo-step title="Loop over your elements with *ngFor. 🛎️ the items needs to be an array. Alternate you can also use the async pipe - see below" image="gs1.png"></ngsg-demo-step> | ||
<ngsg-demo-step title="Apply the ngSortgridItem directive" image="gs2.png"></ngsg-demo-step> | ||
<ngsg-demo-memory></ngsg-demo-memory> | ||
|
||
<hr class="chaptor-separator"/> | ||
|
||
<h1>2. React on changes</h1> | ||
<p>In most cases you are interested in the new sort order. Often you want to store them in local storage or even send them | ||
to the backend. To do so the following two steps are needed in addition to the "Getting started" step.</p> | ||
<ngsg-demo-step title="Pass your items to the directive via the ngSortGridItems input." image="gs3.png"></ngsg-demo-step> | ||
<ngsg-demo-step title="React on the 'sorted' output events" image="gs4.png"></ngsg-demo-step> | ||
<ngsg-demo-react-on-changes-memory></ngsg-demo-react-on-changes-memory> | ||
|
||
<hr class="chaptor-separator"/> | ||
<h1>3. Group sortgrids</h1> | ||
<p>In case you have more than one sortgriditem on the page you need to group the sortgriditems to avoid dropping drags from | ||
one group in another group.</p> | ||
<ngsg-demo-step title="Pass in a unique name to the ngSortGridGroup input" image="gs5.png"></ngsg-demo-step> | ||
<ngsg-demo-groups-memory></ngsg-demo-groups-memory> | ||
|
||
<hr class="chaptor-separator"/> | ||
<h1>4. Use the async pipe</h1> | ||
<ngsg-demo-step title="Use the async pipe to loop over the items and to pass in the ngSortGridItems" image="gs6.png"></ngsg-demo-step> | ||
<ngsg-demo-async></ngsg-demo-async> | ||
|
||
<hr class="chaptor-separator"/> | ||
<h1>5. Scrolling</h1> | ||
<p> | ||
The scrolling demo is in a separate page because we need more items and a sticky navheader. | ||
</p> | ||
|
||
<button routerLink="scrolling" class="btn btn-primary" style="margin-bottom: 50px">Check out the demo...</button> | ||
|
||
</div> |
26 changes: 26 additions & 0 deletions
26
projects/ng-sortgrid-demo/src/app/introduction/introduction.component.spec.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,26 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { IntroductionComponent } from './introduction.component'; | ||
import {IntroductionModule} from './introduction.module'; | ||
|
||
describe('IntroductionComponent', () => { | ||
let component: IntroductionComponent; | ||
let fixture: ComponentFixture<IntroductionComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [IntroductionModule] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(IntroductionComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
projects/ng-sortgrid-demo/src/app/introduction/introduction.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,14 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-introduction', | ||
templateUrl: './introduction.component.html' | ||
}) | ||
export class IntroductionComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
projects/ng-sortgrid-demo/src/app/introduction/introduction.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,28 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {IntroductionComponent} from './introduction.component'; | ||
import {GettingStartedMemoryComponent} from './examples/getting-started/getting-started-memory.component'; | ||
import {ReactOnChangesMemoryComponent} from './examples/react-on-changes/react-on-changes-memory.component'; | ||
import {GroupsMemoryComponent} from './examples/groups/groups-memory.component'; | ||
import {AsyncPipeMemoryComponent} from './examples/async-pipe/async-pipe-memory.component'; | ||
import {IntroductionRoutingModule} from './introduction.routing.module'; | ||
import {NgsgModule} from '../../../../ng-sortgrid/src/lib/ngsg.module'; | ||
import {SharedModule} from '../shared/shared.module'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
IntroductionComponent, | ||
GettingStartedMemoryComponent, | ||
ReactOnChangesMemoryComponent, | ||
GroupsMemoryComponent, | ||
AsyncPipeMemoryComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
IntroductionRoutingModule, | ||
NgsgModule, | ||
SharedModule | ||
] | ||
}) | ||
export class IntroductionModule { | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/ng-sortgrid-demo/src/app/introduction/introduction.routing.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,12 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {RouterModule} from '@angular/router'; | ||
import {IntroductionComponent} from './introduction.component'; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild([ | ||
{path: '', component: IntroductionComponent} | ||
])], | ||
exports: [RouterModule] | ||
}) | ||
export class IntroductionRoutingModule { | ||
} |
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
projects/ng-sortgrid-demo/src/app/scrolling/scrolling.component.html
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,17 @@ | ||
<ngsg-demo-nav [fixed]="true" [height]="height + 'px'" subtitle="Scrolling demo"></ngsg-demo-nav> | ||
<div class="container" style="margin-top: 400px"> | ||
<h1>Scrolling</h1> | ||
<ngsg-demo-step title="Sample code to enable scrolling with a custom top scroll point." image="scrolling-code.png"></ngsg-demo-step> | ||
<ngsg-demo-step title="Scroll down to the bottom of the page, drag an item over the blue header (which is the top scroll point) and watch it scroll 😊"></ngsg-demo-step> | ||
<div class="example-container"> | ||
<ngsg-card *ngFor="let item of items" | ||
ngSortgridItem | ||
ngSortGridGroup="getting-started" | ||
[autoScroll]="true" | ||
[scrollPointTop]="height" | ||
[ngSortGridItems]="items" | ||
[item]="item" | ||
class="example-box"> | ||
</ngsg-card> | ||
</div> | ||
</div> |
25 changes: 25 additions & 0 deletions
25
projects/ng-sortgrid-demo/src/app/scrolling/scrolling.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ScrollingComponent } from './scrolling.component'; | ||
|
||
describe('ScrollingComponent', () => { | ||
let component: ScrollingComponent; | ||
let fixture: ComponentFixture<ScrollingComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ScrollingComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ScrollingComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.