@mintplayer/ng-swiper 18.0.0 → 18.2.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 (44) hide show
  1. package/esm2022/index.mjs +2 -4
  2. package/esm2022/observe-size/index.mjs +3 -0
  3. package/esm2022/observe-size/mintplayer-ng-swiper-observe-size.mjs +5 -0
  4. package/esm2022/observe-size/src/observe-size.directive.mjs +51 -0
  5. package/esm2022/observe-size/src/size.mjs +2 -0
  6. package/esm2022/swiper/index.mjs +4 -0
  7. package/esm2022/swiper/mintplayer-ng-swiper-swiper.mjs +5 -0
  8. package/esm2022/swiper/src/directives/index.mjs +3 -0
  9. package/esm2022/swiper/src/directives/swipe/swipe.directive.mjs +105 -0
  10. package/esm2022/swiper/src/directives/swipe-container/swipe-container.directive.mjs +229 -0
  11. package/esm2022/swiper/src/interfaces/index.mjs +4 -0
  12. package/esm2022/swiper/src/interfaces/last-touch.mjs +2 -0
  13. package/esm2022/swiper/src/interfaces/point.mjs +2 -0
  14. package/esm2022/swiper/src/interfaces/start-touch.mjs +2 -0
  15. package/esm2022/swiper/src/swiper.module.mjs +19 -0
  16. package/fesm2022/mintplayer-ng-swiper-observe-size.mjs +58 -0
  17. package/fesm2022/mintplayer-ng-swiper-observe-size.mjs.map +1 -0
  18. package/fesm2022/mintplayer-ng-swiper-swiper.mjs +348 -0
  19. package/fesm2022/mintplayer-ng-swiper-swiper.mjs.map +1 -0
  20. package/fesm2022/mintplayer-ng-swiper.mjs +2 -343
  21. package/fesm2022/mintplayer-ng-swiper.mjs.map +1 -1
  22. package/index.d.ts +2 -3
  23. package/observe-size/index.d.ts +3 -0
  24. package/observe-size/src/observe-size.directive.d.ts +19 -0
  25. package/observe-size/src/size.d.ts +5 -0
  26. package/package.json +13 -1
  27. package/swiper/index.d.ts +4 -0
  28. package/{lib → swiper/src}/directives/index.d.ts +1 -0
  29. package/swiper/src/directives/swipe/swipe.directive.d.ts +18 -0
  30. package/{lib → swiper/src}/directives/swipe-container/swipe-container.directive.d.ts +7 -3
  31. package/{lib → swiper/src}/interfaces/index.d.ts +1 -0
  32. package/{lib → swiper/src}/interfaces/last-touch.d.ts +1 -0
  33. package/{lib → swiper/src}/interfaces/point.d.ts +1 -0
  34. package/{lib → swiper/src}/interfaces/start-touch.d.ts +1 -0
  35. package/{lib → swiper/src}/swiper.module.d.ts +1 -0
  36. package/esm2022/lib/directives/index.mjs +0 -3
  37. package/esm2022/lib/directives/swipe/swipe.directive.mjs +0 -119
  38. package/esm2022/lib/directives/swipe-container/swipe-container.directive.mjs +0 -216
  39. package/esm2022/lib/interfaces/index.mjs +0 -4
  40. package/esm2022/lib/interfaces/last-touch.mjs +0 -2
  41. package/esm2022/lib/interfaces/point.mjs +0 -2
  42. package/esm2022/lib/interfaces/start-touch.mjs +0 -2
  43. package/esm2022/lib/swiper.module.mjs +0 -19
  44. package/lib/directives/swipe/swipe.directive.d.ts +0 -21
@@ -0,0 +1,348 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Directive, Inject, HostBinding, ContentChildren, forwardRef, Input, Output, HostListener, NgModule } from '@angular/core';
3
+ import * as i2 from '@mintplayer/ng-swiper/observe-size';
4
+ import { BsObserveSizeDirective } from '@mintplayer/ng-swiper/observe-size';
5
+ import { combineLatest, map, delay, filter, mergeMap, debounceTime, BehaviorSubject, take } from 'rxjs';
6
+ import { DOCUMENT, CommonModule } from '@angular/common';
7
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
8
+ import * as i1 from '@angular/animations';
9
+ import { style, animate } from '@angular/animations';
10
+
11
+ class BsSwipeContainerDirective {
12
+ animationBuilder;
13
+ observeSize;
14
+ constructor(element, animationBuilder, document, observeSize) {
15
+ this.animationBuilder = animationBuilder;
16
+ this.observeSize = observeSize;
17
+ this.containerElement = element;
18
+ this.document = document;
19
+ this.offset$ = combineLatest([this.startTouch$, this.lastTouch$, this.imageIndex$, this.isViewInited$])
20
+ .pipe(map(([startTouch, lastTouch, imageIndex, isViewInited]) => {
21
+ if (!isViewInited) {
22
+ return (-imageIndex * 100);
23
+ }
24
+ else if (!!startTouch && !!lastTouch) {
25
+ return (-imageIndex * 100 + (lastTouch.position.x - startTouch.position.x) / this.containerElement.nativeElement.clientWidth * 100);
26
+ }
27
+ else {
28
+ return (-imageIndex * 100);
29
+ }
30
+ }));
31
+ this.padLeft$ = this.swipes$.pipe(map(swipes => {
32
+ if (!swipes) {
33
+ return 0;
34
+ }
35
+ let count = 0;
36
+ for (const s of swipes) {
37
+ if (!s.offside) {
38
+ break;
39
+ }
40
+ else {
41
+ count++;
42
+ }
43
+ }
44
+ return count;
45
+ }));
46
+ this.padRight$ = this.swipes$.pipe(map(swipes => {
47
+ if (!swipes) {
48
+ return 0;
49
+ }
50
+ let count = 0;
51
+ for (const s of swipes.toArray().reverse()) {
52
+ if (!s.offside) {
53
+ break;
54
+ }
55
+ else {
56
+ count++;
57
+ }
58
+ }
59
+ return count;
60
+ }));
61
+ this.offsetLeft$ = combineLatest([this.offset$, this.padLeft$])
62
+ .pipe(map(([offset, padLeft]) => offset - padLeft * 100));
63
+ this.offsetRight$ = combineLatest([this.offset$, this.padLeft$, this.padRight$])
64
+ .pipe(map(([offset, padLeft, padRight]) => -(offset - padLeft * 100) - (padRight - 1) * 100));
65
+ this.offsetLeft$.pipe(takeUntilDestroyed())
66
+ .subscribe(offsetLeft => this.offsetLeft = offsetLeft);
67
+ this.offsetRight$.pipe(takeUntilDestroyed())
68
+ .subscribe(offsetRight => this.offsetRight = offsetRight);
69
+ this.imageIndex$.pipe(takeUntilDestroyed())
70
+ .subscribe(imageIndex => this.imageIndexChange.emit(imageIndex));
71
+ this.actualSwipes$ = this.swipes$
72
+ .pipe(map(swipes => {
73
+ if (swipes) {
74
+ return swipes.filter(swipe => !swipe.offside);
75
+ }
76
+ else {
77
+ return [];
78
+ }
79
+ }));
80
+ this.slideSizes$ = this.actualSwipes$
81
+ .pipe(delay(400), filter(swipes => !!swipes))
82
+ .pipe(mergeMap(swipes => combineLatest(swipes.map(swipe => swipe.observeSize.size$))));
83
+ this.currentSlideHeight$ = combineLatest([this.slideSizes$, this.imageIndex$])
84
+ .pipe(map(([slideSizes, imageIndex]) => {
85
+ const maxHeight = Math.max(...slideSizes.map(s => s?.height ?? 1));
86
+ console.log('maxHeight', { maxHeight, slideSizes });
87
+ const currHeight = slideSizes[imageIndex]?.height ?? maxHeight;
88
+ // switch (orientation) {
89
+ // case 'horizontal':
90
+ return currHeight;
91
+ // case 'vertical':
92
+ // return maxHeight;
93
+ // }
94
+ }))
95
+ .pipe(debounceTime(10));
96
+ }
97
+ offsetLeft = null;
98
+ offsetRight = null;
99
+ offsetTop = null;
100
+ offsetBottom = null;
101
+ set swipes(value) {
102
+ setTimeout(() => this.swipes$.next(value));
103
+ }
104
+ minimumOffset = 50;
105
+ //#region ImageIndex
106
+ get imageIndex() {
107
+ return this.imageIndex$.value;
108
+ }
109
+ set imageIndex(value) {
110
+ this.imageIndex$.next(value);
111
+ }
112
+ imageIndexChange = new EventEmitter();
113
+ //#endregion
114
+ actualSwipes$;
115
+ isViewInited$ = new BehaviorSubject(false);
116
+ startTouch$ = new BehaviorSubject(null);
117
+ lastTouch$ = new BehaviorSubject(null);
118
+ swipes$ = new BehaviorSubject(null);
119
+ // TODO: slide sizes instead
120
+ slideSizes$;
121
+ imageIndex$ = new BehaviorSubject(0);
122
+ currentSlideHeight$;
123
+ pendingAnimation;
124
+ containerElement;
125
+ document;
126
+ // TODO: Don't just keep px, but both px and % using currentslidesize$
127
+ offset$;
128
+ offsetLeft$;
129
+ offsetRight$;
130
+ padLeft$;
131
+ padRight$;
132
+ ngAfterViewInit() {
133
+ this.isViewInited$.next(true);
134
+ }
135
+ animateToIndexByDx(dx) {
136
+ combineLatest([this.imageIndex$, this.actualSwipes$]).pipe(take(1))
137
+ .subscribe(([imageIndex, actualSwipes]) => {
138
+ const direction = dx > 0 ? 'left' : 'right';
139
+ let newIndex;
140
+ if (Math.abs(dx) < this.minimumOffset) {
141
+ newIndex = imageIndex;
142
+ }
143
+ else {
144
+ newIndex = imageIndex + (direction === 'right' ? 1 : -1);
145
+ }
146
+ this.animateToIndex(imageIndex, newIndex, dx, actualSwipes?.length ?? 1);
147
+ });
148
+ }
149
+ animateToIndex(oldIndex, newIndex, dx, totalSlides) {
150
+ this.pendingAnimation = this.animationBuilder.build([
151
+ style({ 'margin-left': (-(oldIndex + 1) * this.containerElement.nativeElement.clientWidth + dx) + 'px', 'margin-right': ((oldIndex + 1) * this.containerElement.nativeElement.clientWidth - dx) + 'px' }),
152
+ animate('500ms ease', style({ 'margin-left': (-(newIndex + 1) * this.containerElement.nativeElement.clientWidth) + 'px', 'margin-right': ((newIndex + 1) * this.containerElement.nativeElement.clientWidth) + 'px' })),
153
+ ]).create(this.containerElement.nativeElement);
154
+ this.pendingAnimation.onDone(() => {
155
+ // Correct the image index
156
+ if (newIndex === -1) {
157
+ this.imageIndex$.next(totalSlides - 1);
158
+ }
159
+ else if (newIndex === totalSlides) {
160
+ this.imageIndex$.next(0);
161
+ }
162
+ else {
163
+ this.imageIndex$.next(newIndex);
164
+ }
165
+ this.startTouch$.next(null);
166
+ this.lastTouch$.next(null);
167
+ this.pendingAnimation?.destroy();
168
+ this.pendingAnimation = undefined;
169
+ });
170
+ this.pendingAnimation.play();
171
+ }
172
+ onSwipe(dx) {
173
+ this.animateToIndexByDx(dx);
174
+ }
175
+ previous() {
176
+ this.gotoAnimate(-1, 'relative');
177
+ }
178
+ next() {
179
+ this.gotoAnimate(1, 'relative');
180
+ }
181
+ goto(index) {
182
+ this.gotoAnimate(index, 'absolute');
183
+ }
184
+ gotoAnimate(index, type) {
185
+ this.pendingAnimation?.finish();
186
+ setTimeout(() => {
187
+ combineLatest([this.actualSwipes$, this.imageIndex$]).pipe(take(1)).subscribe(([actualSwipes, imageIndex]) => {
188
+ this.pendingAnimation?.finish();
189
+ const idx = (type === 'relative') ? imageIndex + index : index;
190
+ this.animateToIndex(imageIndex, idx, 0, actualSwipes?.length ?? 1);
191
+ });
192
+ }, 20);
193
+ }
194
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwipeContainerDirective, deps: [{ token: i0.ElementRef }, { token: i1.AnimationBuilder }, { token: DOCUMENT }, { token: i2.BsObserveSizeDirective }], target: i0.ɵɵFactoryTarget.Directive });
195
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BsSwipeContainerDirective, selector: "[bsSwipeContainer]", inputs: { minimumOffset: "minimumOffset", imageIndex: "imageIndex" }, outputs: { imageIndexChange: "imageIndexChange" }, host: { properties: { "style.margin-left.%": "this.offsetLeft", "style.margin-right.%": "this.offsetRight", "style.margin-top.%": "this.offsetTop", "style.margin-bottom.%": "this.offsetBottom" } }, queries: [{ propertyName: "swipes", predicate: i0.forwardRef(() => BsSwipeDirective) }], exportAs: ["bsSwipeContainer"], hostDirectives: [{ directive: i2.BsObserveSizeDirective }], ngImport: i0 });
196
+ }
197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwipeContainerDirective, decorators: [{
198
+ type: Directive,
199
+ args: [{
200
+ selector: '[bsSwipeContainer]',
201
+ exportAs: 'bsSwipeContainer',
202
+ hostDirectives: [BsObserveSizeDirective]
203
+ }]
204
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.AnimationBuilder }, { type: undefined, decorators: [{
205
+ type: Inject,
206
+ args: [DOCUMENT]
207
+ }] }, { type: i2.BsObserveSizeDirective }], propDecorators: { offsetLeft: [{
208
+ type: HostBinding,
209
+ args: ['style.margin-left.%']
210
+ }], offsetRight: [{
211
+ type: HostBinding,
212
+ args: ['style.margin-right.%']
213
+ }], offsetTop: [{
214
+ type: HostBinding,
215
+ args: ['style.margin-top.%']
216
+ }], offsetBottom: [{
217
+ type: HostBinding,
218
+ args: ['style.margin-bottom.%']
219
+ }], swipes: [{
220
+ type: ContentChildren,
221
+ args: [forwardRef(() => BsSwipeDirective)]
222
+ }], minimumOffset: [{
223
+ type: Input
224
+ }], imageIndex: [{
225
+ type: Input
226
+ }], imageIndexChange: [{
227
+ type: Output
228
+ }] } });
229
+
230
+ class BsSwipeDirective {
231
+ container;
232
+ constructor(container, observeSize) {
233
+ this.container = container;
234
+ this.observeSize = observeSize;
235
+ // container.orientation$.pipe(takeUntilDestroyed())
236
+ // .subscribe(orientation => this.hostClass = (orientation === 'vertical') ? 'd-block' : 'd-inline-block');
237
+ }
238
+ observeSize;
239
+ //#region Offside
240
+ offside = false;
241
+ //#endregion
242
+ classes = true;
243
+ hostClass;
244
+ onTouchStart(ev) {
245
+ if (ev.touches.length === 1) {
246
+ ev.preventDefault();
247
+ this.container.pendingAnimation?.finish();
248
+ setTimeout(() => {
249
+ this.container.startTouch$.next({
250
+ position: {
251
+ x: ev.touches[0].clientX,
252
+ y: ev.touches[0].clientY,
253
+ },
254
+ timestamp: Date.now(),
255
+ });
256
+ this.container.lastTouch$.next({
257
+ position: {
258
+ x: ev.touches[0].clientX,
259
+ y: ev.touches[0].clientY,
260
+ },
261
+ isTouching: true,
262
+ });
263
+ }, 20);
264
+ }
265
+ }
266
+ onTouchMove(ev) {
267
+ this.container.lastTouch$.next({
268
+ position: {
269
+ x: ev.touches[0].clientX,
270
+ y: ev.touches[0].clientY,
271
+ },
272
+ isTouching: true,
273
+ });
274
+ }
275
+ onTouchEnd(ev) {
276
+ combineLatest([this.container.startTouch$, this.container.lastTouch$])
277
+ .pipe(filter(([startTouch, lastTouch]) => !!startTouch && !!lastTouch))
278
+ .pipe(take(1))
279
+ .subscribe(([startTouch, lastTouch]) => {
280
+ if (!!startTouch && !!lastTouch) {
281
+ const dx = lastTouch.position.x - startTouch.position.x;
282
+ this.container.onSwipe(dx);
283
+ }
284
+ });
285
+ }
286
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwipeDirective, deps: [{ token: BsSwipeContainerDirective }, { token: i2.BsObserveSizeDirective }], target: i0.ɵɵFactoryTarget.Directive });
287
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BsSwipeDirective, selector: "[bsSwipe]", inputs: { offside: "offside" }, host: { listeners: { "touchstart": "onTouchStart($event)", "touchmove": "onTouchMove($event)", "touchend": "onTouchEnd($event)" }, properties: { "class.align-top": "this.classes", "class.d-inline-block": "this.classes", "class.float-none": "this.classes", "class.w-100": "this.classes", "class.pe-auto": "this.classes", "class.me-0": "this.classes", "class": "this.hostClass" } }, hostDirectives: [{ directive: i2.BsObserveSizeDirective }], ngImport: i0 });
288
+ }
289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwipeDirective, decorators: [{
290
+ type: Directive,
291
+ args: [{
292
+ selector: '[bsSwipe]',
293
+ hostDirectives: [BsObserveSizeDirective]
294
+ }]
295
+ }], ctorParameters: () => [{ type: BsSwipeContainerDirective }, { type: i2.BsObserveSizeDirective }], propDecorators: { offside: [{
296
+ type: Input
297
+ }], classes: [{
298
+ type: HostBinding,
299
+ args: ['class.align-top']
300
+ }, {
301
+ type: HostBinding,
302
+ args: ['class.d-inline-block']
303
+ }, {
304
+ type: HostBinding,
305
+ args: ['class.float-none']
306
+ }, {
307
+ type: HostBinding,
308
+ args: ['class.w-100']
309
+ }, {
310
+ type: HostBinding,
311
+ args: ['class.pe-auto']
312
+ }, {
313
+ type: HostBinding,
314
+ args: ['class.me-0']
315
+ }], hostClass: [{
316
+ type: HostBinding,
317
+ args: ['class']
318
+ }], onTouchStart: [{
319
+ type: HostListener,
320
+ args: ['touchstart', ['$event']]
321
+ }], onTouchMove: [{
322
+ type: HostListener,
323
+ args: ['touchmove', ['$event']]
324
+ }], onTouchEnd: [{
325
+ type: HostListener,
326
+ args: ['touchend', ['$event']]
327
+ }] } });
328
+
329
+ class BsSwiperModule {
330
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwiperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
331
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: BsSwiperModule, declarations: [BsSwipeDirective, BsSwipeContainerDirective], imports: [CommonModule], exports: [BsSwipeDirective, BsSwipeContainerDirective] });
332
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwiperModule, imports: [CommonModule] });
333
+ }
334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BsSwiperModule, decorators: [{
335
+ type: NgModule,
336
+ args: [{
337
+ imports: [CommonModule],
338
+ declarations: [BsSwipeDirective, BsSwipeContainerDirective],
339
+ exports: [BsSwipeDirective, BsSwipeContainerDirective],
340
+ }]
341
+ }] });
342
+
343
+ /**
344
+ * Generated bundle index. Do not edit.
345
+ */
346
+
347
+ export { BsSwipeContainerDirective, BsSwipeDirective, BsSwiperModule };
348
+ //# sourceMappingURL=mintplayer-ng-swiper-swiper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mintplayer-ng-swiper-swiper.mjs","sources":["../../../../libs/mintplayer-ng-swiper/swiper/src/directives/swipe-container/swipe-container.directive.ts","../../../../libs/mintplayer-ng-swiper/swiper/src/directives/swipe/swipe.directive.ts","../../../../libs/mintplayer-ng-swiper/swiper/src/swiper.module.ts","../../../../libs/mintplayer-ng-swiper/swiper/mintplayer-ng-swiper-swiper.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';\nimport { AfterViewInit, ContentChildren, Directive, ElementRef, EventEmitter, forwardRef, HostBinding, Inject, Input, Output, QueryList } from '@angular/core';\nimport { BehaviorSubject, combineLatest, debounceTime, delay, filter, map, mergeMap, Observable, take } from 'rxjs';\nimport { BsObserveSizeDirective, Size } from '@mintplayer/ng-swiper/observe-size';\nimport { LastTouch } from '../../interfaces/last-touch';\nimport { StartTouch } from '../../interfaces/start-touch';\nimport { BsSwipeDirective } from '../swipe/swipe.directive';\n\n@Directive({\n selector: '[bsSwipeContainer]',\n exportAs: 'bsSwipeContainer',\n hostDirectives: [BsObserveSizeDirective]\n})\nexport class BsSwipeContainerDirective implements AfterViewInit {\n\n constructor(element: ElementRef, private animationBuilder: AnimationBuilder, @Inject(DOCUMENT) document: any, private observeSize: BsObserveSizeDirective) {\n this.containerElement = element;\n this.document = <Document>document;\n this.offset$ = combineLatest([this.startTouch$, this.lastTouch$, this.imageIndex$, this.isViewInited$])\n .pipe(map(([startTouch, lastTouch, imageIndex, isViewInited]) => {\n if (!isViewInited) {\n return (-imageIndex * 100);\n } else if (!!startTouch && !!lastTouch) {\n return (-imageIndex * 100 + (lastTouch.position.x - startTouch.position.x) / this.containerElement.nativeElement.clientWidth * 100);\n } else {\n return (-imageIndex * 100);\n }\n }));\n\n this.padLeft$ = this.swipes$.pipe(map(swipes => {\n if (!swipes) {\n return 0;\n }\n\n let count = 0;\n for (const s of swipes) {\n if (!s.offside) {\n break;\n } else {\n count++;\n }\n }\n return count;\n }));\n\n this.padRight$ = this.swipes$.pipe(map(swipes => {\n if (!swipes) {\n return 0;\n }\n\n let count = 0;\n for (const s of swipes.toArray().reverse()) {\n if (!s.offside) {\n break;\n } else {\n count++;\n }\n }\n return count;\n }));\n\n this.offsetLeft$ = combineLatest([this.offset$, this.padLeft$])\n .pipe(map(([offset, padLeft]) => offset - padLeft * 100));\n this.offsetRight$ = combineLatest([this.offset$, this.padLeft$, this.padRight$])\n .pipe(map(([offset, padLeft, padRight]) => -(offset - padLeft * 100) - (padRight - 1) * 100));\n this.offsetLeft$.pipe(takeUntilDestroyed())\n .subscribe(offsetLeft => this.offsetLeft = offsetLeft);\n this.offsetRight$.pipe(takeUntilDestroyed())\n .subscribe(offsetRight => this.offsetRight = offsetRight);\n this.imageIndex$.pipe(takeUntilDestroyed())\n .subscribe(imageIndex => this.imageIndexChange.emit(imageIndex));\n\n this.actualSwipes$ = this.swipes$\n .pipe(map(swipes => {\n if (swipes) {\n return swipes.filter(swipe => !swipe.offside);\n } else {\n return [];\n }\n }));\n\n this.slideSizes$ = this.actualSwipes$\n .pipe(delay(400), filter(swipes => !!swipes))\n .pipe(mergeMap(swipes => combineLatest(swipes.map(swipe => swipe.observeSize.size$))));\n\n this.currentSlideHeight$ = combineLatest([this.slideSizes$, this.imageIndex$])\n .pipe(map(([slideSizes, imageIndex]) => {\n const maxHeight = Math.max(...slideSizes.map(s => s?.height ?? 1));\n console.log('maxHeight', {maxHeight, slideSizes});\n const currHeight: number = slideSizes[imageIndex]?.height ?? maxHeight;\n // switch (orientation) {\n // case 'horizontal':\n return currHeight;\n // case 'vertical':\n // return maxHeight;\n // }\n }))\n .pipe(debounceTime(10));\n }\n\n @HostBinding('style.margin-left.%') offsetLeft: number | null = null;\n @HostBinding('style.margin-right.%') offsetRight: number | null = null;\n @HostBinding('style.margin-top.%') offsetTop: number | null = null;\n @HostBinding('style.margin-bottom.%') offsetBottom: number | null = null;\n @ContentChildren(forwardRef(() => BsSwipeDirective)) set swipes(value: QueryList<BsSwipeDirective>) {\n setTimeout(() => this.swipes$.next(value));\n }\n @Input() minimumOffset = 50;\n\n //#region ImageIndex\n public get imageIndex() {\n return this.imageIndex$.value;\n }\n @Input() public set imageIndex(value: number) {\n this.imageIndex$.next(value);\n }\n @Output() imageIndexChange = new EventEmitter<number>();\n //#endregion\n \n actualSwipes$: Observable<BsSwipeDirective[]>;\n isViewInited$ = new BehaviorSubject<boolean>(false);\n startTouch$ = new BehaviorSubject<StartTouch | null>(null);\n lastTouch$ = new BehaviorSubject<LastTouch | null>(null);\n swipes$ = new BehaviorSubject<QueryList<BsSwipeDirective> | null>(null);\n // TODO: slide sizes instead\n slideSizes$: Observable<(Size | undefined)[]>;\n imageIndex$ = new BehaviorSubject<number>(0);\n currentSlideHeight$: Observable<number>;\n pendingAnimation?: AnimationPlayer;\n containerElement: ElementRef<HTMLDivElement>;\n document: Document;\n\n // TODO: Don't just keep px, but both px and % using currentslidesize$\n offset$: Observable<number>;\n offsetLeft$: Observable<number>;\n offsetRight$: Observable<number>;\n padLeft$: Observable<number>;\n padRight$: Observable<number>;\n\n ngAfterViewInit() {\n this.isViewInited$.next(true);\n }\n\n animateToIndexByDx(dx: number) {\n combineLatest([this.imageIndex$, this.actualSwipes$]).pipe(take(1))\n .subscribe(([imageIndex, actualSwipes]) => {\n const direction = dx > 0 ? 'left' : 'right';\n \n let newIndex: number;\n if (Math.abs(dx) < this.minimumOffset) {\n newIndex = imageIndex;\n } else {\n newIndex = imageIndex + (direction === 'right' ? 1 : -1);\n }\n \n this.animateToIndex(imageIndex, newIndex, dx, actualSwipes?.length ?? 1);\n });\n }\n\n animateToIndex(oldIndex: number, newIndex: number, dx: number, totalSlides: number) {\n this.pendingAnimation = this.animationBuilder.build([\n style({ 'margin-left': (-(oldIndex + 1) * this.containerElement.nativeElement.clientWidth + dx) + 'px', 'margin-right': ((oldIndex + 1) * this.containerElement.nativeElement.clientWidth - dx) + 'px' }),\n animate('500ms ease', style({ 'margin-left': (-(newIndex + 1) * this.containerElement.nativeElement.clientWidth) + 'px', 'margin-right': ((newIndex + 1) * this.containerElement.nativeElement.clientWidth) + 'px' })),\n ]).create(this.containerElement.nativeElement);\n this.pendingAnimation.onDone(() => {\n // Correct the image index\n if (newIndex === -1) {\n this.imageIndex$.next(totalSlides - 1);\n } else if (newIndex === totalSlides) {\n this.imageIndex$.next(0);\n } else {\n this.imageIndex$.next(newIndex);\n }\n this.startTouch$.next(null);\n this.lastTouch$.next(null);\n this.pendingAnimation?.destroy();\n this.pendingAnimation = undefined;\n });\n this.pendingAnimation.play();\n }\n\n onSwipe(dx: number) {\n this.animateToIndexByDx(dx);\n }\n\n previous() {\n this.gotoAnimate(-1, 'relative');\n }\n\n next() {\n this.gotoAnimate(1, 'relative');\n }\n\n goto(index: number) {\n this.gotoAnimate(index, 'absolute');\n }\n\n private gotoAnimate(index: number, type: 'absolute' | 'relative') {\n this.pendingAnimation?.finish();\n setTimeout(() => {\n combineLatest([this.actualSwipes$, this.imageIndex$]).pipe(take(1)).subscribe(([actualSwipes, imageIndex]) => {\n this.pendingAnimation?.finish();\n const idx = (type === 'relative') ? imageIndex + index : index;\n this.animateToIndex(imageIndex, idx, 0, actualSwipes?.length ?? 1);\n });\n }, 20);\n }\n\n}\n","import { Directive, HostBinding, HostListener, Input } from \"@angular/core\";\nimport { BsObserveSizeDirective } from \"@mintplayer/ng-swiper/observe-size\";\nimport { combineLatest, filter, take } from \"rxjs\";\nimport { BsSwipeContainerDirective } from \"../swipe-container/swipe-container.directive\";\n\n@Directive({\n selector: '[bsSwipe]',\n hostDirectives: [BsObserveSizeDirective]\n})\nexport class BsSwipeDirective {\n\n constructor(private container: BsSwipeContainerDirective, observeSize: BsObserveSizeDirective) {\n this.observeSize = observeSize;\n // container.orientation$.pipe(takeUntilDestroyed())\n // .subscribe(orientation => this.hostClass = (orientation === 'vertical') ? 'd-block' : 'd-inline-block');\n }\n\n observeSize: BsObserveSizeDirective;\n\n //#region Offside\n @Input() public offside = false;\n //#endregion\n\n @HostBinding('class.align-top')\n @HostBinding('class.d-inline-block')\n @HostBinding('class.float-none')\n @HostBinding('class.w-100')\n @HostBinding('class.pe-auto')\n @HostBinding('class.me-0')\n classes = true;\n\n @HostBinding('class') hostClass?: string;\n\n @HostListener('touchstart', ['$event'])\n onTouchStart(ev: TouchEvent) {\n if (ev.touches.length === 1) {\n ev.preventDefault();\n this.container.pendingAnimation?.finish();\n\n setTimeout(() => {\n this.container.startTouch$.next({\n position: {\n x: ev.touches[0].clientX,\n y: ev.touches[0].clientY,\n },\n timestamp: Date.now(),\n });\n this.container.lastTouch$.next({\n position: {\n x: ev.touches[0].clientX,\n y: ev.touches[0].clientY,\n },\n isTouching: true,\n });\n }, 20);\n }\n }\n\n @HostListener('touchmove', ['$event'])\n onTouchMove(ev: TouchEvent) {\n this.container.lastTouch$.next({\n position: {\n x: ev.touches[0].clientX,\n y: ev.touches[0].clientY,\n },\n isTouching: true,\n });\n }\n\n @HostListener('touchend', ['$event'])\n onTouchEnd(ev: TouchEvent) {\n combineLatest([this.container.startTouch$, this.container.lastTouch$])\n .pipe(filter(([startTouch, lastTouch]) => !!startTouch && !!lastTouch))\n .pipe(take(1))\n .subscribe(([startTouch, lastTouch]) => {\n if (!!startTouch && !!lastTouch) {\n const dx = lastTouch.position.x - startTouch.position.x;\n this.container.onSwipe(dx);\n }\n });\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsSwipeDirective } from './directives/swipe/swipe.directive';\nimport { BsSwipeContainerDirective } from './directives/swipe-container/swipe-container.directive';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [BsSwipeDirective, BsSwipeContainerDirective],\n exports: [BsSwipeDirective, BsSwipeContainerDirective],\n})\nexport class BsSwiperModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.BsSwipeContainerDirective"],"mappings":";;;;;;;;;;MAea,yBAAyB,CAAA;AAEK,IAAA,gBAAA,CAAA;AAA6E,IAAA,WAAA,CAAA;AAAtH,IAAA,WAAA,CAAY,OAAmB,EAAU,gBAAkC,EAAoB,QAAa,EAAU,WAAmC,EAAA;QAAhH,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAA2C,IAAW,CAAA,WAAA,GAAX,WAAW,CAAwB;AACvJ,QAAA,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;AAChC,QAAA,IAAI,CAAC,QAAQ,GAAa,QAAQ,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,WAA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