@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,19 @@
1
+ import {SafeResourceUrl} from '@angular/platform-browser';
2
+
3
+ export interface INgxGalleryOrderedImage {
4
+ src: string | SafeResourceUrl;
5
+ type: string;
6
+ index: number;
7
+ }
8
+
9
+ export class NgxGalleryOrderedImage implements INgxGalleryOrderedImage {
10
+ src: string | SafeResourceUrl;
11
+ type: string;
12
+ index: number;
13
+
14
+ constructor(obj: INgxGalleryOrderedImage) {
15
+ this.src = obj.src;
16
+ this.type = obj.type;
17
+ this.index = obj.index;
18
+ }
19
+ }
@@ -0,0 +1,66 @@
1
+ @if (arrows) {
2
+ <ngx-gallery-arrows (prevClick)="showPrev()" (nextClick)="showNext()" [prevDisabled]="!canShowPrev()"
3
+ [nextDisabled]="!canShowNext()" [arrowPrevIcon]="arrowPrevIcon" [arrowNextIcon]="arrowNextIcon"></ngx-gallery-arrows>
4
+ }
5
+ <div class="ngx-gallery-preview-top">
6
+ <div class="ngx-gallery-preview-icons">
7
+ @for (action of actions; track action) {
8
+ <ngx-gallery-action [icon]="action.icon" [disabled]="action.disabled" [titleText]="action.titleText"
9
+ (closeClick)="action.onClick($event, index)"></ngx-gallery-action>
10
+ }
11
+ @if (download && src) {
12
+ <a [href]="src" class="ngx-gallery-icon" aria-hidden="true" download>
13
+ <i class="ngx-gallery-icon-content {{ downloadIcon }}"></i>
14
+ </a>
15
+ }
16
+ @if (zoom) {
17
+ <ngx-gallery-action [icon]="zoomOutIcon" [disabled]="!canZoomOut()" (closeClick)="zoomOut()"></ngx-gallery-action>
18
+ }
19
+ @if (zoom) {
20
+ <ngx-gallery-action [icon]="zoomInIcon" [disabled]="!canZoomIn()" (closeClick)="zoomIn()"></ngx-gallery-action>
21
+ }
22
+ @if (rotate) {
23
+ <ngx-gallery-action [icon]="rotateLeftIcon" (closeClick)="rotateLeft()"></ngx-gallery-action>
24
+ }
25
+ @if (rotate) {
26
+ <ngx-gallery-action [icon]="rotateRightIcon" (closeClick)="rotateRight()"></ngx-gallery-action>
27
+ }
28
+ @if (fullscreen) {
29
+ <ngx-gallery-action [icon]="'ngx-gallery-fullscreen ' + fullscreenIcon"
30
+ (closeClick)="manageFullscreen()"></ngx-gallery-action>
31
+ }
32
+ <ngx-gallery-action [icon]="'ngx-gallery-close ' + closeIcon" (closeClick)="close()"></ngx-gallery-action>
33
+ </div>
34
+ </div>
35
+ <div class="ngx-spinner-wrapper ngx-gallery-center" [class.ngx-gallery-active]="showSpinner">
36
+ <i class="ngx-gallery-icon ngx-gallery-spinner {{spinnerIcon}}" aria-hidden="true"></i>
37
+ </div>
38
+ <div class="ngx-gallery-preview-wrapper" (click)="closeOnClick && close()" (mouseup)="mouseUpHandler($event)"
39
+ (mousemove)="mouseMoveHandler($event)" (touchend)="mouseUpHandler($event)" (touchmove)="mouseMoveHandler($event)">
40
+ <div class="ngx-gallery-preview-img-wrapper">
41
+ @if (src && type === 'image') {
42
+ <img #previewImage class="ngx-gallery-preview-img ngx-gallery-center" [src]="src" (click)="$event.stopPropagation()"
43
+ (mouseenter)="imageMouseEnter()" (mouseleave)="imageMouseLeave()" (mousedown)="mouseDownHandler($event)"
44
+ (touchstart)="mouseDownHandler($event)" [class.ngx-gallery-active]="!loading" [class.animation]="animation"
45
+ [class.ngx-gallery-grab]="canDragOnZoom()" [style.transform]="getTransform()" [style.left]="positionLeft + 'px'"
46
+ [style.top]="positionTop + 'px'" />
47
+ }
48
+ @if (src && type === 'video') {
49
+ <video #previewImage controls style="width: 100%; height: 100%;" class="ngx-gallery-preview-img ngx-gallery-center"
50
+ (click)="$event.stopPropagation()" (mouseenter)="imageMouseEnter()" (mouseleave)="imageMouseLeave()"
51
+ (mousedown)="mouseDownHandler($event)" (touchstart)="mouseDownHandler($event)"
52
+ [class.ngx-gallery-active]="!loading" [class.animation]="animation" [class.ngx-gallery-grab]="canDragOnZoom()"
53
+ [style.transform]="getTransform()" [style.left]="positionLeft + 'px'" [style.top]="positionTop + 'px'">
54
+ <source [src]="src">
55
+ Your browser does not support the video tag.
56
+ </video>
57
+ }
58
+ @if (bullets) {
59
+ <ngx-gallery-bullets [count]="images.length" [active]="index"
60
+ (bulletChange)="showAtIndex($event)"></ngx-gallery-bullets>
61
+ }
62
+ </div>
63
+ @if (showDescription && description) {
64
+ <div class="ngx-gallery-preview-text" [innerHTML]="description" (click)="$event.stopPropagation()"></div>
65
+ }
66
+ </div>
@@ -0,0 +1,121 @@
1
+ :host {
2
+ &.ngx-gallery-active {
3
+ width: 100%;
4
+ height: 100%;
5
+ position: fixed;
6
+ left: 0;
7
+ top: 0;
8
+ background: rgba(0, 0, 0, 0.7);
9
+ z-index: 10000;
10
+ display: inline-block;
11
+ font-size: 50px!important;
12
+ }
13
+ }
14
+
15
+ :host {
16
+ display: none;
17
+ font-size: 50px!important;
18
+ .ngx-gallery-arrow {
19
+ font-size: 50px!important;
20
+ }
21
+ }
22
+
23
+ ngx-gallery-bullets {
24
+ height: 5%;
25
+ align-items: center;
26
+ padding: 0;
27
+ }
28
+
29
+ .ngx-gallery-preview-img {
30
+ opacity: 0;
31
+ max-width: 90%;
32
+ max-height: 90%;
33
+ user-select: none;
34
+ transition: transform .5s;
35
+
36
+ &.animation {
37
+ transition: opacity 0.5s linear, transform .5s;
38
+ }
39
+
40
+ &.ngx-gallery-active {
41
+ opacity: 1;
42
+ }
43
+
44
+ &.ngx-gallery-grab {
45
+ cursor: grab;
46
+ //cursor: -webkit-grab;
47
+ }
48
+ }
49
+
50
+ .ngx-gallery-icon.ngx-gallery-spinner {
51
+ font-size: 50px;
52
+ left: 0;
53
+ display: inline-block;
54
+ }
55
+
56
+ :host .ngx-gallery-preview-top {
57
+ position: absolute;
58
+ width: 100%;
59
+ user-select: none;
60
+ font-size: 25px;
61
+ }
62
+
63
+ /*:host*/ .ngx-gallery-preview-icons {
64
+ float: right;
65
+
66
+ .ngx-gallery-icon {
67
+ position: relative;
68
+ margin-right: 10px;
69
+ margin-top: 10px;
70
+ font-size: 25px;
71
+ cursor: pointer;
72
+ text-decoration: none;
73
+
74
+ &.ngx-gallery-icon-disabled {
75
+ cursor: default;
76
+ opacity: 0.4;
77
+ }
78
+ }
79
+ }
80
+
81
+ .ngx-spinner-wrapper {
82
+ width: 50px;
83
+ height: 50px;
84
+ display: none;
85
+
86
+ &.ngx-gallery-active {
87
+ display: inline-block;
88
+ }
89
+ }
90
+
91
+ .ngx-gallery-center {
92
+ position: absolute;
93
+ left: 0;
94
+ right: 0;
95
+ bottom: 0;
96
+ margin: auto;
97
+ top: 0;
98
+ }
99
+
100
+ .ngx-gallery-preview-text {
101
+ width: 100%;
102
+ background: rgba(0, 0, 0, 0.7);
103
+ padding: 10px;
104
+ text-align: center;
105
+ color: white;
106
+ font-size: 16px;
107
+ flex: 0 1 auto;
108
+ z-index: 10;
109
+ }
110
+
111
+ .ngx-gallery-preview-wrapper {
112
+ width: 100%;
113
+ height: 100%;
114
+ display: flex;
115
+ flex-flow: column;
116
+ }
117
+
118
+ .ngx-gallery-preview-img-wrapper {
119
+ flex: 1 1 auto;
120
+ position: relative;
121
+ }
@@ -0,0 +1,34 @@
1
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { NgxGalleryPreviewComponent } from './ngx-gallery-preview.component';
4
+ import {NgxGalleryArrowsComponent} from '../ngx-gallery-arrows/ngx-gallery-arrows.component';
5
+ import {NgxGalleryAction} from '../ngx-gallery-action';
6
+ import {ChangeDetectorRef, Renderer2} from '@angular/core';
7
+ import {DomSanitizer} from '@angular/platform-browser';
8
+ import {NgxGalleryService} from '../ngx-gallery.service';
9
+ import {NgxGalleryActionComponent} from '../ngx-gallery-action/ngx-gallery-action.component';
10
+ import {NgxGalleryBulletsComponent} from '../ngx-gallery-bullets/ngx-gallery-bullets.component';
11
+
12
+ describe('NgxGalleryPrevewComponent', () => {
13
+ let component: NgxGalleryPreviewComponent;
14
+ let fixture: ComponentFixture<NgxGalleryPreviewComponent>;
15
+
16
+ beforeEach(async(() => {
17
+ TestBed.configureTestingModule({
18
+ declarations: [ NgxGalleryPreviewComponent, NgxGalleryArrowsComponent, NgxGalleryActionComponent, NgxGalleryBulletsComponent],
19
+ imports: [],
20
+ providers: [Renderer2, DomSanitizer, NgxGalleryService, ChangeDetectorRef]
21
+ })
22
+ .compileComponents();
23
+ }));
24
+
25
+ beforeEach(() => {
26
+ fixture = TestBed.createComponent(NgxGalleryPreviewComponent);
27
+ component = fixture.componentInstance;
28
+ fixture.detectChanges();
29
+ });
30
+
31
+ it('should create', () => {
32
+ expect(component).toBeTruthy();
33
+ });
34
+ });