@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
@@ -0,0 +1,32 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function (config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage-istanbul-reporter'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
17
+ },
18
+ coverageIstanbulReporter: {
19
+ dir: require('path').join(__dirname, '../../coverage/gallery-app'),
20
+ reports: ['html', 'lcovonly', 'text-summary'],
21
+ fixWebpackSourcePaths: true
22
+ },
23
+ reporters: ['progress', 'kjhtml'],
24
+ port: 9876,
25
+ colors: true,
26
+ logLevel: config.LOG_INFO,
27
+ autoWatch: true,
28
+ browsers: ['Chrome'],
29
+ singleRun: false,
30
+ restartOnFileChange: true
31
+ });
32
+ };
@@ -0,0 +1,11 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { Routes, RouterModule } from '@angular/router';
3
+
4
+
5
+ const routes: Routes = [];
6
+
7
+ @NgModule({
8
+ imports: [RouterModule.forRoot(routes)],
9
+ exports: [RouterModule]
10
+ })
11
+ export class AppRoutingModule { }
@@ -0,0 +1,4 @@
1
+ <div class="gallery-wrapper">
2
+ <h1>Autotaxatie Partners Gallery Demo</h1>
3
+ <ngx-gallery [options]="galleryOptions" [images]="galleryImages" class="ngx-gallery"></ngx-gallery>
4
+ </div>
@@ -0,0 +1,9 @@
1
+ .gallery-wrapper {
2
+ text-align: center;
3
+ margin-top: 50px;
4
+ .ngx-gallery {
5
+ display: inline-block;
6
+ margin-bottom: 20px;
7
+ }
8
+ }
9
+
@@ -0,0 +1,35 @@
1
+ import { TestBed, async } from '@angular/core/testing';
2
+ import { RouterTestingModule } from '@angular/router/testing';
3
+ import { AppComponent } from './app.component';
4
+
5
+ describe('AppComponent', () => {
6
+ beforeEach(async(() => {
7
+ TestBed.configureTestingModule({
8
+ imports: [
9
+ RouterTestingModule
10
+ ],
11
+ declarations: [
12
+ AppComponent
13
+ ],
14
+ }).compileComponents();
15
+ }));
16
+
17
+ it('should create the app', () => {
18
+ const fixture = TestBed.createComponent(AppComponent);
19
+ const app = fixture.componentInstance;
20
+ expect(app).toBeTruthy();
21
+ });
22
+
23
+ it(`should have as title 'gallery-app'`, () => {
24
+ const fixture = TestBed.createComponent(AppComponent);
25
+ const app = fixture.componentInstance;
26
+ expect(app.title).toEqual('gallery-app');
27
+ });
28
+
29
+ it('should render title', () => {
30
+ const fixture = TestBed.createComponent(AppComponent);
31
+ fixture.detectChanges();
32
+ const compiled = fixture.nativeElement;
33
+ expect(compiled.querySelector('.content span').textContent).toContain('gallery-app app is running!');
34
+ });
35
+ });
@@ -0,0 +1,76 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+ import { NgxGalleryOptions } from '@autotaxatiepartners/ngx-gallery';
3
+ import { NgxGalleryImage } from '@autotaxatiepartners/ngx-gallery';
4
+ import { NgxGalleryAnimation } from '@autotaxatiepartners/ngx-gallery';
5
+
6
+ @Component({
7
+ selector: 'app-root',
8
+ templateUrl: './app.component.html',
9
+ styleUrls: ['./app.component.scss'],
10
+ standalone: false
11
+ })
12
+ export class AppComponent implements OnInit {
13
+ galleryOptions: NgxGalleryOptions[];
14
+ galleryImages: NgxGalleryImage[];
15
+
16
+ constructor() { }
17
+
18
+ ngOnInit() {
19
+ this.galleryOptions = [
20
+ {
21
+ width: '600px',
22
+ height: '400px',
23
+ thumbnailsColumns: 4,
24
+ arrowPrevIcon: 'fa fa-chevron-left',
25
+ arrowNextIcon: 'fa fa-chevron-right',
26
+ imageAnimation: NgxGalleryAnimation.Slide,
27
+ imageSwipe: true
28
+ },
29
+ // max-width 800
30
+ {
31
+ breakpoint: 800,
32
+ width: '100%',
33
+ height: '600px',
34
+ imagePercent: 80,
35
+ thumbnailsPercent: 20,
36
+ thumbnailsMargin: 20,
37
+ thumbnailMargin: 20,
38
+ imageSwipe: true
39
+ },
40
+ // max-width 400
41
+ {
42
+ breakpoint: 400,
43
+ preview: false,
44
+ imageSwipe: true
45
+ }
46
+ ];
47
+
48
+ this.galleryImages = [
49
+ {
50
+ small: 'assets/img/gallery/1-small.jpeg',
51
+ medium: 'assets/img/gallery/1-medium.jpeg',
52
+ big: 'assets/img/gallery/1-big.jpeg'
53
+ },
54
+ {
55
+ small: 'assets/img/gallery/2-small.jpeg',
56
+ medium: 'assets/img/gallery/2-medium.jpeg',
57
+ big: 'assets/img/gallery/2-big.jpeg'
58
+ },
59
+ {
60
+ small: 'assets/img/gallery/3-small.jpeg',
61
+ medium: 'assets/img/gallery/3-medium.jpeg',
62
+ big: 'assets/img/gallery/3-big.jpeg'
63
+ },
64
+ {
65
+ small: 'assets/img/gallery/4-small.jpeg',
66
+ medium: 'assets/img/gallery/4-medium.jpeg',
67
+ big: 'assets/img/gallery/4-big.jpeg'
68
+ },
69
+ {
70
+ small: 'https://html5box.com/html5gallery/images/BigBuckBunny_1.mp4',
71
+ medium: 'https://html5box.com/html5gallery/images/BigBuckBunny_1.mp4',
72
+ big: 'https://html5box.com/html5gallery/images/BigBuckBunny_1.mp4'
73
+ }
74
+ ];
75
+ }
76
+ }
@@ -0,0 +1,21 @@
1
+ import { BrowserModule } from '@angular/platform-browser';
2
+ import { NgModule } from '@angular/core';
3
+
4
+ import { AppRoutingModule } from './app-routing.module';
5
+ import { AppComponent } from './app.component';
6
+ import {NgxGalleryModule} from '@autotaxatiepartners/ngx-gallery';
7
+
8
+
9
+ @NgModule({
10
+ declarations: [
11
+ AppComponent
12
+ ],
13
+ imports: [
14
+ BrowserModule,
15
+ NgxGalleryModule,
16
+ AppRoutingModule
17
+ ],
18
+ providers: [],
19
+ bootstrap: [AppComponent]
20
+ })
21
+ export class AppModule { }
File without changes
@@ -0,0 +1,3 @@
1
+ export const environment = {
2
+ production: true
3
+ };
@@ -0,0 +1,16 @@
1
+ // This file can be replaced during build by using the `fileReplacements` array.
2
+ // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3
+ // The list of file replacements can be found in `angular.json`.
4
+
5
+ export const environment = {
6
+ production: false
7
+ };
8
+
9
+ /*
10
+ * For easier debugging in development mode, you can import the following file
11
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
+ *
13
+ * This import should be commented out in production mode because it will have a negative impact
14
+ * on performance if an error is thrown.
15
+ */
16
+ // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Angular ngx-gallery demo application</title>
6
+ <base href="/">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
9
+ </head>
10
+ <body>
11
+ <app-root></app-root>
12
+ </body>
13
+ </html>
@@ -0,0 +1,12 @@
1
+ import { enableProdMode } from '@angular/core';
2
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
+
4
+ import { AppModule } from './app/app.module';
5
+ import { environment } from './environments/environment';
6
+
7
+ if (environment.production) {
8
+ enableProdMode();
9
+ }
10
+
11
+ platformBrowserDynamic().bootstrapModule(AppModule)
12
+ .catch(err => console.error(err));
@@ -0,0 +1,53 @@
1
+ /**
2
+ * This file includes polyfills needed by Angular and is loaded before the app.
3
+ * You can add your own extra polyfills to this file.
4
+ *
5
+ * This file is divided into 2 sections:
6
+ * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
+ * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
+ * file.
9
+ *
10
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
+ *
14
+ * Learn more in https://angular.io/guide/browser-support
15
+ */
16
+
17
+ /***************************************************************************************************
18
+ * BROWSER POLYFILLS
19
+ */
20
+
21
+ /**
22
+ * By default, zone.js will patch all possible macroTask and DomEvents
23
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
24
+ * because those flags need to be set before `zone.js` being loaded, and webpack
25
+ * will put import in the top of bundle, so user need to create a separate file
26
+ * in this directory (for example: zone-flags.ts), and put the following flags
27
+ * into that file, and then add the following code before importing zone.js.
28
+ * import './zone-flags.ts';
29
+ *
30
+ * The flags allowed in zone-flags.ts are listed here.
31
+ *
32
+ * The following flags will work for all browsers.
33
+ *
34
+ * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
35
+ * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
36
+ * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
37
+ *
38
+ * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
39
+ * with the following flag, it will bypass `zone.js` patch for IE/Edge
40
+ *
41
+ * (window as any).__Zone_enable_cross_context_check = true;
42
+ *
43
+ */
44
+
45
+ /***************************************************************************************************
46
+ * Zone JS is required by default for Angular itself.
47
+ */
48
+ import 'zone.js'; // Included with Angular CLI.
49
+
50
+
51
+ /***************************************************************************************************
52
+ * APPLICATION IMPORTS
53
+ */
@@ -0,0 +1 @@
1
+ /* You can add global styles to this file, and also import other style files */
@@ -0,0 +1,16 @@
1
+ // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+ import 'zone.js/testing';
4
+ import { getTestBed } from '@angular/core/testing';
5
+ import {
6
+ BrowserDynamicTestingModule,
7
+ platformBrowserDynamicTesting
8
+ } from '@angular/platform-browser-dynamic/testing';
9
+
10
+ // First, initialize the Angular testing environment.
11
+ getTestBed().initTestEnvironment(
12
+ BrowserDynamicTestingModule,
13
+ platformBrowserDynamicTesting(), {
14
+ teardown: { destroyAfterEach: false }
15
+ }
16
+ );
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../out-tsc/app",
5
+ "types": []
6
+ },
7
+ "files": [
8
+ "src/main.ts",
9
+ "src/polyfills.ts"
10
+ ],
11
+ "include": [
12
+ "src/**/*.d.ts"
13
+ ],
14
+ "angularCompilerOptions": {
15
+ "enableIvy": true
16
+ }
17
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../out-tsc/spec",
5
+ "types": [
6
+ "jasmine",
7
+ "node"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts",
12
+ "src/polyfills.ts"
13
+ ],
14
+ "include": [
15
+ "src/**/*.spec.ts",
16
+ "src/**/*.d.ts"
17
+ ]
18
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "compileOnSave": false,
3
+ "compilerOptions": {
4
+ "baseUrl": "./",
5
+ "outDir": "./dist/out-tsc",
6
+ "forceConsistentCasingInFileNames": true,
7
+ "esModuleInterop": true,
8
+ "noImplicitOverride": true,
9
+ "noPropertyAccessFromIndexSignature": true,
10
+ "noImplicitReturns": true,
11
+ "noFallthroughCasesInSwitch": true,
12
+ "sourceMap": true,
13
+ "declaration": false,
14
+ "experimentalDecorators": true,
15
+ "module": "es2020",
16
+ "moduleResolution": "bundler",
17
+ "importHelpers": true,
18
+ "target": "ES2022",
19
+ "typeRoots": [
20
+ "node_modules/@types"
21
+ ],
22
+ "lib": [
23
+ "es2020",
24
+ "dom"
25
+ ],
26
+ "paths": {
27
+ "@autotaxatiepartners/ngx-gallery": [
28
+ "dist/gallery"
29
+ ],
30
+ "@autotaxatiepartners/ngx-gallery/*": [
31
+ "dist/gallery/*"
32
+ ]
33
+ },
34
+ "useDefineForClassFields": false
35
+ },
36
+ "angularCompilerOptions": {
37
+ "fullTemplateTypeCheck": true,
38
+ "enableI18nLegacyMessageIdFormat": false,
39
+ "strictInjectionParameters": true,
40
+ "strictInputAccessModifiers": true,
41
+ "strictTemplates": true
42
+ }
43
+ }