@autotaxatiepartners/ngx-gallery 1.0.0

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.
Files changed (106) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintrc.json +51 -0
  3. package/.travis.yml +38 -0
  4. package/CHANGELOG.md +16 -0
  5. package/LICENSE +22 -0
  6. package/README.md +296 -0
  7. package/angular.json +108 -0
  8. package/package.json +71 -0
  9. package/projects/gallery/.eslintrc.json +55 -0
  10. package/projects/gallery/README.md +24 -0
  11. package/projects/gallery/karma.conf.js +52 -0
  12. package/projects/gallery/ng-package.json +7 -0
  13. package/projects/gallery/package.json +32 -0
  14. package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.html +4 -0
  15. package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.scss +21 -0
  16. package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.spec.ts +25 -0
  17. package/projects/gallery/src/lib/ngx-gallery-action/ngx-gallery-action.component.ts +28 -0
  18. package/projects/gallery/src/lib/ngx-gallery-action.ts +23 -0
  19. package/projects/gallery/src/lib/ngx-gallery-animation.ts +6 -0
  20. package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.html +12 -0
  21. package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.scss +45 -0
  22. package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.spec.ts +25 -0
  23. package/projects/gallery/src/lib/ngx-gallery-arrows/ngx-gallery-arrows.component.ts +28 -0
  24. package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.html +4 -0
  25. package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.scss +26 -0
  26. package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.spec.ts +25 -0
  27. package/projects/gallery/src/lib/ngx-gallery-bullets/ngx-gallery-bullets.component.ts +25 -0
  28. package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.html +49 -0
  29. package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.scss +106 -0
  30. package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.spec.ts +35 -0
  31. package/projects/gallery/src/lib/ngx-gallery-image/ngx-gallery-image.component.ts +395 -0
  32. package/projects/gallery/src/lib/ngx-gallery-image-size.ts +4 -0
  33. package/projects/gallery/src/lib/ngx-gallery-image.ts +31 -0
  34. package/projects/gallery/src/lib/ngx-gallery-layout.ts +4 -0
  35. package/projects/gallery/src/lib/ngx-gallery-options.ts +255 -0
  36. package/projects/gallery/src/lib/ngx-gallery-order.ts +5 -0
  37. package/projects/gallery/src/lib/ngx-gallery-ordered-image.ts +19 -0
  38. package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.html +66 -0
  39. package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.scss +121 -0
  40. package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.spec.ts +34 -0
  41. package/projects/gallery/src/lib/ngx-gallery-preview/ngx-gallery-preview.component.ts +486 -0
  42. package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.html +44 -0
  43. package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.scss +87 -0
  44. package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.spec.ts +31 -0
  45. package/projects/gallery/src/lib/ngx-gallery-thumbnails/ngx-gallery-thumbnails.component.ts +297 -0
  46. package/projects/gallery/src/lib/ngx-gallery.component.html +53 -0
  47. package/projects/gallery/src/lib/ngx-gallery.component.scss +78 -0
  48. package/projects/gallery/src/lib/ngx-gallery.component.spec.ts +37 -0
  49. package/projects/gallery/src/lib/ngx-gallery.component.ts +337 -0
  50. package/projects/gallery/src/lib/ngx-gallery.module.ts +29 -0
  51. package/projects/gallery/src/lib/ngx-gallery.service.spec.ts +18 -0
  52. package/projects/gallery/src/lib/ngx-gallery.service.ts +71 -0
  53. package/projects/gallery/src/public-api.ts +20 -0
  54. package/projects/gallery/src/test.ts +17 -0
  55. package/projects/gallery/tsconfig.lib.json +14 -0
  56. package/projects/gallery/tsconfig.lib.prod.json +9 -0
  57. package/projects/gallery/tsconfig.spec.json +16 -0
  58. package/projects/gallery-app/.browserslistrc +12 -0
  59. package/projects/gallery-app/.eslintrc.json +40 -0
  60. package/projects/gallery-app/e2e/protractor.conf.js +32 -0
  61. package/projects/gallery-app/e2e/src/app.e2e-spec.ts +23 -0
  62. package/projects/gallery-app/e2e/src/app.po.ts +11 -0
  63. package/projects/gallery-app/e2e/tsconfig.json +13 -0
  64. package/projects/gallery-app/karma.conf.js +32 -0
  65. package/projects/gallery-app/src/app/app-routing.module.ts +11 -0
  66. package/projects/gallery-app/src/app/app.component.html +4 -0
  67. package/projects/gallery-app/src/app/app.component.scss +9 -0
  68. package/projects/gallery-app/src/app/app.component.spec.ts +35 -0
  69. package/projects/gallery-app/src/app/app.component.ts +76 -0
  70. package/projects/gallery-app/src/app/app.module.ts +21 -0
  71. package/projects/gallery-app/src/assets/.gitkeep +0 -0
  72. package/projects/gallery-app/src/assets/img/gallery/1-big.jpeg +0 -0
  73. package/projects/gallery-app/src/assets/img/gallery/1-medium.jpeg +0 -0
  74. package/projects/gallery-app/src/assets/img/gallery/1-small.jpeg +0 -0
  75. package/projects/gallery-app/src/assets/img/gallery/2-big.jpeg +0 -0
  76. package/projects/gallery-app/src/assets/img/gallery/2-medium.jpeg +0 -0
  77. package/projects/gallery-app/src/assets/img/gallery/2-small.jpeg +0 -0
  78. package/projects/gallery-app/src/assets/img/gallery/3-big.jpeg +0 -0
  79. package/projects/gallery-app/src/assets/img/gallery/3-medium.jpeg +0 -0
  80. package/projects/gallery-app/src/assets/img/gallery/3-small.jpeg +0 -0
  81. package/projects/gallery-app/src/assets/img/gallery/4-big.jpeg +0 -0
  82. package/projects/gallery-app/src/assets/img/gallery/4-medium.jpeg +0 -0
  83. package/projects/gallery-app/src/assets/img/gallery/4-small.jpeg +0 -0
  84. package/projects/gallery-app/src/assets/img/gallery/5-big.jpeg +0 -0
  85. package/projects/gallery-app/src/assets/img/gallery/5-medium.jpeg +0 -0
  86. package/projects/gallery-app/src/assets/img/gallery/5-small.jpeg +0 -0
  87. package/projects/gallery-app/src/assets/img/gallery/6-big.jpeg +0 -0
  88. package/projects/gallery-app/src/assets/img/gallery/6-medium.jpeg +0 -0
  89. package/projects/gallery-app/src/assets/img/gallery/6-small.jpeg +0 -0
  90. package/projects/gallery-app/src/assets/img/gallery/7-big.jpeg +0 -0
  91. package/projects/gallery-app/src/assets/img/gallery/7-medium.jpeg +0 -0
  92. package/projects/gallery-app/src/assets/img/gallery/7-small.jpeg +0 -0
  93. package/projects/gallery-app/src/assets/img/gallery/8-big.jpeg +0 -0
  94. package/projects/gallery-app/src/assets/img/gallery/8-medium.jpeg +0 -0
  95. package/projects/gallery-app/src/assets/img/gallery/8-small.jpeg +0 -0
  96. package/projects/gallery-app/src/environments/environment.prod.ts +3 -0
  97. package/projects/gallery-app/src/environments/environment.ts +16 -0
  98. package/projects/gallery-app/src/favicon.ico +0 -0
  99. package/projects/gallery-app/src/index.html +13 -0
  100. package/projects/gallery-app/src/main.ts +12 -0
  101. package/projects/gallery-app/src/polyfills.ts +53 -0
  102. package/projects/gallery-app/src/styles.scss +1 -0
  103. package/projects/gallery-app/src/test.ts +16 -0
  104. package/projects/gallery-app/tsconfig.app.json +17 -0
  105. package/projects/gallery-app/tsconfig.spec.json +18 -0
  106. package/tsconfig.json +43 -0
package/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ max_line_length = off
13
+ trim_trailing_whitespace = false
package/.eslintrc.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "root": true,
3
+ "ignorePatterns": [
4
+ "projects/**/*"
5
+ ],
6
+ "overrides": [
7
+ {
8
+ "files": [
9
+ "*.ts"
10
+ ],
11
+ "parserOptions": {
12
+ "project": [
13
+ "tsconfig.json",
14
+ "e2e/tsconfig.json"
15
+ ],
16
+ "createDefaultProgram": true
17
+ },
18
+ "extends": [
19
+ "plugin:@angular-eslint/recommended",
20
+ "plugin:@angular-eslint/template/process-inline-templates"
21
+ ],
22
+ "rules": {
23
+ "@angular-eslint/component-selector": [
24
+ "error",
25
+ {
26
+ "prefix": "app",
27
+ "style": "kebab-case",
28
+ "type": "element"
29
+ }
30
+ ],
31
+ "@angular-eslint/directive-selector": [
32
+ "error",
33
+ {
34
+ "prefix": "app",
35
+ "style": "camelCase",
36
+ "type": "attribute"
37
+ }
38
+ ]
39
+ }
40
+ },
41
+ {
42
+ "files": [
43
+ "*.html"
44
+ ],
45
+ "extends": [
46
+ "plugin:@angular-eslint/template/recommended"
47
+ ],
48
+ "rules": {}
49
+ }
50
+ ]
51
+ }
package/.travis.yml ADDED
@@ -0,0 +1,38 @@
1
+ os: linux
2
+ language: node_js
3
+ node_js:
4
+ - "16"
5
+ dist: trusty
6
+ addons:
7
+ chrome: stable
8
+ cache:
9
+ directories:
10
+ - node_modules
11
+ before_install:
12
+ - npm update
13
+ install:
14
+ - npm install
15
+ before_script:
16
+ - npm install -g @angular/cli
17
+ - npm install -g codecov
18
+ script:
19
+ - npm run lint:lib
20
+ - npm run test-ci
21
+ - codecov
22
+ - npm run build:lib
23
+ after_script:
24
+ - cat ./coverage/gallery/lcov.info | coveralls
25
+ before_deploy:
26
+ - npm run copy:readme
27
+ - npm run copy:changelog
28
+ - npm run copy:license
29
+ - cd dist/gallery
30
+ deploy:
31
+ provider: npm
32
+ email: a.kolkov@gmail.com
33
+ api_token: $NPM_TOKEN
34
+ tag: latest
35
+ edge: true
36
+ on:
37
+ tags: true
38
+ repo: kolkov/ngx-gallery
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ <a name="2.0.0"></a>
2
+ # 2.0.0 (2022-01-06)
3
+
4
+ * Update to Angular v13 and new Ivy package format
5
+
6
+ <a name="1.0.11"></a>
7
+ # 1.0.11 (2020-03-05)
8
+
9
+ * Need to add ngx-gallery class to CSS documentation #8
10
+ * Unable to get custom icons to work #6
11
+ * Mention about original lib #7
12
+
13
+ <a name="1.0.0"></a>
14
+ # 1.0.0 (2019-11-24)
15
+
16
+ * Initial release
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Andrey Kolkov
4
+ Copyright (c) 2017-2018 Łukasz Gałka
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,296 @@
1
+ # @autotaxatiepartners/ngx-gallery
2
+
3
+ A simple native gallery component for Angular 13+ to 20+.
4
+
5
+ ## Getting Started
6
+
7
+ ### Installation
8
+
9
+ ```bash
10
+ npm install @autotaxatiepartners/ngx-gallery --save
11
+ ```
12
+
13
+ ### Usage
14
+
15
+ Import `NgxGalleryModule` in your Angular app:
16
+
17
+ ```ts
18
+ import { HttpClientModule } from '@angular/common/http';
19
+ import { NgxGalleryModule } from '@autotaxatiepartners/ngx-gallery';
20
+
21
+ @NgModule({
22
+ imports: [HttpClientModule, NgxGalleryModule]
23
+ })
24
+ export class AppModule {}
25
+ ```
26
+
27
+ Use in a component template:
28
+
29
+ ```html
30
+ <ngx-gallery [options]="galleryOptions" [images]="galleryImages" class="ngx-gallery"></ngx-gallery>
31
+ ```
32
+
33
+ Add a global style (optional):
34
+
35
+ ```scss
36
+ .ngx-gallery {
37
+ display: inline-block;
38
+ margin-bottom: 20px;
39
+ }
40
+ ```
41
+
42
+ ### Example Component
43
+ ``` ts
44
+ import {Component, OnInit} from '@angular/core';
45
+ import {NgxGalleryOptions} from '@autotaxatiepartners/ngx-gallery';
46
+ import {NgxGalleryImage} from '@autotaxatiepartners/ngx-gallery';
47
+ import {NgxGalleryAnimation} from '@autotaxatiepartners/ngx-gallery';
48
+
49
+ @Component({
50
+ selector: 'app-root',
51
+ templateUrl: './app.component.html',
52
+ styleUrls: ['./app.component.scss']
53
+ })
54
+ export class AppComponent implements OnInit{
55
+ galleryOptions: NgxGalleryOptions[];
56
+ galleryImages: NgxGalleryImage[];
57
+
58
+ constructor() { }
59
+
60
+ ngOnInit() {
61
+ this.galleryOptions = [
62
+ {
63
+ width: '600px',
64
+ height: '400px',
65
+ thumbnailsColumns: 4,
66
+ imageAnimation: NgxGalleryAnimation.Slide
67
+ },
68
+ // max-width 800
69
+ {
70
+ breakpoint: 800,
71
+ width: '100%',
72
+ height: '600px',
73
+ imagePercent: 80,
74
+ thumbnailsPercent: 20,
75
+ thumbnailsMargin: 20,
76
+ thumbnailMargin: 20
77
+ },
78
+ // max-width 400
79
+ {
80
+ breakpoint: 400,
81
+ preview: false
82
+ }
83
+ ];
84
+
85
+ this.galleryImages = [
86
+ {
87
+ small: 'assets/img/gallery/1-small.jpeg',
88
+ medium: 'assets/img/gallery/1-medium.jpeg',
89
+ big: 'assets/img/gallery/1-big.jpeg'
90
+ },
91
+ {
92
+ small: 'assets/img/gallery/2-small.jpeg',
93
+ medium: 'assets/img/gallery/2-medium.jpeg',
94
+ big: 'assets/img/gallery/2-big.jpeg'
95
+ },
96
+ {
97
+ small: 'assets/img/gallery/3-small.jpeg',
98
+ medium: 'assets/img/gallery/3-medium.jpeg',
99
+ big: 'assets/img/gallery/3-big.jpeg'
100
+ },{
101
+ small: 'assets/img/gallery/4-small.jpeg',
102
+ medium: 'assets/img/gallery/4-medium.jpeg',
103
+ big: 'assets/img/gallery/4-big.jpeg'
104
+ },
105
+ {
106
+ small: 'assets/img/gallery/5-small.jpeg',
107
+ medium: 'assets/img/gallery/5-medium.jpeg',
108
+ big: 'assets/img/gallery/5-big.jpeg'
109
+ }
110
+ ];
111
+ }
112
+ }
113
+ ```
114
+ add this class to app CSS `.ngx-gallery { display: inline-block; margin-bottom: 20px; }`
115
+
116
+ ## API
117
+ ### Inputs
118
+ | Input | Type | Default | Required | Description |
119
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
120
+ | [options] | `NgxGalleryOptions[]` | `-` | no | Config options for the Gallery |
121
+ | [images] | `NgxGalleryImage[]` | `-` | no | Images array |
122
+
123
+ ### Outputs
124
+
125
+ | Output | Description |
126
+ | ------------- | ------------- |
127
+ | (change) | Triggered on image change |
128
+ | (imagesReady) | Triggered when images length > 0 |
129
+ | (previewOpen) | Triggered on preview open |
130
+ | (previewClose) | Triggered on preview close |
131
+ | (previewChange) | Triggered on preview image change |
132
+
133
+ ### Methods
134
+
135
+ Name | Description |
136
+ | ------------- | ------------- |
137
+ | show(index: number): void | Shows image at index |
138
+ | showNext(): void | Shows next image |
139
+ | showPrev(): void | Shows prev image |
140
+ | canShowNext(): boolean | Returns true if there is next image |
141
+ | canShowPrev(): boolean | Returns true if there is prev image |
142
+ | openPreview(index: number): void | Opens preview at index |
143
+ | moveThumbnailsLeft(): void | Moves thumbnails to left |
144
+ | moveThumbnailsRight(): void | Moves thumbnails to right |
145
+ | canMoveThumbnailsLeft(): boolean | Returns true if you can move thumbnails to left |
146
+ | canMoveThumbnailsRight(): boolean | Returns true if you can move thumbnails to right |
147
+
148
+ ### NgxGalleryOptions
149
+ #### Layout options
150
+ | Input | Type | Default | Required | Description |
151
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
152
+ | width | `string` | `500px` | no | Gallery width |
153
+ | height | `string` | `400px` | no | Gallery height |
154
+ | breakpoint | `number` | `undefined` | no | Responsive breakpoint, works like media query max-width |
155
+ | fullWidth | `bolean` | `false` | no | Sets the same width as browser |
156
+ | layout | `string` | `NgxGalleryLayout.Bottom` | no | Sets thumbnails position |
157
+ | startIndex | `number` | `0` | no | Sets index of selected image on start |
158
+ | linkTarget | `string` | `_blank` | no | Sets target attribute of link |
159
+ | lazyLoading | `boolean` | `true` | no | Enables/disables lazy loading for images |
160
+
161
+ #### Image options
162
+ | Input | Type | Default | Required | Description |
163
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
164
+ | image | `boolean` | `true` | no | Enables or disables image |
165
+ | imageDescription | `boolean` | `true` | no | Enables or disables description for images |
166
+ | imagePercent | `number` | `75` | no | Percentage height |
167
+ | imageArrows | `boolean` | `true` | no | Enables or disables arrows |
168
+ | imageArrowsAutoHide | `boolean` | `false` | no | Enables or disables arrows auto hide |
169
+ | imageSwipe | `boolean` | `false` | no | Enables or disables swipe |
170
+ | imageAnimation | `string` | `NgxGalleryAnimation.Fade` | no | Animation type |
171
+ | imageSize | `string` | `NgxGalleryImageSize.Cover` | no | Image size |
172
+ | imageAutoPlay | `boolean` | `false` | no | Enables or disables auto play |
173
+ | imageAutoPlayInterval | `number` | `2000` | no | Interval for auto play (ms) |
174
+ | imageAutoPlayPauseOnHover | `boolean` | `false` | no | Enables or disables pause auto play on hover |
175
+ | imageInfinityMove | `boolean` | `false` | no | Enables or disables infinity move by arrows |
176
+ | imageActions | `NgxGalleryAction[]` | `[]` | no | Enables or disables navigation bullets |
177
+
178
+ #### Thumbnails options
179
+ | Input | Type | Default | Required | Description |
180
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
181
+ | thumbnails | `boolean` | `true` | no | Enables or disables thumbnails |
182
+ | thumbnailsColumns | `number` | `4` | no | Columns count |
183
+ | thumbnailsRows | `number` | `1` | no | Rows count |
184
+ | thumbnailsPercent | `number` | `25` | no | Percentage height |
185
+ | thumbnailsMargin | `number` | `10` | no | Margin between thumbnails and image |
186
+ | thumbnailsArrows | `boolean` | `true` | no | Enables or disables arrows |
187
+ | thumbnailsArrowsAutoHide | `boolean` | `false` | no | Enables or disables arrows auto hide |
188
+ | thumbnailsSwipe | `boolean` | `false` | no | Enables or disables swipe |
189
+ | thumbnailsMoveSize | `number` | `1` | no | Number of items to move on arrow click |
190
+ | thumbnailsOrder | `number` | `NgxGalleryOrder.Column` | no | Images order |
191
+ | thumbnailsRemainingCount | `boolean` | `false` | no | If true arrows are disabled and last item has label with remaining count |
192
+ | thumbnailsAsLinks | `boolean` | `false` | no | Enables or disables links on thumbnails |
193
+ | thumbnailsAutoHide | `boolean` | `false` | no | Hides thumbnails if there is only one image |
194
+ | thumbnailMargin | `number` | `10` | no | Margin between images in thumbnails |
195
+ | thumbnailSize | `string` | `NgxGalleryImageSize.Cover` | no | Thumbnail size |
196
+ | thumbnailActions | `NgxGalleryAction[]` | `[]` | no | Array of custom actions |
197
+ | thumbnailClasses | `string[]` | `[]` | no | Custom classes to add to thumbnail component |
198
+
199
+
200
+ #### Preview options
201
+ | Input | Type | Default | Required | Description |
202
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
203
+ | preview | `boolean` | `true` | no | Enables or disables preview |
204
+ | previewDescription | `boolean` | `true` | no | Enables or disables description for images |
205
+ | previewArrows | `boolean` | `true` | no | Enables or disables arrows |
206
+ | previewArrowsAutoHide | boolean: `string` | `false` | no | Enables or disables arrows auto hide |
207
+ | previewSwipe | `boolean` | `false` | no | Enables or disables swipe |
208
+ | previewFullscreen | `boolean` | `false` | no | Enables or disables fullscreen icon |
209
+ | previewForceFullscreen | `boolean` | `false` | no | Enables or disables opening preview in fullscreen mode |
210
+ | previewCloseOnClick | `boolean` | `false` | no | Enables or disables closing preview by click |
211
+ | previewCloseOnEsc | `boolean` | `false` | no | Enables or disables closing preview by esc keyboard |
212
+ | previewKeyboardNavigation | `boolean` | `false` | no | Enables or disables navigation by keyboard |
213
+ | previewAnimation | `boolean` | `true` | no | Enables or disables image loading animation |
214
+ | previewAutoPlay | `boolean` | `false` | no | Enables or disables auto play |
215
+ | previewAutoPlayInterval | `number` | `2000` | no | Interval for auto play (ms) |
216
+ | previewAutoPlayPauseOnHover | `boolean` | `false` | no | Enables or disables pouse auto play on hover |
217
+ | previewInfinityMove | `boolean` | `false` | no | Enables or disables infinity move by arrows |
218
+ | previewZoom | `boolean` | `false` | no | Enables or disables zoom in and zoom out |
219
+ | previewZoomStep | `number` | `0.1` | no | Step for zoom change |
220
+ | previewZoomMax | `number` | `2` | no | Max value for zoom |
221
+ | previewZoomMin | `number` | `0.5` | no | Min value for zoom |
222
+ | previewRotate | `boolean` | `false` | no | Enables or disables rotate buttons |
223
+ | previewDownload | `boolean` | `false` | no | Enables or disables download button |
224
+ | previewBullets | `boolean` | `false` | no | Enables or disables navigation bullets |
225
+
226
+ #### Icons options
227
+
228
+ | Input | Type | Default | Required | Description |
229
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
230
+ | arrowPrevIcon | `string` | `'fa fa-arrow-circle-left'` | no | Icon for prev arrow |
231
+ | arrowNextIcon | `string` | `'fa fa-arrow-circle-right'` | no | Icon for next arrow |
232
+ | closeIcon | `string` | `'fa fa-times-circle'` | no | Icon for close button |
233
+ | fullscreenIcon | `string` | `'fa fa-arrows-alt'` | no | Icon for fullscreen button |
234
+ | spinnerIcon | `string` | `'fa fa-spinner fa-pulse fa-3x fa-fw'` | no | Icon for spinner |
235
+ | zoomInIcon | `string` | `'fa fa-search-plus'` | no | Icon for zoom in |
236
+ | zoomOutIcon | `string` | `'fa fa-search-minus'` | no | Icon for zoom out |
237
+ | rotateLeftIcon | `string` | `'fa fa-undo'` | no | Icon for rotate left |
238
+ | rotateRightIcon | `string` | `'fa fa-repeat'` | no | Icon for rotate right |
239
+ | downloadIcon | `string` | `'fa fa-arrow-circle-down'` | no | Icon for download |
240
+ | actions | `NgxGalleryAction[]` | `[]` | no | Array of new custom actions that will be added to the left of the current close/zoom/fullscreen icons |
241
+
242
+ ### NgxGalleryImage
243
+
244
+ | Input | Type | Default | Required | Description |
245
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
246
+ | small | `string/SafeResourceUrl` | `-` | no | Url used in thumbnails |
247
+ | medium | `string/SafeResourceUrl` | `-` | no | Url used in image |
248
+ | big | `string/SafeResourceUrl` | `-` | yes | Url used in preview |
249
+ | description | `string` | `-` | no | Description used in preview |
250
+ | url | `string` | `-` | no | Url used in link |
251
+ | label | `string` | `-` | no | Label used for aria-label when thumbnail is a link |
252
+
253
+ ### NgxGalleryAnimation
254
+ - `Fade` (default)
255
+ - `Slide`
256
+ - `Rotate`
257
+ - `Zoom`
258
+
259
+ ### NgxGalleryImageSize
260
+ - `Cover` (default)
261
+ - `Contain`
262
+
263
+ ### NgxGalleryLayout
264
+ - `Top`
265
+ - `Bottom` (default)
266
+
267
+ ### NgxGalleryOrder
268
+ - `Column` (default)
269
+ - `Row`
270
+ - `Page`
271
+
272
+ ### NgxGalleryAction
273
+ - `icon` | Type: `string` - icon for custom action
274
+ - `disabled` | Type: `boolean` | Default value: `false` - if the icon should be disabled
275
+ - `titleText` | Type: `string` | Default value: `''` - text to set the title attribute to
276
+ - `onClick` | Type: `(event: Event, index: number) => void` - Output function to call when custom action icon is clicked
277
+
278
+ ## What's included
279
+
280
+ Within the download you'll find the following directories and files. You'll see something like this:
281
+
282
+ ```
283
+ ngx-gallery/
284
+ └── projects/
285
+ ├── gallery/
286
+ └── gallery-app/
287
+ ```
288
+ `gallery/` - library
289
+
290
+ `gallery-app/` - demo application
291
+
292
+ ## API Documentation
293
+
294
+ This component exposes configuration options via `[options]`, accepts images via `[images]`, and emits events such as `(change)` or `(previewOpen)`.
295
+
296
+ See full documentation at: https://github.com/autotaxatiepartners/ngx-gallery
package/angular.json ADDED
@@ -0,0 +1,108 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "@autotaxatiepartners/ngx-gallery": {
7
+ "projectType": "library",
8
+ "root": "projects/gallery",
9
+ "sourceRoot": "projects/gallery/src",
10
+ "architect": {
11
+ "build": {
12
+ "builder": "@angular-devkit/build-angular:ng-packagr",
13
+ "options": {
14
+ "tsConfig": "projects/gallery/tsconfig.lib.json",
15
+ "project": "projects/gallery/ng-package.json"
16
+ },
17
+ "configurations": {
18
+ "production": {
19
+ "tsConfig": "projects/gallery/tsconfig.lib.prod.json"
20
+ }
21
+ }
22
+ },
23
+ "test": {
24
+ "builder": "@angular-devkit/build-angular:karma",
25
+ "options": {
26
+ "main": "projects/gallery/src/test.ts",
27
+ "tsConfig": "projects/gallery/tsconfig.spec.json",
28
+ "karmaConfig": "projects/gallery/karma.conf.js"
29
+ }
30
+ }
31
+ }
32
+ },
33
+ "gallery-app": {
34
+ "projectType": "application",
35
+ "root": "projects/gallery-app",
36
+ "sourceRoot": "projects/gallery-app/src",
37
+ "prefix": "app",
38
+ "architect": {
39
+ "build": {
40
+ "builder": "@angular-devkit/build-angular:application",
41
+ "options": {
42
+ "outputPath": "dist/gallery-app",
43
+ "index": "projects/gallery-app/src/index.html",
44
+ "polyfills": [
45
+ "projects/gallery-app/src/polyfills.ts"
46
+ ],
47
+ "tsConfig": "projects/gallery-app/tsconfig.app.json",
48
+ "assets": [
49
+ "projects/gallery-app/src/favicon.ico",
50
+ "projects/gallery-app/src/assets"
51
+ ],
52
+ "styles": [
53
+ "node_modules/@fortawesome/fontawesome-free/css/all.css",
54
+ "projects/gallery-app/src/styles.scss"
55
+ ],
56
+ "scripts": []
57
+ },
58
+ "configurations": {
59
+ "production": {
60
+ "fileReplacements": [
61
+ {
62
+ "replace": "projects/gallery-app/src/environments/environment.ts",
63
+ "with": "projects/gallery-app/src/environments/environment.prod.ts"
64
+ }
65
+ ],
66
+ "optimization": true,
67
+ "outputHashing": "all",
68
+ "sourceMap": false,
69
+ "namedChunks": false,
70
+ "extractLicenses": true
71
+ }
72
+ }
73
+ },
74
+ "serve": {
75
+ "builder": "@angular-devkit/build-angular:dev-server",
76
+ "options": {
77
+ "buildTarget": "gallery-app:build"
78
+ },
79
+ "configurations": {
80
+ "production": {
81
+ "buildTarget": "gallery-app:build:production"
82
+ }
83
+ }
84
+ },
85
+ "test": {
86
+ "builder": "@angular-devkit/build-angular:karma",
87
+ "options": {
88
+ "main": "projects/gallery-app/src/test.ts",
89
+ "polyfills": "projects/gallery-app/src/polyfills.ts",
90
+ "tsConfig": "projects/gallery-app/tsconfig.spec.json",
91
+ "karmaConfig": "projects/gallery-app/karma.conf.js",
92
+ "assets": [
93
+ "projects/gallery-app/src/favicon.ico",
94
+ "projects/gallery-app/src/assets"
95
+ ],
96
+ "styles": [
97
+ "projects/gallery-app/src/styles.scss"
98
+ ],
99
+ "scripts": []
100
+ }
101
+ }
102
+ }
103
+ }
104
+ },
105
+ "cli": {
106
+ "analytics": false
107
+ }
108
+ }
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@autotaxatiepartners/ngx-gallery",
3
+ "version": "1.0.0",
4
+ "scripts": {
5
+ "ng": "ng",
6
+ "start": "ng serve",
7
+ "build": "ng build",
8
+ "build:prod": "ng build --configuration production",
9
+ "test": "ng test",
10
+ "lint": "ng lint @autotaxatiepartners/ngx-gallery",
11
+ "e2e": "ng e2e",
12
+ "build:watch": "ng build @autotaxatiepartners/ngx-gallery --watch",
13
+ "build:lib": "ng build @autotaxatiepartners/ngx-gallery --configuration production",
14
+ "test:lib": "ng test @autotaxatiepartners/ngx-gallery",
15
+ "test:ci": "ng test @autotaxatiepartners/ngx-gallery --code-coverage --no-watch --no-progress --browser ChromeHeadless",
16
+ "publish:lib": "npm run copy:readme && npm run copy:changelog && npm run copy:license && npm publish ./dist/gallery",
17
+ "copy:readme": "cpx README.md dist/gallery",
18
+ "copy:changelog": "cpx CHANGELOG.md dist/gallery",
19
+ "copy:license": "cpx LICENSE dist/gallery"
20
+ },
21
+ "private": false,
22
+ "dependencies": {
23
+ "@angular/animations": "^20.0.4",
24
+ "@angular/common": "^20.0.4",
25
+ "@angular/compiler": "^20.0.4",
26
+ "@angular/core": "^20.0.4",
27
+ "@angular/forms": "^20.0.4",
28
+ "@angular/platform-browser": "^20.0.4",
29
+ "@angular/platform-browser-dynamic": "^20.0.4",
30
+ "@angular/router": "^20.0.4",
31
+ "@fortawesome/fontawesome-free": "^6.7.2",
32
+ "karma-viewport": "^1.0.8",
33
+ "rxjs": "^6.5.4",
34
+ "tslib": "^2.3.1",
35
+ "zone.js": "~0.15.1"
36
+ },
37
+ "devDependencies": {
38
+ "@angular-devkit/build-angular": "^20.0.3",
39
+ "@angular-eslint/builder": "20.1.0",
40
+ "@angular-eslint/eslint-plugin": "20.1.0",
41
+ "@angular-eslint/eslint-plugin-template": "20.1.0",
42
+ "@angular-eslint/schematics": "20.1.0",
43
+ "@angular-eslint/template-parser": "20.1.0",
44
+ "@angular/cli": "^20.0.3",
45
+ "@angular/compiler-cli": "^20.0.4",
46
+ "@angular/language-service": "^20.0.4",
47
+ "@types/jasmine": "~3.10.2",
48
+ "@types/jasminewd2": "~2.0.10",
49
+ "@types/node": "^12.11.2",
50
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
51
+ "@typescript-eslint/parser": "^7.2.0",
52
+ "coveralls": "^3.1.1",
53
+ "cpx": "^1.5.0",
54
+ "eslint": "^8.57.0",
55
+ "jasmine-core": "~3.10.1",
56
+ "jasmine-spec-reporter": "~7.0.0",
57
+ "karma": "~6.3.8",
58
+ "karma-chrome-launcher": "~3.1.0",
59
+ "karma-coverage": "~2.0.3",
60
+ "karma-jasmine": "~4.0.1",
61
+ "karma-jasmine-html-reporter": "^1.7.0",
62
+ "ng-packagr": "^20.0.1",
63
+ "protractor": "~7.0.0",
64
+ "ts-node": "~10.4.0",
65
+ "typescript": "5.8.3"
66
+ },
67
+ "repository": {
68
+ "type": "git",
69
+ "url": "https://gitlab.com/autotaxatiepartners/ngx-gallery.git"
70
+ }
71
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "extends": "../../.eslintrc.json",
3
+ "ignorePatterns": [
4
+ "!**/*"
5
+ ],
6
+ "overrides": [
7
+ {
8
+ "files": [
9
+ "*.ts"
10
+ ],
11
+ "parserOptions": {
12
+ "project": [
13
+ "projects/gallery/tsconfig.lib.json",
14
+ "projects/gallery/tsconfig.spec.json"
15
+ ],
16
+ "createDefaultProgram": true
17
+ },
18
+ "rules": {
19
+ "@angular-eslint/component-selector": [
20
+ "error",
21
+ {
22
+ "type": "element",
23
+ "prefix": "ngx",
24
+ "style": "kebab-case"
25
+ }
26
+ ],
27
+ "@angular-eslint/directive-selector": [
28
+ "error",
29
+ {
30
+ "type": "attribute",
31
+ "prefix": "ngx",
32
+ "style": "camelCase"
33
+ }
34
+ ],
35
+ "@typescript-eslint/explicit-member-accessibility": [
36
+ "off",
37
+ {
38
+ "accessibility": "explicit"
39
+ }
40
+ ],
41
+ "arrow-parens": [
42
+ "off",
43
+ "always"
44
+ ],
45
+ "import/order": "off"
46
+ }
47
+ },
48
+ {
49
+ "files": [
50
+ "*.html"
51
+ ],
52
+ "rules": {}
53
+ }
54
+ ]
55
+ }