Skip to content

Commit

Permalink
Merge branch 'refactor_for_angular9'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	package.json
#	src/index.ts
#	src/lib/ngx-image-zoom.component.ts
  • Loading branch information
wittlock committed Feb 23, 2020
2 parents dcd3ca2 + ad38990 commit ac838a3
Show file tree
Hide file tree
Showing 30 changed files with 14,735 additions and 791 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Editor configuration, see http://editorconfig.org
# Editor configuration, see https://editorconfig.org
root = true

[*]
Expand Down
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

54 changes: 24 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
# Node
node_modules/*
npm-debug.log

# TypeScript
src/*.js
src/*.map
src/*.d.ts
# See http://help.github.com/ignore-files/ for more about ignoring files.

# JetBrains
.idea
.project
.settings
.idea/*
*.iml
# compiled output
/dist
/tmp
/out-tsc

# Windows
Thumbs.db
Desktop.ini
# dependencies
/node_modules

# Ngc generated files
**/*.ngfactory.ts
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# Build files
dist/*
.tmp/*
# IDEs and editors
/.idea

# Playground tmp files
.playground
playground/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# Probably not needed either
.travis.yml
.yo-rc.json
bs-config.json
package-lock.json
# System Files
.DS_Store
Thumbs.db
27 changes: 0 additions & 27 deletions .npmignore

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<a name="0.5.0"></a>
# 0.5.0

### Breaking changes
* To comply with recommendaing naming conventions the follow name changes have been done:
* Changed tag name from *ngx-image-zoom* to *lib-ngx-image-zoom* ([style 02-07](https://angular.io/guide/styleguide#style-02-07))
* Changed output *onZoomScroll* to *zoomScroll* ([style 05-16](https://angular.io/guide/styleguide#style-05-16))
* Changed output *onZoomPosition* to *zoomPosition* ([style 05-16](https://angular.io/guide/styleguide#style-05-16))
* With the upgrade *.forRoot()* is no longer needed when importing the NgxImageZoomModule in your project.

### Features
* Completely redid the library wrapping for Angular 9 support.
* Library is now in Angular Package Format for better compatibility.
* Added a new input scrollParentSelector to further control zooming in complex layouts.

### Bugfixes
* Clean up event listeners when component is destroyed.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## Project status

**Breaking changes** in version 0.5.0, see [changelog](CHANGELOG.md) for details. This version is only tested
with Angular9, I'll try to test and make compatible with a few versions back too for a later version. As far
as I can tell 0.5.0 is Ivy compatible too.

Still in early development, more features are planned and incoming. Should be in a working
state right now but it's not tested in lots of different setups yet.

Expand Down Expand Up @@ -36,7 +40,7 @@ lensHeight | 100 | Height of the lens, if enabled.
circularLens | false | Make the lens circular instead of square. This will only look good if width and height are equal.
minZoomRatio | *baseRatio* | Lower limit on how much zoom can be applied with scrollZoom enabled. See below for details.
maxZoomRatio | 2 | Upper limit on how much zoom can be applied with scrollZoom enabled. See below for details.
scrollParentSelector | *none* | Selector of parent scrolling view as string. This avoid zoom gap with cursor when the scrolling view is not the main window. Example : '#scrolling-frame'
scrollParentSelector | *none* | Selector of parent scrolling view as string. This avoid zoom gap with cursor when the scrolling view is not the main window. Example : `#scrolling-frame`
isInsideStaticContainer | false | Set to `true` if the thumbnail is inside a container, to which `position: static` is applied (e.g. a modal window). This is required to avoid zoom position being calculated incorrectly.

### Zoom modes
Expand All @@ -60,8 +64,8 @@ The component outputs the follow events that can be triggered on.

Event&#160;name | Description
:---:|---
onZoomScroll | Whenever the user changes the zoom level using the scroll wheel this event will fire with the current zoom ratio (see above).
onZoomPosition | When the point on where the zoom is focused changes this event emits a Coord event (interface exported from the module) with X/Y in pixels relative thumbnails top left corner. Practically whenever the user moves the mouse cursor over the image.
zoomScroll | Whenever the user changes the zoom level using the scroll wheel this event will fire with the current zoom ratio (see above).
zoomPosition | When the point on where the zoom is focused changes this event emits a Coord event (interface exported from the module) with X/Y in pixels relative thumbnails top left corner. Practically whenever the user moves the mouse cursor over the image.

## Installation

Expand Down Expand Up @@ -90,7 +94,7 @@ import { NgxImageZoomModule } from 'ngx-image-zoom';
],
imports: [
BrowserModule,
NgxImageZoomModule.forRoot() // <-- Add this line
NgxImageZoomModule // <-- Add this line
],
providers: [],
bootstrap: [AppComponent]
Expand All @@ -105,10 +109,10 @@ Once the library is imported, you can use its component in your Angular applicat
<h1>
{{title}}
</h1>
<ngx-image-zoom
<lib-ngx-image-zoom
[thumbImage]=myThumbnail
[fullImage]=myFullresImage
></ngx-image-zoom>
></lib-ngx-image-zoom>
```

## License
Expand Down
47 changes: 47 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "./",
"projects": {
"ngx-image-zoom": {
"projectType": "library",
"root": "./",
"sourceRoot": "src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "tsconfig.lib.json",
"project": "ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.lib.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}},
"defaultProject": "ngx-image-zoom"
}
Loading

0 comments on commit ac838a3

Please sign in to comment.