@ks89/angular-modal-gallery 8.0.0-rc.1 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +123 -0
- package/CONTRIBUTING.md +3 -3
- package/README.md +26 -34
- package/{esm2015/ks89-angular-modal-gallery.js → esm2020/ks89-angular-modal-gallery.mjs} +0 -0
- package/{esm2015/lib/components/accessibility-default.js → esm2020/lib/components/accessibility-default.mjs} +0 -0
- package/{esm2015/lib/components/accessible.component.js → esm2020/lib/components/accessible.component.mjs} +6 -6
- package/esm2020/lib/components/carousel/carousel-previews/carousel-previews.component.mjs +462 -0
- package/esm2020/lib/components/carousel/carousel.component.mjs +747 -0
- package/{esm2015/lib/components/components.js → esm2020/lib/components/components.mjs} +0 -0
- package/esm2020/lib/components/current-image/current-image.component.mjs +616 -0
- package/esm2020/lib/components/current-image/loading-spinner/loading-spinner.component.mjs +80 -0
- package/esm2020/lib/components/dots/dots.component.mjs +127 -0
- package/esm2020/lib/components/modal-gallery/modal-gallery-ref.mjs +103 -0
- package/esm2020/lib/components/modal-gallery/modal-gallery.component.mjs +523 -0
- package/esm2020/lib/components/modal-gallery/modal-gallery.service.mjs +187 -0
- package/esm2020/lib/components/modal-gallery/modal-gallery.tokens.mjs +26 -0
- package/esm2020/lib/components/plain-gallery/plain-gallery.component.mjs +249 -0
- package/esm2020/lib/components/previews/previews.component.mjs +332 -0
- package/{esm2015/lib/components/upper-buttons/upper-buttons-default.js → esm2020/lib/components/upper-buttons/upper-buttons-default.mjs} +0 -0
- package/esm2020/lib/components/upper-buttons/upper-buttons.component.mjs +249 -0
- package/{esm2015/lib/directives/a-tag-bg-image.directive.js → esm2020/lib/directives/a-tag-bg-image.directive.mjs} +3 -3
- package/{esm2015/lib/directives/click-outside.directive.js → esm2020/lib/directives/click-outside.directive.mjs} +3 -3
- package/{esm2015/lib/directives/description.directive.js → esm2020/lib/directives/description.directive.mjs} +3 -3
- package/{esm2015/lib/directives/direction.directive.js → esm2020/lib/directives/direction.directive.mjs} +3 -3
- package/{esm2015/lib/directives/directives.js → esm2020/lib/directives/directives.mjs} +0 -0
- package/esm2020/lib/directives/fallback-image.directive.mjs +59 -0
- package/{esm2015/lib/directives/keyboard-navigation.directive.js → esm2020/lib/directives/keyboard-navigation.directive.mjs} +5 -5
- package/{esm2015/lib/directives/margin.directive.js → esm2020/lib/directives/margin.directive.mjs} +3 -3
- package/{esm2015/lib/directives/max-size.directive.js → esm2020/lib/directives/max-size.directive.mjs} +3 -3
- package/{esm2015/lib/directives/size.directive.js → esm2020/lib/directives/size.directive.mjs} +3 -3
- package/{esm2015/lib/directives/wrap.directive.js → esm2020/lib/directives/wrap.directive.mjs} +6 -6
- package/{esm2015/lib/modal-gallery.module.js → esm2020/lib/modal-gallery.module.mjs} +10 -13
- package/{esm2015/lib/model/accessibility.interface.js → esm2020/lib/model/accessibility.interface.mjs} +0 -0
- package/{esm2015/lib/model/action.enum.js → esm2020/lib/model/action.enum.mjs} +0 -0
- package/esm2020/lib/model/buttons-config.interface.mjs +62 -0
- package/{esm2015/lib/model/carousel-config.interface.js → esm2020/lib/model/carousel-config.interface.mjs} +1 -1
- package/{esm2015/lib/model/carousel-image-config.interface.js → esm2020/lib/model/carousel-image-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/carousel-preview-config.interface.js → esm2020/lib/model/carousel-preview-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/current-image-config.interface.js → esm2020/lib/model/current-image-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/description.interface.js → esm2020/lib/model/description.interface.mjs} +0 -0
- package/{esm2015/lib/model/dots-config.interface.js → esm2020/lib/model/dots-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/image-internal.class.js → esm2020/lib/model/image-internal.class.mjs} +0 -0
- package/{esm2015/lib/model/image.class.js → esm2020/lib/model/image.class.mjs} +0 -0
- package/{esm2015/lib/model/interaction-event.interface.js → esm2020/lib/model/interaction-event.interface.mjs} +0 -0
- package/{esm2015/lib/model/keyboard-config.interface.js → esm2020/lib/model/keyboard-config.interface.mjs} +1 -1
- package/{esm2015/lib/model/keyboard-service-config.interface.js → esm2020/lib/model/keyboard-service-config.interface.mjs} +0 -0
- package/esm2020/lib/model/keyboard.enum.mjs +35 -0
- package/{esm2015/lib/model/lib-config.interface.js → esm2020/lib/model/lib-config.interface.mjs} +1 -1
- package/{esm2015/lib/model/loading-config.interface.js → esm2020/lib/model/loading-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/max-size.interface.js → esm2020/lib/model/max-size.interface.mjs} +0 -0
- package/{esm2015/lib/model/modal-gallery-config.interface.js → esm2020/lib/model/modal-gallery-config.interface.mjs} +1 -1
- package/esm2020/lib/model/plain-gallery-config.interface.mjs +55 -0
- package/{esm2015/lib/model/play-config.interface.js → esm2020/lib/model/play-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/preview-config.interface.js → esm2020/lib/model/preview-config.interface.mjs} +0 -0
- package/{esm2015/lib/model/size.interface.js → esm2020/lib/model/size.interface.mjs} +0 -0
- package/{esm2015/lib/model/slide-config.interface.js → esm2020/lib/model/slide-config.interface.mjs} +0 -0
- package/esm2020/lib/services/config.service.mjs +396 -0
- package/esm2020/lib/services/id-validator.service.mjs +71 -0
- package/{esm2015/lib/services/keyboard.service.js → esm2020/lib/services/keyboard.service.mjs} +3 -3
- package/{esm2015/lib/utils/image.util.js → esm2020/lib/utils/image.util.mjs} +0 -0
- package/esm2020/lib/utils/user-input.util.mjs +104 -0
- package/esm2020/public-api.mjs +42 -0
- package/fesm2015/ks89-angular-modal-gallery.mjs +5782 -0
- package/fesm2015/ks89-angular-modal-gallery.mjs.map +1 -0
- package/{fesm2015/ks89-angular-modal-gallery.js → fesm2020/ks89-angular-modal-gallery.mjs} +521 -544
- package/fesm2020/ks89-angular-modal-gallery.mjs.map +1 -0
- package/lib/components/accessible.component.d.ts +2 -2
- package/lib/components/carousel/carousel-previews/carousel-previews.component.d.ts +0 -7
- package/lib/components/carousel/carousel.component.d.ts +25 -67
- package/lib/components/current-image/current-image.component.d.ts +6 -3
- package/lib/components/dots/dots.component.d.ts +4 -0
- package/lib/components/modal-gallery/modal-gallery-ref.d.ts +35 -0
- package/lib/components/modal-gallery/modal-gallery.component.d.ts +53 -49
- package/lib/components/modal-gallery/modal-gallery.service.d.ts +57 -1
- package/lib/components/plain-gallery/plain-gallery.component.d.ts +16 -10
- package/lib/components/previews/previews.component.d.ts +6 -0
- package/lib/components/upper-buttons/upper-buttons.component.d.ts +5 -1
- package/lib/directives/fallback-image.directive.d.ts +3 -0
- package/lib/directives/keyboard-navigation.directive.d.ts +1 -1
- package/lib/directives/wrap.directive.d.ts +1 -1
- package/lib/model/carousel-config.interface.d.ts +0 -1
- package/lib/model/keyboard-config.interface.d.ts +4 -4
- package/lib/model/keyboard.enum.d.ts +11 -8
- package/lib/model/lib-config.interface.d.ts +20 -7
- package/lib/model/modal-gallery-config.interface.d.ts +2 -2
- package/lib/model/plain-gallery-config.interface.d.ts +1 -9
- package/lib/services/id-validator.service.d.ts +2 -1
- package/lib/utils/user-input.util.d.ts +35 -26
- package/package.json +27 -14
- package/public-api.d.ts +2 -2
- package/bundles/ks89-angular-modal-gallery.umd.js +0 -6067
- package/bundles/ks89-angular-modal-gallery.umd.js.map +0 -1
- package/esm2015/lib/components/carousel/carousel-previews/carousel-previews.component.js +0 -480
- package/esm2015/lib/components/carousel/carousel.component.js +0 -800
- package/esm2015/lib/components/current-image/current-image.component.js +0 -618
- package/esm2015/lib/components/current-image/loading-spinner/loading-spinner.component.js +0 -93
- package/esm2015/lib/components/dots/dots.component.js +0 -132
- package/esm2015/lib/components/modal-gallery/modal-gallery-ref.js +0 -45
- package/esm2015/lib/components/modal-gallery/modal-gallery.component.js +0 -558
- package/esm2015/lib/components/modal-gallery/modal-gallery.service.js +0 -131
- package/esm2015/lib/components/modal-gallery/modal-gallery.tokens.js +0 -3
- package/esm2015/lib/components/plain-gallery/plain-gallery.component.js +0 -253
- package/esm2015/lib/components/previews/previews.component.js +0 -338
- package/esm2015/lib/components/upper-buttons/upper-buttons.component.js +0 -266
- package/esm2015/lib/directives/fallback-image.directive.js +0 -56
- package/esm2015/lib/model/buttons-config.interface.js +0 -66
- package/esm2015/lib/model/keyboard.enum.js +0 -35
- package/esm2015/lib/model/plain-gallery-config.interface.js +0 -64
- package/esm2015/lib/services/config.service.js +0 -395
- package/esm2015/lib/services/id-validator.service.js +0 -73
- package/esm2015/lib/utils/user-input.util.js +0 -95
- package/esm2015/public-api.js +0 -46
- package/fesm2015/ks89-angular-modal-gallery.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
+
# 9.0.1
|
|
2
|
+
|
|
3
|
+
### Bugfixes
|
|
4
|
+
|
|
5
|
+
- update some old links to doc website
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# 9.0.0
|
|
9
|
+
|
|
10
|
+
**Migrate from 8.0.0 to 9.0.0 - Check the official guide [HERE](https://ks89.github.io/angular-modal-gallery-2021-v9.github.io/)**
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- remove legacy mode in carousels (drop IE11) #235 **(BREAKING CHANGE)**
|
|
15
|
+
- remove keyCode in keyboard-navigation-directive, because deprecated #200 **(BREAKING CHANGE)**
|
|
16
|
+
- cleanup download image code in modal-gallery.component (drop IE11 and Edge legacy) #228 **(BREAKING CHANGE)**
|
|
17
|
+
- requestFullscreen and exitFullscreen return promises. **(BREAKING CHANGE)**
|
|
18
|
+
It's not easy to manage all cases in the right way, so at the moment I added only an error in case of catch clause #233 **(BREAKING CHANGE)**
|
|
19
|
+
- Remove AdvancedLayout from PlainGallery, because already unused in v8.x.x #238 **(BREAKING CHANGE)**
|
|
20
|
+
- make LibConfig interface private, to expose ModalLibConfig, PlainLibConfig and CarouselLibConfig #232 **(BREAKING CHANGE)**
|
|
21
|
+
- carousel component accepts CarouselLibConfig as input instead of all parameters to be consistent with changes made in v8.0.0 #229 **(BREAKING CHANGE)**
|
|
22
|
+
- remove `[showGallery]` input from plain-gallery component, because it's unused #239 **(BREAKING CHANGE)**
|
|
23
|
+
- rename `(showImage)` output into `(clickImage)` for plain-gallery #240 **(BREAKING CHANGE)**
|
|
24
|
+
- rename `(showImage)` output into `(changeImage)` for carousel #240 **(BREAKING CHANGE)**
|
|
25
|
+
- when modal-gallery opens with image index 0 or length - 1, it emits first/last Image events #241 **(BREAKING CHANGE)**
|
|
26
|
+
- remove emitButtonAfterHook in closeGallery methods **(BREAKING CHANGE)**
|
|
27
|
+
|
|
28
|
+
### Bugfixes
|
|
29
|
+
|
|
30
|
+
- improve error message if you pass an empty array of images to the carousel #209
|
|
31
|
+
|
|
32
|
+
### Examples
|
|
33
|
+
|
|
34
|
+
- add examples with 0 images to modal-gallery, carousel and plain-gallery #242
|
|
35
|
+
- remove stackblitz demo because not working properly like with version 8.0.0
|
|
36
|
+
|
|
37
|
+
### Tests
|
|
38
|
+
|
|
39
|
+
- improve modal-gallery.component tests to validate also html elements #231
|
|
40
|
+
|
|
41
|
+
### Docs
|
|
42
|
+
|
|
43
|
+
- migration guide from 8.0.0 to 9.0.0
|
|
44
|
+
- upgrade doc website to bootstrap 5.x.x #236
|
|
45
|
+
- many fixes to the API and examples input tables (errors made with 8.0.0)
|
|
46
|
+
- general improvement to the doc to show default values in a cleaner way
|
|
47
|
+
- remove LibConfig interface and use the newer interfaces
|
|
48
|
+
|
|
49
|
+
**Migrate from 8.0.0 to 9.0.0 - Check the official guide [HERE](https://ks89.github.io/angular-modal-gallery-2021-v9.github.io/)**
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# 8.0.1
|
|
53
|
+
|
|
54
|
+
### Bugfixes
|
|
55
|
+
|
|
56
|
+
- fix `config.service.ts` adding `providedIn: 'root'` to the service (fixes #244) reported by @dreiquevada
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# 8.0.0
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
- Migrate to angular/cdk to fix all issues with angular/material **(Breaking Change)** (fixes #137, #111, #95)
|
|
64
|
+
- Split plain-gallery and modal-gallery decoupling those components. Instead, define new APIs to open modal-gallery as a service **(Breaking Change)**
|
|
65
|
+
- upgrade to Angular 12 and angular-cli 12
|
|
66
|
+
- Force Angular >= 12 as minimum supported version. **(Breaking Change)**.
|
|
67
|
+
- remove support to both Angular 6, 7, 8, 9, 10 and 11 **(Breaking Change)**
|
|
68
|
+
- remove Module.forRoot() **(Breaking Change)**
|
|
69
|
+
- move keyboard configuration into libconfig (permits different configuration for every instance of the library). **(Breaking Change)**
|
|
70
|
+
- use IVY as recommended by Angular team ('partial' in tsconfig)
|
|
71
|
+
- Add ability to set fallback image #194 **(Breaking Change)**
|
|
72
|
+
- Add a way to disable titles if requested by the user #179 **(Breaking Change)**
|
|
73
|
+
- remove size from plainGallery Image interface #206 **(Breaking Change)** - reported by @studiocuboweb
|
|
74
|
+
- add new param to previewConfig to display previews on small screens #213 (pull request #214 by vlafranca)
|
|
75
|
+
- Change the background color of modal gallery #225 (requested by @danurasenan here)
|
|
76
|
+
- Carousel has a new input "[disableSsrWorkaround]="true"" to use modals in carousels with SystemJS **(Breaking Change)**.
|
|
77
|
+
Also, every time you need to open modal gallery, you must pass to LibConfig this code:
|
|
78
|
+
```
|
|
79
|
+
keyboardServiceConfig: {
|
|
80
|
+
shortcuts: ['ctrl+s', 'meta+s'],
|
|
81
|
+
disableSsrWorkaround: true
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
- new modal-gallery CSS classes used to set the backdrop **(BREAKING CHANGES)**
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
.ks-modal-gallery-backdrop {
|
|
88
|
+
background: #000 !important;;
|
|
89
|
+
opacity: 0.85 !important;;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ks-modal-gallery-panel {
|
|
93
|
+
z-index: 90000 !important;
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### CI
|
|
98
|
+
- remove AppVeyor
|
|
99
|
+
- remove CircleCi
|
|
100
|
+
- remove Travis Ci
|
|
101
|
+
- add Github Actions Ci
|
|
102
|
+
- add Github CodeQL
|
|
103
|
+
- remove npm's codeclimate coverage reporter to use the new version
|
|
104
|
+
- add Security Policy in SECURITY.MD
|
|
105
|
+
|
|
106
|
+
### Tests
|
|
107
|
+
- update tests to the new APIs and components
|
|
108
|
+
|
|
109
|
+
### Examples
|
|
110
|
+
- upgrade all examples with Angular 12
|
|
111
|
+
- remove SystemJS example
|
|
112
|
+
- create new stackblitz example with Angular 12 and Ivy enabled
|
|
113
|
+
|
|
114
|
+
### Docs
|
|
115
|
+
- new doc website [HERE](https://ks89.github.io/angular-modal-gallery-2020-v8.github.io/)
|
|
116
|
+
|
|
117
|
+
## DEPRECATION WARNINGS
|
|
118
|
+
|
|
119
|
+
**Attention! Angular support for Microsoft's Internet Explorer 11 (IE11) is deprecated and will be removed in Angular v13.**
|
|
120
|
+
**For the same reason, from angular-modal-gallery 8.0.0, IE11 has been deprecated.**
|
|
121
|
+
**At the moment it's still working, but it will be removed in angular-modal-gallery 9.0.0.**
|
|
122
|
+
|
|
123
|
+
|
|
1
124
|
# 8.0.0-rc.1
|
|
2
125
|
### Features
|
|
3
126
|
- upgrade project to Angular 12. This is the minimum required version from now. **BREAKING CHANGE**
|
package/CONTRIBUTING.md
CHANGED
|
@@ -10,7 +10,7 @@ Every time you'll run `npm install` inside an example's folder, you must rebuild
|
|
|
10
10
|
2. remove all `node_modules` and temp folders with compiled files (if necessary)
|
|
11
11
|
3. `npm install` (from the root of this project)
|
|
12
12
|
4. `npm run clean:all`
|
|
13
|
-
5. `cd examples/angular-cli-
|
|
13
|
+
5. `cd examples/angular-cli-13`
|
|
14
14
|
6. `npm install`
|
|
15
15
|
7. `cd ../..`
|
|
16
16
|
8. `cd examples/universal`
|
|
@@ -31,8 +31,8 @@ Every time you'll run `npm install` inside an example's folder, you must rebuild
|
|
|
31
31
|
6. `cd dist/angular-modal-gallery && lite-server` => if everything is ok (also in browser's console), kill the process and go to the next step
|
|
32
32
|
7. `cd ../..`
|
|
33
33
|
|
|
34
|
-
# C. Run angular-cli-
|
|
35
|
-
1. `cd examples/angular-cli-
|
|
34
|
+
# C. Run angular-cli-13 example
|
|
35
|
+
1. `cd examples/angular-cli-13`
|
|
36
36
|
2. `npm start` => if everything is ok (also in browser's console), kill the process and go to the next step
|
|
37
37
|
3. `npm run build:dev`
|
|
38
38
|
4. `cd dist/angular-cli && lite-server` => if everything is ok (also in browser's console), kill the process and go to the next step
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Despite its name, this library is more than for modal galleries, because I'm int
|
|
|
14
14
|
<ul>
|
|
15
15
|
<li><b>plain-gallery</b>: shows either a row, a column or a grid of <b>clickable thumbnails</b> using pure flexbox</li>
|
|
16
16
|
<li><b>modal-gallery</b>: is the core part of this project and display a <b>modal window with full screen images</b>, <b>buttons</b>, the <b>current image</b> and optionally, also navigation <b>dots</b> and <b>previews</b></li>
|
|
17
|
-
<li><b>carousel</b>:
|
|
17
|
+
<li><b>carousel</b>: shows a configurable plain carousel (not modal) with auto-play and other cool features</li>
|
|
18
18
|
</ul>
|
|
19
19
|
<p><b>@ks89/angular-modal-gallery</b> supports also <b>keyboard shortcuts</b>, <b>swipe gestures</b> and <b>mouse events</b>.</p>
|
|
20
20
|
<br>
|
|
@@ -36,22 +36,18 @@ Despite its name, this library is more than for modal galleries, because I'm int
|
|
|
36
36
|
<a href="https://www.npmjs.com/package/@ks89/angular-modal-gallery"><img src="https://img.shields.io/npm/dy/@ks89/angular-modal-gallery.svg?style=flat-square" alt="Downloads/year"></a>
|
|
37
37
|
</p>
|
|
38
38
|
<p align="center">
|
|
39
|
-
<a href="https://
|
|
39
|
+
<a href="https://github.com/Ks89/angular-modal-gallery/actions/workflows/main.yml"><img src="https://github.com/Ks89/angular-modal-gallery/actions/workflows/main.yml/badge.svg" alt="Github Actions CI result"></a>
|
|
40
40
|
</p>
|
|
41
41
|
<p align="center">
|
|
42
42
|
<a href="https://snyk.io/test/github/ks89/angular-modal-gallery"><img src="https://snyk.io/test/github/ks89/angular-modal-gallery/badge.svg" alt="Known Vulnerabilities"></a>
|
|
43
|
-
<a href="https://david-dm.org/Ks89/angular-modal-gallery"><img src="https://david-dm.org/Ks89/angular-modal-gallery.svg" alt="david-dm Dependencies"></a>
|
|
43
|
+
<a href="https://david-dm.org/Ks89/angular-modal-gallery"><img src="https://status.david-dm.org/gh/Ks89/angular-modal-gallery.svg" alt="david-dm Dependencies"></a>
|
|
44
44
|
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2FKs89%2Fangular-modal-gallery?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2FKs89%2Fangular-modal-gallery.svg?type=shield" alt="FOSSA Status"></a>
|
|
45
45
|
<a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square" alt="code style: prettier"></a>
|
|
46
46
|
</p>
|
|
47
47
|
<p align="center">
|
|
48
|
-
<a href="https://codeclimate.com/github/Ks89/angular-modal-gallery"><img src="https://codeclimate.com/github/Ks89/angular-modal-gallery/badges/gpa.svg" alt="Code Climate"></a>
|
|
49
|
-
<a href="https://codeclimate.com/github/Ks89/angular-modal-gallery/coverage"><img src="https://codeclimate.com/github/Ks89/angular-modal-gallery/badges/coverage.svg" alt="ode Climate Coverage"></a>
|
|
50
48
|
<a href="https://coveralls.io/github/Ks89/angular-modal-gallery?branch=master"><img src="https://coveralls.io/repos/github/Ks89/angular-modal-gallery/badge.svg?branch=master" alt="Coveralls Coverage"></a>
|
|
51
49
|
</p>
|
|
52
50
|
<p align="center">
|
|
53
|
-
<a href="https://stackblitz.com/edit/angular-modal-gallery-v8"><img src="https://img.shields.io/badge/stackblitz-available-orange.svg" alt="Stackblitz
|
|
54
|
-
"></a>
|
|
55
51
|
<a href="https://www.npmjs.com/package/@ks89/angular-modal-gallery"><img src="https://img.shields.io/badge/angular--style--guide-compliant-brightgreen.svg" alt="AngularStyleGuide"></a>
|
|
56
52
|
</p>
|
|
57
53
|
<p align="center">
|
|
@@ -72,13 +68,12 @@ Despite its name, this library is more than for modal galleries, because I'm int
|
|
|
72
68
|
2. **[Features](#boom-features-boom)**
|
|
73
69
|
3. **[Installation](#package-installation-package)**
|
|
74
70
|
4. **[OFFICIAL DOCUMENTATION](#book-documentation-book)**
|
|
75
|
-
5. **[
|
|
76
|
-
6. **[
|
|
77
|
-
7. **[
|
|
78
|
-
8. **[
|
|
79
|
-
9. **[
|
|
80
|
-
10. **[
|
|
81
|
-
11. **[License](#copyright-license-copyright)**
|
|
71
|
+
5. **[Choose the version](#warning-choose-the-version-warning)**
|
|
72
|
+
6. **[News](#fire-news-fire)**
|
|
73
|
+
7. **[FAQS](#question-faqs-question)**
|
|
74
|
+
8. **[Contributing](#computer-contributing-computer)**
|
|
75
|
+
9. **[A big thank you to](#sparkling_heart-a-big-thank-you-to-sparkling_heart)**
|
|
76
|
+
10. **[License](#copyright-license-copyright)**
|
|
82
77
|
|
|
83
78
|
<br>
|
|
84
79
|
|
|
@@ -118,10 +113,10 @@ Despite its name, this library is more than for modal galleries, because I'm int
|
|
|
118
113
|
|
|
119
114
|
## :boom: Features :boom:
|
|
120
115
|
- Angular Module to import this library
|
|
121
|
-
- requires Angular >=
|
|
122
|
-
- IVY
|
|
116
|
+
- requires Angular >= 13
|
|
117
|
+
- IVY is required
|
|
123
118
|
- supports all **recommended Angular Compiler Options**
|
|
124
|
-
- compliant to Angular Package Format
|
|
119
|
+
- compliant to Angular Package Format v13 specifications
|
|
125
120
|
- **use [Semantic versioning 2.0.0](http://semver.org/)** also known as 'semver'
|
|
126
121
|
- official examples with `angular-cli`, `angular-cli + material` and `angular-universal` [HERE](https://github.com/Ks89/angular-modal-gallery/tree/master/examples)
|
|
127
122
|
- unit testing with high % coverage
|
|
@@ -137,7 +132,7 @@ Despite its name, this library is more than for modal galleries, because I'm int
|
|
|
137
132
|
- configurable side-previews (visible only on bigger screen)
|
|
138
133
|
- configurable dots navigation (visible only on bigger screen)
|
|
139
134
|
- configurable previews (visible only on bigger screen)
|
|
140
|
-
- and many more... (check the official documentation [HERE](https://ks89.github.io/angular-modal-gallery-
|
|
135
|
+
- and many more... (check the official documentation [HERE](https://ks89.github.io/angular-modal-gallery-2021-v9.github.io/))
|
|
141
136
|
|
|
142
137
|
<br>
|
|
143
138
|
|
|
@@ -148,8 +143,7 @@ Despite its name, this library is more than for modal galleries, because I'm int
|
|
|
148
143
|
- `npm install --save-dev @types/mousetrap @types/hammerjs`
|
|
149
144
|
|
|
150
145
|
From version @ks89/angular-modal-gallery >= 5.0.0, **font-awesome isn't a mandatory dependency**.
|
|
151
|
-
You can use all default features without font-awesome. For more info, check official [documentation website](https://ks89.github.io/angular-modal
|
|
152
|
-
-gallery-2020-v8.github.io/).
|
|
146
|
+
You can use all default features without font-awesome. For more info, check official [documentation website](https://ks89.github.io/angular-modal-gallery-2021-v9.github.io/).
|
|
153
147
|
|
|
154
148
|
<br>
|
|
155
149
|
|
|
@@ -157,13 +151,7 @@ You can use all default features without font-awesome. For more info, check offi
|
|
|
157
151
|
|
|
158
152
|
*Image loading could be slow, because this website is hosted on Github pages*
|
|
159
153
|
|
|
160
|
-
[OFFICIAL DOCUMENTATION WEBSITE](https://ks89.github.io/angular-modal-gallery-
|
|
161
|
-
|
|
162
|
-
<br>
|
|
163
|
-
|
|
164
|
-
## :microphone: **Live demo** :microphone:
|
|
165
|
-
|
|
166
|
-
[OFFICIAL LIVE DEMO](https://stackblitz.com/edit/angular-modal-gallery-v8/)
|
|
154
|
+
[OFFICIAL DOCUMENTATION WEBSITE](https://ks89.github.io/angular-modal-gallery-2021-v9.github.io/)
|
|
167
155
|
|
|
168
156
|
<br>
|
|
169
157
|
|
|
@@ -181,9 +169,11 @@ You can use all default features without font-awesome. For more info, check offi
|
|
|
181
169
|
| Angular 9 | = 7.2.7 | optional |
|
|
182
170
|
| Angular 10 | = 7.2.7 | optional |
|
|
183
171
|
| Angular 11 | = 7.2.7 | optional |
|
|
184
|
-
| Angular 12 |
|
|
172
|
+
| Angular 12 | = 8.0.1 | optional |
|
|
173
|
+
| Angular 13 | >= 9.0.0 | optional |
|
|
185
174
|
|
|
186
175
|
*Version 8.0.0 requires at least Angular 12.*
|
|
176
|
+
*Version 9.0.0 requires at least Angular 13.*
|
|
187
177
|
|
|
188
178
|
<br>
|
|
189
179
|
|
|
@@ -191,7 +181,11 @@ You can use all default features without font-awesome. For more info, check offi
|
|
|
191
181
|
|
|
192
182
|
**More than 100 releases in two years**, and more to come... :)
|
|
193
183
|
|
|
194
|
-
-
|
|
184
|
+
- 11/15/2021 - 9.0.1 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
185
|
+
- 11/06/2021 - 9.0.0 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
186
|
+
- 09/27/2021 - 8.0.1 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
187
|
+
- 07/10/2021 - 8.0.0 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
188
|
+
- 06/13/2021 - 8.0.0-rc.1 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
195
189
|
- 11/22/2020 - 8.0.0-beta.5 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
196
190
|
- 08/14/2020 - 8.0.0-beta.4 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
197
191
|
- 08/12/2020 - 8.0.0-beta.3 - @ks89/angular-modal-gallery - [HERE](https://github.com/Ks89/angular-modal-gallery/releases)
|
|
@@ -239,12 +233,12 @@ You can use all default features without font-awesome. For more info, check offi
|
|
|
239
233
|
**Answer**: Simply run `npm i --save-dev @types/mousetrap`
|
|
240
234
|
2. Question: **I have this error: `Error: No provider for KeyboardService`. What can I do?**<br>
|
|
241
235
|
**Answer**: You forgot to add .forRoot(), so KeyboardService will be never available as a service. Please read section "Installation" [HERE](https
|
|
242
|
-
://ks89.github.io/angular-modal-gallery-
|
|
236
|
+
://ks89.github.io/angular-modal-gallery-2021-v9.github.io/gettingStarted).
|
|
243
237
|
This is a common design pattern for Angular libraries. For more info check also [this issue](https://github.com/Ks89/angular-modal-gallery/issues/94).
|
|
244
238
|
3. Question: **How can I remove images using DELETE button without issues?**<br>
|
|
245
239
|
**Answer**: **You cannot change the input image array. Instead, you should reassign it with a newer array** without the deleted element.
|
|
246
240
|
In other words, **you must think in a functional way**, without changing the input array of images.
|
|
247
|
-
For more information check this official demo [HERE](https://ks89.github.io/angular-modal-gallery-
|
|
241
|
+
For more information check this official demo [HERE](https://ks89.github.io/angular-modal-gallery-2021-v9.github.io/demo/buttons-strategies).
|
|
248
242
|
|
|
249
243
|
<br>
|
|
250
244
|
|
|
@@ -254,9 +248,7 @@ Check `CONTRIBUTING.md` in this repository.
|
|
|
254
248
|
To understand how to contribute to an open source project, [HERE](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) you can find useful information.
|
|
255
249
|
|
|
256
250
|
When you create a pull request, please, format your code to be consistent with the existing code. I suggest to use [WebStorm](https://www.jetbrains.com/webstorm/) as IDE and when you commit don't use a third party software, but the official command line `git`.
|
|
257
|
-
In this way, [prettier](https://prettier.io/) will run using my configuration, and it will auto-format the code. If it
|
|
258
|
-
|
|
259
|
-
Also, if you want to generate the `internal library documentation`, run `npm run docs` and open `./docs/typedoc/index.html`.
|
|
251
|
+
In this way, [prettier](https://prettier.io/) will run using my configuration, and it will auto-format the code. If it fails, add files with `git add .` again and retry.
|
|
260
252
|
|
|
261
253
|
<br>
|
|
262
254
|
|
|
File without changes
|
|
File without changes
|
|
@@ -51,7 +51,7 @@ export class AccessibleComponent {
|
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.
|
|
54
|
-
* @param KeyboardEvent | MouseEvent
|
|
54
|
+
* @param event KeyboardEvent | MouseEvent payload
|
|
55
55
|
* @returns number 1 for NEXT and 0 for NOTHING
|
|
56
56
|
*/
|
|
57
57
|
handleImageEvent(event) {
|
|
@@ -68,7 +68,7 @@ export class AccessibleComponent {
|
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Private method to handle keyboard events over an image.
|
|
71
|
-
* @param KeyboardEvent
|
|
71
|
+
* @param event KeyboardEvent payload
|
|
72
72
|
* @returns number 1 for NEXT and 0 for NOTHING
|
|
73
73
|
*/
|
|
74
74
|
handleImageKeyboardEvent(event) {
|
|
@@ -117,9 +117,9 @@ export class AccessibleComponent {
|
|
|
117
117
|
return NOTHING;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
AccessibleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
121
|
-
AccessibleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
120
|
+
AccessibleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: AccessibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
121
|
+
AccessibleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: AccessibleComponent, selector: "ks-accessible", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: AccessibleComponent, decorators: [{
|
|
123
123
|
type: Component,
|
|
124
124
|
args: [{
|
|
125
125
|
selector: 'ks-accessible',
|
|
@@ -127,4 +127,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.3", ngImpor
|
|
|
127
127
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
128
128
|
}]
|
|
129
129
|
}], ctorParameters: function () { return []; } });
|
|
130
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
130
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjZXNzaWJsZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9rczg5L2FuZ3VsYXItbW9kYWwtZ2FsbGVyeS9zcmMvbGliL2NvbXBvbmVudHMvYWNjZXNzaWJsZS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FzQkc7QUFFSCxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRW5FLE9BQU8sRUFBRSxlQUFlLEVBQUUsdUJBQXVCLEVBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLFVBQVUsRUFBRSxNQUFNLDBCQUEwQixDQUFDOztBQUVqSTs7OztHQUlHO0FBTUgsTUFBTSxPQUFPLG1CQUFtQjtJQUM5QixnQkFBZSxDQUFDO0lBRWhCOzs7OztPQUtHO0lBQ0gscUJBQXFCLENBQUMsU0FBaUIsRUFBRSxLQUFpQztRQUN4RSxJQUFJLENBQUMsS0FBSyxFQUFFO1lBQ1YsT0FBTyxPQUFPLENBQUM7U0FDaEI7UUFDRCxJQUFJLEtBQUssWUFBWSxhQUFhLEVBQUU7WUFDbEMsT0FBTyxJQUFJLENBQUMsNkJBQTZCLENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFDO1NBQzdEO2F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