-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04a0ed0
commit b3a283d
Showing
17 changed files
with
614 additions
and
491 deletions.
There are no files selected for viewing
36 changes: 9 additions & 27 deletions
36
projects/ng-gallery/src/lib/components/adapters/base-adapter.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 |
---|---|---|
@@ -1,48 +1,30 @@ | ||
/** | ||
* A clone of HammerJs constants | ||
*/ | ||
export const DIRECTION_LEFT = 2; | ||
export const DIRECTION_RIGHT = 4; | ||
export const DIRECTION_UP = 8; | ||
export const DIRECTION_DOWN = 16; | ||
export abstract class SliderAdapter { | ||
|
||
export abstract class BaseSliderAdapter { | ||
readonly abstract hammerDirection: number; | ||
|
||
abstract scrollSnapType: string; | ||
|
||
abstract panDirection: number; | ||
readonly abstract scrollSnapType: string; | ||
|
||
abstract get scrollValue(): number; | ||
|
||
abstract get clientSize(): number; | ||
|
||
abstract get isContentLessThanContainer(): boolean; | ||
|
||
abstract getPanValue(value: number, e: any, behavior: ScrollBehavior): ScrollToOptions; | ||
|
||
abstract getScrollToValue(el: Element, behavior: ScrollBehavior): ScrollToOptions; | ||
|
||
abstract getCentralizerStartSize(): number; | ||
|
||
abstract getCentralizerEndSize(): number; | ||
} | ||
|
||
|
||
export abstract class ThumbSliderAdapter extends BaseSliderAdapter { | ||
|
||
abstract get thumbSize(): number; | ||
} | ||
|
||
|
||
export abstract class SliderAdapter extends BaseSliderAdapter { | ||
abstract getRoomMargin(): string; | ||
|
||
abstract get measureIndex(): number; | ||
abstract getElementRoomMargin(viewport: HTMLElement, el: HTMLElement): string; | ||
|
||
abstract getClientSize(el: HTMLElement): number; | ||
abstract getHammerVelocity(e): number; | ||
|
||
abstract getOffsetSize(el: HTMLElement): number; | ||
abstract getHammerValue(value: number, delta: number, behavior: ScrollBehavior): ScrollToOptions; | ||
|
||
abstract getPanDelta(e: any): number; | ||
// abstract getDraggingValue(value: number, delta: number, behavior: ScrollBehavior): ScrollToOptions; | ||
|
||
abstract getPanVelocity(e: any): number; | ||
// abstract getDraggingProperty(e: MouseEvent): number; | ||
} |
56 changes: 0 additions & 56 deletions
56
projects/ng-gallery/src/lib/components/adapters/common-adapter.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './thumb-adapters'; | ||
export * from './main-adapters'; | ||
export * from './base-adapter'; |
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
Oops, something went wrong.