nextalys-carousel 0.0.68 → 0.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{fesm2015 → fesm2022}/nextalys-carousel-lib-nxs-carousel-mock.mjs +25 -24
- package/fesm2022/nextalys-carousel-lib-nxs-carousel-mock.mjs.map +1 -0
- package/fesm2022/nextalys-carousel-lib-nxs-carousel.mjs +424 -0
- package/fesm2022/nextalys-carousel-lib-nxs-carousel.mjs.map +1 -0
- package/{fesm2015 → fesm2022}/nextalys-carousel.mjs +3 -3
- package/{fesm2020 → fesm2022}/nextalys-carousel.mjs.map +1 -1
- package/lib/nxs-carousel/nxs-carousel/nxs-carousel-dialog.component.d.ts +1 -1
- package/lib/nxs-carousel/nxs-carousel/nxs-carousel-dialog.component.d.ts.map +1 -1
- package/lib/nxs-carousel/nxs-carousel/nxs-carousel.component.d.ts +3 -3
- package/lib/nxs-carousel/nxs-carousel/nxs-carousel.component.d.ts.map +1 -1
- package/lib/nxs-carousel/nxs-carousel/swiper-directives.d.ts +1 -1
- package/lib/nxs-carousel/nxs-carousel/swiper-directives.d.ts.map +1 -1
- package/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-mock.component.d.ts +1 -1
- package/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-mock.component.d.ts.map +1 -1
- package/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-types.d.ts +1 -1
- package/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-types.d.ts.map +1 -1
- package/lib/nxs-carousel-mock/nxs-carousel-mock/swiper-directives.d.ts +1 -1
- package/lib/nxs-carousel-mock/nxs-carousel-mock/swiper-directives.d.ts.map +1 -1
- package/package.json +5 -21
- package/esm2020/common-types.mjs +0 -6
- package/esm2020/lib/nxs-carousel/common-types.mjs +0 -6
- package/esm2020/lib/nxs-carousel/nextalys-carousel-lib-nxs-carousel.mjs +0 -5
- package/esm2020/lib/nxs-carousel/nxs-carousel/carousel-events.mjs +0 -5
- package/esm2020/lib/nxs-carousel/nxs-carousel/nxs-carousel-dialog.component.mjs +0 -51
- package/esm2020/lib/nxs-carousel/nxs-carousel/nxs-carousel-types.mjs +0 -2
- package/esm2020/lib/nxs-carousel/nxs-carousel/nxs-carousel.component.mjs +0 -266
- package/esm2020/lib/nxs-carousel/nxs-carousel/nxs-carousel.module.mjs +0 -75
- package/esm2020/lib/nxs-carousel/nxs-carousel/swiper-directives.mjs +0 -13
- package/esm2020/lib/nxs-carousel/public-api-carousel.mjs +0 -5
- package/esm2020/lib/nxs-carousel-mock/common-types.mjs +0 -6
- package/esm2020/lib/nxs-carousel-mock/nextalys-carousel-lib-nxs-carousel-mock.mjs +0 -5
- package/esm2020/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-mock.component.mjs +0 -44
- package/esm2020/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-mock.module.mjs +0 -38
- package/esm2020/lib/nxs-carousel-mock/nxs-carousel-mock/nxs-carousel-types.mjs +0 -2
- package/esm2020/lib/nxs-carousel-mock/nxs-carousel-mock/swiper-directives.mjs +0 -13
- package/esm2020/lib/nxs-carousel-mock/public-api-carousel-mock.mjs +0 -5
- package/esm2020/nextalys-carousel.mjs +0 -5
- package/esm2020/public-api.mjs +0 -5
- package/fesm2015/nextalys-carousel-lib-nxs-carousel-mock.mjs.map +0 -1
- package/fesm2015/nextalys-carousel-lib-nxs-carousel.mjs +0 -412
- package/fesm2015/nextalys-carousel-lib-nxs-carousel.mjs.map +0 -1
- package/fesm2015/nextalys-carousel.mjs.map +0 -1
- package/fesm2020/nextalys-carousel-lib-nxs-carousel-mock.mjs +0 -101
- package/fesm2020/nextalys-carousel-lib-nxs-carousel-mock.mjs.map +0 -1
- package/fesm2020/nextalys-carousel-lib-nxs-carousel.mjs +0 -399
- package/fesm2020/nextalys-carousel-lib-nxs-carousel.mjs.map +0 -1
- package/fesm2020/nextalys-carousel.mjs +0 -14
|
@@ -3,15 +3,16 @@ import { EventEmitter, Component, ViewEncapsulation, Input, Output, Directive, N
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
|
|
5
5
|
class NxsCarouselComponent {
|
|
6
|
+
lazy = true;
|
|
7
|
+
images;
|
|
8
|
+
options = null;
|
|
9
|
+
hasHtmlContent = false;
|
|
10
|
+
slidesCount = 0;
|
|
11
|
+
slideChange = new EventEmitter();
|
|
12
|
+
currentSlide = 0;
|
|
13
|
+
slideClick = new EventEmitter();
|
|
14
|
+
isBrowser = false;
|
|
6
15
|
constructor() {
|
|
7
|
-
this.lazy = true;
|
|
8
|
-
this.options = null;
|
|
9
|
-
this.hasHtmlContent = false;
|
|
10
|
-
this.slidesCount = 0;
|
|
11
|
-
this.slideChange = new EventEmitter();
|
|
12
|
-
this.currentSlide = 0;
|
|
13
|
-
this.slideClick = new EventEmitter();
|
|
14
|
-
this.isBrowser = false;
|
|
15
16
|
}
|
|
16
17
|
goToSlide(index, speed) {
|
|
17
18
|
}
|
|
@@ -19,18 +20,19 @@ class NxsCarouselComponent {
|
|
|
19
20
|
}
|
|
20
21
|
previous() {
|
|
21
22
|
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NxsCarouselComponent, isStandalone: false, selector: "nxs-carousel", inputs: { lazy: "lazy", images: "images", options: "options", hasHtmlContent: "hasHtmlContent" }, outputs: { slideChange: "slideChange", slideClick: "slideClick" }, ngImport: i0, template: '<div style="height:70px;width:100%;"></div>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
NxsCarouselComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: NxsCarouselComponent, selector: "nxs-carousel", inputs: { lazy: "lazy", images: "images", options: "options", hasHtmlContent: "hasHtmlContent" }, outputs: { slideChange: "slideChange", slideClick: "slideClick" }, ngImport: i0, template: '<div style="height:70px;width:100%;"></div>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NxsCarouselComponent, decorators: [{
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselComponent, decorators: [{
|
|
26
27
|
type: Component,
|
|
27
28
|
args: [{
|
|
28
29
|
selector: 'nxs-carousel',
|
|
29
30
|
template: '<div style="height:70px;width:100%;"></div>',
|
|
30
31
|
// styleUrls: ['./nxs-carousel.component.scss'],
|
|
31
32
|
encapsulation: ViewEncapsulation.None,
|
|
33
|
+
standalone: false
|
|
32
34
|
}]
|
|
33
|
-
}], ctorParameters:
|
|
35
|
+
}], ctorParameters: () => [], propDecorators: { lazy: [{
|
|
34
36
|
type: Input
|
|
35
37
|
}], images: [{
|
|
36
38
|
type: Input
|
|
@@ -45,19 +47,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
45
47
|
}] } });
|
|
46
48
|
|
|
47
49
|
class NxsCarouselModuleConfig {
|
|
48
|
-
|
|
49
|
-
this.debug = false;
|
|
50
|
-
}
|
|
50
|
+
debug = false;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
class NxsSwiperTemplateDirective {
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsSwiperTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: NxsSwiperTemplateDirective, isStandalone: false, selector: "[nxsSwiperTemplate]", ngImport: i0 });
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
NxsSwiperTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.5", type: NxsSwiperTemplateDirective, selector: "[nxsSwiperTemplate]", ngImport: i0 });
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NxsSwiperTemplateDirective, decorators: [{
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsSwiperTemplateDirective, decorators: [{
|
|
58
58
|
type: Directive,
|
|
59
59
|
args: [{
|
|
60
60
|
selector: '[nxsSwiperTemplate]',
|
|
61
|
+
standalone: false
|
|
61
62
|
}]
|
|
62
63
|
}] });
|
|
63
64
|
|
|
@@ -70,13 +71,13 @@ class NxsCarouselModule {
|
|
|
70
71
|
]
|
|
71
72
|
};
|
|
72
73
|
}
|
|
74
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
75
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, declarations: [NxsCarouselComponent,
|
|
76
|
+
NxsSwiperTemplateDirective], imports: [CommonModule], exports: [NxsCarouselComponent,
|
|
77
|
+
NxsSwiperTemplateDirective] });
|
|
78
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, imports: [CommonModule] });
|
|
73
79
|
}
|
|
74
|
-
|
|
75
|
-
NxsCarouselModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: NxsCarouselModule, declarations: [NxsCarouselComponent,
|
|
76
|
-
NxsSwiperTemplateDirective], imports: [CommonModule], exports: [NxsCarouselComponent,
|
|
77
|
-
NxsSwiperTemplateDirective] });
|
|
78
|
-
NxsCarouselModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NxsCarouselModule, imports: [CommonModule] });
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NxsCarouselModule, decorators: [{
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, decorators: [{
|
|
80
81
|
type: NgModule,
|
|
81
82
|
args: [{
|
|
82
83
|
imports: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextalys-carousel-lib-nxs-carousel-mock.mjs","sources":["../../lib/nxs-carousel-mock/nxs-carousel-mock.component.ts","../../lib/common-types.ts","../../lib/nxs-carousel-mock/swiper-directives.ts","../../lib/nxs-carousel-mock/nxs-carousel-mock.module.ts","../../lib/nextalys-carousel-lib-nxs-carousel-mock.ts"],"sourcesContent":["import { Component, ViewEncapsulation, Input, Output, EventEmitter } from '@angular/core';\nimport { NxsCarouselImage } from '../common-types';\nimport { NxsCarouselOptions } from './nxs-carousel-types';\n@Component({\n selector: 'nxs-carousel',\n template: '<div style=\"height:70px;width:100%;\"></div>',\n // styleUrls: ['./nxs-carousel.component.scss'],\n encapsulation: ViewEncapsulation.None,\n standalone: false\n})\nexport class NxsCarouselComponent {\n @Input()\n lazy = true;\n @Input()\n public images: NxsCarouselImage[];\n @Input()\n options: NxsCarouselOptions = null;\n @Input()\n hasHtmlContent = false;\n slidesCount: number = 0;\n @Output()\n slideChange = new EventEmitter<number>();\n public currentSlide = 0;\n @Output()\n slideClick = new EventEmitter<MouseEvent | TouchEvent | PointerEvent>();\n isBrowser = false;\n\n constructor(\n ) {\n\n }\n goToSlide(index: number, speed?: number) {\n }\n next() {\n }\n previous() {\n }\n}\n","\nexport interface NxsCarouselImage {\n alt?: string;\n src: string;\n}\nexport class NxsCarouselModuleConfig {\n debug?: boolean = false;\n}","import { Directive } from \"@angular/core\";\n\n@Directive({\n selector: '[nxsSwiperTemplate]',\n standalone: false\n})\nexport class NxsSwiperTemplateDirective { }\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { NxsCarouselModuleConfig } from '../common-types';\nimport { NxsCarouselComponent } from './nxs-carousel-mock.component';\nimport { NxsSwiperTemplateDirective } from './swiper-directives';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n declarations: [\n NxsCarouselComponent,\n NxsSwiperTemplateDirective,\n ],\n exports: [\n NxsCarouselComponent,\n NxsSwiperTemplateDirective,\n ],\n})\nexport class NxsCarouselModule {\n public static forRoot(config?: NxsCarouselModuleConfig): ModuleWithProviders<NxsCarouselModule> {\n return {\n ngModule: NxsCarouselModule,\n providers: [\n { provide: NxsCarouselModuleConfig, useValue: config },\n ]\n };\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api-carousel-mock';\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, EventEmitter, PLATFORM_ID, TemplateRef, Component, ViewEncapsulation, Inject, Optional, ContentChildren, ViewChild, Input, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/dialog';
|
|
4
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
5
|
+
import * as i3 from '@angular/common';
|
|
6
|
+
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
7
|
+
import { EventsCollector } from 'nextalys-js-helpers/dist/events';
|
|
8
|
+
import SwiperCore, { Navigation, Pagination, Autoplay, Lazy, Thumbs } from 'swiper';
|
|
9
|
+
import * as i4 from 'swiper/angular';
|
|
10
|
+
import { SwiperModule } from 'swiper/angular';
|
|
11
|
+
import { NxsEvent } from 'nextalys-js-helpers';
|
|
12
|
+
import * as i2 from '@angular/material/icon';
|
|
13
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
14
|
+
import * as i3$1 from '@angular/material/button';
|
|
15
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
16
|
+
|
|
17
|
+
class NxsSwiperTemplateDirective {
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsSwiperTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
19
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: NxsSwiperTemplateDirective, isStandalone: false, selector: "[nxsSwiperTemplate]", ngImport: i0 });
|
|
20
|
+
}
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsSwiperTemplateDirective, decorators: [{
|
|
22
|
+
type: Directive,
|
|
23
|
+
args: [{
|
|
24
|
+
selector: '[nxsSwiperTemplate]',
|
|
25
|
+
standalone: false
|
|
26
|
+
}]
|
|
27
|
+
}] });
|
|
28
|
+
|
|
29
|
+
class NxsCarouselModuleConfig {
|
|
30
|
+
debug = false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class CarouselEvents {
|
|
34
|
+
static openCarouselDialog = new NxsEvent();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// install Swiper modules
|
|
38
|
+
SwiperCore.use([Navigation, Pagination, Autoplay, Lazy, Thumbs]);
|
|
39
|
+
class NxsCarouselComponent {
|
|
40
|
+
matDialog;
|
|
41
|
+
zone;
|
|
42
|
+
platformId;
|
|
43
|
+
config;
|
|
44
|
+
swiperReady = false;
|
|
45
|
+
contents;
|
|
46
|
+
swiperComponent;
|
|
47
|
+
lazy = true;
|
|
48
|
+
eventsCollector = new EventsCollector();
|
|
49
|
+
images;
|
|
50
|
+
options = null;
|
|
51
|
+
thumbnailsOptions = null;
|
|
52
|
+
set setOptions(val) {
|
|
53
|
+
this.options = this.setDefaultOptions(val, false);
|
|
54
|
+
this.setThumbnailsOptions();
|
|
55
|
+
}
|
|
56
|
+
hasHtmlContent = false;
|
|
57
|
+
swiperInstance;
|
|
58
|
+
thumbnailsSwiperInstance;
|
|
59
|
+
get slidesCount() {
|
|
60
|
+
return this.swiperInstance?.slides?.length || 0;
|
|
61
|
+
}
|
|
62
|
+
slideChange = new EventEmitter();
|
|
63
|
+
currentSlide = 0;
|
|
64
|
+
slideClick = new EventEmitter();
|
|
65
|
+
isBrowser = false;
|
|
66
|
+
constructor(matDialog, zone, platformId, config) {
|
|
67
|
+
this.matDialog = matDialog;
|
|
68
|
+
this.zone = zone;
|
|
69
|
+
this.platformId = platformId;
|
|
70
|
+
this.config = config;
|
|
71
|
+
if (!this.config)
|
|
72
|
+
this.config = { debug: false };
|
|
73
|
+
this.isBrowser = isPlatformBrowser(this.platformId);
|
|
74
|
+
this.log('constructor - isBrowser', this.isBrowser);
|
|
75
|
+
this.options = this.setDefaultOptions(undefined, false);
|
|
76
|
+
}
|
|
77
|
+
log(...args) {
|
|
78
|
+
if (!this.config.debug)
|
|
79
|
+
return;
|
|
80
|
+
console.log('[NxsCarousel]', ...args);
|
|
81
|
+
}
|
|
82
|
+
destroy() {
|
|
83
|
+
if (!this.isBrowser) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this.eventsCollector?.unsubscribeAll();
|
|
87
|
+
}
|
|
88
|
+
ngOnDestroy() {
|
|
89
|
+
this.destroy();
|
|
90
|
+
}
|
|
91
|
+
ngAfterViewInit() {
|
|
92
|
+
// console.log('thi.contents', this.contents);
|
|
93
|
+
// this.initSlides();
|
|
94
|
+
// this.createSlider(true);
|
|
95
|
+
}
|
|
96
|
+
getMainSliderHeight() {
|
|
97
|
+
if (!this.options)
|
|
98
|
+
return '';
|
|
99
|
+
if (this.options.nxsThumbnails && this.options.nxsThumbnails.show) {
|
|
100
|
+
if (this.options.nxsThumbnails.onMainSlider) {
|
|
101
|
+
return '100%';
|
|
102
|
+
}
|
|
103
|
+
else if (this.options.nxsThumbnails.percentHeight) {
|
|
104
|
+
return (100 - this.options.nxsThumbnails.percentHeight) + '%';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return '';
|
|
108
|
+
}
|
|
109
|
+
setDefaultOptions(options, forDialog) {
|
|
110
|
+
if (!options && forDialog) {
|
|
111
|
+
options = {
|
|
112
|
+
nxsShowNavigationBullets: true, loop: true, nxsThumbnails: { show: true }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: true,
|
|
113
|
+
lazy: this.lazy,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
else if (!options) {
|
|
117
|
+
options = {
|
|
118
|
+
nxsShowNavigationBullets: true, loop: true,
|
|
119
|
+
nxsThumbnails: { show: false }, effect: 'slide', nxsShowNavigationArrows: true, nxsShowImagesCount: false, nxsCarouselDialogOptions: {},
|
|
120
|
+
lazy: this.lazy,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (options.nxsCarouselDialogOptions) {
|
|
124
|
+
if (typeof options.nxsCarouselDialogOptions.nxsThumbnails === 'undefined')
|
|
125
|
+
options.nxsCarouselDialogOptions.nxsThumbnails = { show: false };
|
|
126
|
+
if (typeof options.nxsCarouselDialogOptions.effect === 'undefined')
|
|
127
|
+
options.nxsCarouselDialogOptions.effect = 'slide';
|
|
128
|
+
if (typeof options.nxsCarouselDialogOptions.nxsShowNavigationArrows === 'undefined')
|
|
129
|
+
options.nxsCarouselDialogOptions.nxsShowNavigationArrows = true;
|
|
130
|
+
if (!!options.nxsCarouselDialogOptions.nxsThumbnails?.show) {
|
|
131
|
+
if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight === 'undefined')
|
|
132
|
+
options.nxsCarouselDialogOptions.nxsThumbnails.percentHeight = 20;
|
|
133
|
+
if (typeof options.nxsCarouselDialogOptions.nxsThumbnails.perView === 'undefined')
|
|
134
|
+
options.nxsCarouselDialogOptions.nxsThumbnails.perView = 10;
|
|
135
|
+
options.nxsCarouselDialogOptions.nxsThumbnails.breakpoints = {
|
|
136
|
+
640: {
|
|
137
|
+
slidesPerView: 5,
|
|
138
|
+
},
|
|
139
|
+
768: {
|
|
140
|
+
slidesPerView: 7,
|
|
141
|
+
},
|
|
142
|
+
1024: {
|
|
143
|
+
slidesPerView: 8,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (!options.nxsThumbnails)
|
|
149
|
+
options.nxsThumbnails = { show: false };
|
|
150
|
+
if (options.nxsThumbnails.show && typeof options.nxsThumbnails.percentHeight === 'undefined')
|
|
151
|
+
options.nxsThumbnails.percentHeight = 20;
|
|
152
|
+
if (options.nxsThumbnails.show && typeof options.nxsThumbnails.perView === 'undefined')
|
|
153
|
+
options.nxsThumbnails.perView = 10;
|
|
154
|
+
if (forDialog)
|
|
155
|
+
options.nxsfullscreenOnClick = false;
|
|
156
|
+
if (options.nxsThumbnails.onMainSlider)
|
|
157
|
+
options.nxsShowNavigationBullets = false;
|
|
158
|
+
if (typeof options.lazy === 'undefined')
|
|
159
|
+
options.lazy = true;
|
|
160
|
+
if (typeof options.navigation === 'undefined')
|
|
161
|
+
options.navigation = true;
|
|
162
|
+
if (typeof options.pagination === 'undefined')
|
|
163
|
+
options.pagination = { clickable: true };
|
|
164
|
+
if (options.nxsShowNavigationBullets === false) {
|
|
165
|
+
options.pagination = false;
|
|
166
|
+
}
|
|
167
|
+
// console.log("Log ~ file: nxs-carousel.component.ts ~ line 272 ~ NxsCarouselComponent ~ setDefaultOptions ~ options", options);
|
|
168
|
+
return options;
|
|
169
|
+
}
|
|
170
|
+
setThumbnailsOptions() {
|
|
171
|
+
if (!!this.options?.nxsThumbnails?.show) {
|
|
172
|
+
this.thumbnailsOptions = {
|
|
173
|
+
slidesPerView: this.options.nxsThumbnails.perView,
|
|
174
|
+
loop: false,
|
|
175
|
+
freeMode: true,
|
|
176
|
+
// watchSlidesVisibility: true,
|
|
177
|
+
watchSlidesProgress: true,
|
|
178
|
+
breakpoints: this.options.nxsThumbnails.breakpoints,
|
|
179
|
+
// spaceBetween: 10,
|
|
180
|
+
};
|
|
181
|
+
if (this.lazy) {
|
|
182
|
+
// Disable preloading of all images
|
|
183
|
+
this.thumbnailsOptions.preloadImages = false;
|
|
184
|
+
// Enable lazy loading
|
|
185
|
+
this.thumbnailsOptions.lazy = true;
|
|
186
|
+
}
|
|
187
|
+
// console.log("Log ~ file: nxs-carousel.component.ts ~ line 184 ~ NxsCarouselComponent ~ setThumbnailsOptions ~ this.thumbnailsOptions.lazy", this.thumbnailsOptions.lazy);
|
|
188
|
+
// this.thumbnailsSliderInstance = new Swiper(this.nxsThumbnailsSliderContainer.nativeElement, thumbnailsOptions);
|
|
189
|
+
// this.options.thumbs = { swiper: this.thumbnailsSliderInstance };
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
showFullScreenCarousel(images, wrapperClass) {
|
|
193
|
+
this.options.nxsCarouselDialogOptions = this.setDefaultOptions(this.options.nxsCarouselDialogOptions, true);
|
|
194
|
+
const data = { images, wrapperClass, options: this.options.nxsCarouselDialogOptions };
|
|
195
|
+
CarouselEvents.openCarouselDialog?.emit({
|
|
196
|
+
data,
|
|
197
|
+
panelClass: 'nxs-carousel-dialog',
|
|
198
|
+
width: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.width : undefined,
|
|
199
|
+
height: !!this.options.nxsCarouselDialogSize ? this.options.nxsCarouselDialogSize.height : undefined,
|
|
200
|
+
disableClose: !this.options.nxsCarouselDialogExitable,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
goToSlide(index, speed) {
|
|
204
|
+
this.swiperInstance?.slideTo(index, speed);
|
|
205
|
+
}
|
|
206
|
+
next() {
|
|
207
|
+
this.swiperInstance?.slideNext();
|
|
208
|
+
}
|
|
209
|
+
previous() {
|
|
210
|
+
this.swiperInstance?.slidePrev();
|
|
211
|
+
}
|
|
212
|
+
onSwiperThumbnails(instance) {
|
|
213
|
+
if (this.options?.nxsThumbnails?.show)
|
|
214
|
+
this.thumbnailsSwiperInstance = instance;
|
|
215
|
+
else
|
|
216
|
+
this.thumbnailsSwiperInstance = null;
|
|
217
|
+
// if (this.options?.nxsThumbnails?.show) {
|
|
218
|
+
// const optionsClone = MainHelpers.cloneObject(this.options);
|
|
219
|
+
// optionsClone.thumbs = { swiper: this.thumbnailsSwiperInstance };
|
|
220
|
+
// // this.options = optionsClone;
|
|
221
|
+
// // this.options = { ...this.options, thumbs: { swiper: this.thumbnailsSwiperInstance } };
|
|
222
|
+
// console.log("Log ~ file: nxs-carousel.component.ts ~ line 416 ~ NxsCarouselComponent ~ onSwiperThumbnails ~ this.options ", this.options);
|
|
223
|
+
// this.options.thumbs = { swiper: this.thumbnailsSwiperInstance };
|
|
224
|
+
// }
|
|
225
|
+
}
|
|
226
|
+
onSwiper(instance) {
|
|
227
|
+
this.log('swiper ready - instance', instance);
|
|
228
|
+
this.swiperInstance = instance;
|
|
229
|
+
this.swiperInstance?.on('click', (swiperInstance, evt) => {
|
|
230
|
+
// console.log("Log ~ file: nxs-carousel.component.ts ~ line 392 ~ NxsCarouselComponent ~ this.swiperInstance.on ~ evt", evt);
|
|
231
|
+
const target = evt.target;
|
|
232
|
+
if (target.className.indexOf('nxs-carousel-button') !== -1 || target.className.indexOf('swiper-pagination') !== -1)
|
|
233
|
+
return;
|
|
234
|
+
this.runInZone(() => {
|
|
235
|
+
this.slideClick.next(evt);
|
|
236
|
+
if (this.options.nxsfullscreenOnClick && this.images && this.images.length && !this.hasHtmlContent) {
|
|
237
|
+
this.showFullScreenCarousel(this.images, 'fullscreen-carousel');
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
this.swiperReady = true;
|
|
242
|
+
// $('.swiper-container').on('keydown keyup', function(e){
|
|
243
|
+
// if (e.keyCode==9) $('.swiper-container')[0].scrollLeft = 0;
|
|
244
|
+
// })
|
|
245
|
+
// console.log("Log ~ file: nxs-carousel.component.ts:254 ~ NxsCarouselComponent ~ this.swiperInstance.el.addEventListener ~ this.swiperInstance.el:", this.swiperInstance.el);
|
|
246
|
+
// this.swiperInstance.el.addEventListener('keydown', (evt) => {
|
|
247
|
+
// if (evt.keyCode === 9) {
|
|
248
|
+
// // evt.preventDefault();
|
|
249
|
+
// // this.swiperInstance.el.scrollLeft = 0;
|
|
250
|
+
// // this.swiperInstance.el.querySelectorAll('.swiper-wrapper')[0].scrollLeft = 0;
|
|
251
|
+
// // $('.swiper-container')[0].scrollLeft = 0;
|
|
252
|
+
// }
|
|
253
|
+
// });
|
|
254
|
+
// document.querySelectorAll()
|
|
255
|
+
}
|
|
256
|
+
runInZone(callback, ...args) {
|
|
257
|
+
if (!this.zone) {
|
|
258
|
+
callback(args);
|
|
259
|
+
}
|
|
260
|
+
return this.zone.run(() => callback(args));
|
|
261
|
+
}
|
|
262
|
+
onSlideChange(instances) {
|
|
263
|
+
if (!this.swiperReady) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (!this.swiperInstance && instances?.length) {
|
|
267
|
+
this.swiperInstance = instances[0];
|
|
268
|
+
}
|
|
269
|
+
// console.log("Log ~ file: nxs-carousel.component.ts:252 ~ NxsCarouselComponent ~ onSlideChange ~ instances:", instances);
|
|
270
|
+
// this.swiperInstance = instance;
|
|
271
|
+
// this.log('slide change - instance', instance);
|
|
272
|
+
this.runInZone(() => {
|
|
273
|
+
this.currentSlide = this.swiperInstance?.realIndex || 0;
|
|
274
|
+
// console.log("Log ~ file: nxs-carousel.component.ts:256 ~ NxsCarouselComponent ~ this.runInZone ~ this.swiperInstance?.realIndex:", this.swiperInstance);
|
|
275
|
+
this.log('slide change - currentSlide', this.currentSlide);
|
|
276
|
+
this.slideChange.next(this.currentSlide);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselComponent, deps: [{ token: i1.MatDialog }, { token: i0.NgZone }, { token: PLATFORM_ID }, { token: NxsCarouselModuleConfig, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: NxsCarouselComponent, isStandalone: false, selector: "nxs-carousel", inputs: { lazy: "lazy", images: "images", setOptions: ["options", "setOptions"], hasHtmlContent: "hasHtmlContent" }, outputs: { slideChange: "slideChange", slideClick: "slideClick" }, queries: [{ propertyName: "contents", predicate: NxsSwiperTemplateDirective, read: TemplateRef }], viewQueries: [{ propertyName: "swiperComponent", first: true, predicate: ["swiper"], descendants: true }], ngImport: i0, template: "<div *ngIf=\"options\"\n [ngClass]=\"{'swiper-container':true,'nxs-slider-with-thumbnails':!!options.nxsThumbnails && options.nxsThumbnails.show}\"\n [style.height]=\"getMainSliderHeight()\">\n <swiper [config]=\"options\" (swiper)=\"onSwiper($event)\" (slideChange)=\"onSlideChange($event)\"\n [thumbs]=\"{ swiper: thumbnailsSwiperInstance }\">\n <ng-container *ngIf=\"hasHtmlContent\">\n <ng-template *ngFor=\"let slide of contents\" swiperSlide>\n <ng-template [ngTemplateOutlet]=\"slide\" [ngTemplateOutletContext]=\"{\n $implicit: slide\n }\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!hasHtmlContent && images?.length\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img [ngClass]=\"{'nxs-image-slide':true,'swiper-lazy':lazy}\"\n [attr.data-src]=\"lazy ? slideImage.src : null\" [src]=\"lazy ? null : slideImage.src\"\n [attr.alt]=\"slideImage.alt\" />\n <div *ngIf=\"lazy\" class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </ng-container>\n </swiper>\n @if(options?.nxsShowImagesCount){\n <div class=\"nxs-image-counter\">\n {{currentSlide+1}} / {{slidesCount}}\n </div>\n }\n</div>\n\n<div *ngIf=\"thumbnailsOptions && images?.length\"\n [style.height]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight) ? (options.nxsThumbnails.percentHeight + '%'):''\"\n [style.top]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight && options.nxsThumbnails.onMainSlider) ? ('-' + (options.nxsThumbnails.percentHeight) + '%'):''\"\n [ngClass]=\"{'swiper-container':true, 'nxs-slider-thumbnails-container':true,'nxs-slider-thumbnails-on-main-slider':options.nxsThumbnails && options.nxsThumbnails.onMainSlider}\">\n <swiper [config]=\"thumbnailsOptions\" (swiper)=\"onSwiperThumbnails($event)\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img [ngClass]=\"{'nxs-image-slide':true,'swiper-lazy':lazy}\" [attr.data-src]=\"lazy ? slideImage.src : null\"\n [src]=\"lazy ? null : slideImage.src\" [attr.alt]=\"slideImage.alt\" />\n <div *ngIf=\"lazy\" class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </swiper>\n</div>", styles: ["nxs-carousel{display:block;height:100%;position:relative;--swiper-navigation-color: #fff;--swiper-pagination-color: #fff;--swiper-theme-color: #fff}nxs-carousel .swiper-container{width:100%;height:100%;display:block;position:relative}nxs-carousel .swiper-container swiper{height:100%}nxs-carousel .swiper-container .swiper-wrapper .swiper-slide{height:100%;position:relative;width:auto;min-height:50px;background-size:cover;background-position:center;background-repeat:no-repeat}nxs-carousel .swiper-container .nxs-image-slide{height:100%;object-fit:cover;width:100%;object-position:center}nxs-carousel .swiper-container.nxs-slider-with-thumbnails{height:80%}nxs-carousel .swiper-container.nxs-slider-thumbnails-container{height:20%;background:transparent;padding:6px 0}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide{cursor:pointer;border-radius:6px;margin:0 6px;border:2px solid transparent}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide.swiper-slide-thumb-active{border:2px solid lightblue}nxs-carousel .swiper-container.nxs-slider-thumbnails-on-main-slider{top:-20%}nxs-carousel .nxs-image-counter{position:absolute;top:0;right:0;color:#fff;padding:4px;font-weight:700;z-index:10}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.SwiperComponent, selector: "swiper, [swiper]", inputs: ["enabled", "on", "direction", "touchEventsTarget", "initialSlide", "speed", "cssMode", "updateOnWindowResize", "resizeObserver", "nested", "focusableElements", "width", "height", "preventInteractionOnTransition", "userAgent", "url", "edgeSwipeDetection", "edgeSwipeThreshold", "freeMode", "autoHeight", "setWrapperSize", "virtualTranslate", "effect", "breakpoints", "spaceBetween", "slidesPerView", "maxBackfaceHiddenSlides", "grid", "slidesPerGroup", "slidesPerGroupSkip", "centeredSlides", "centeredSlidesBounds", "slidesOffsetBefore", "slidesOffsetAfter", "normalizeSlideIndex", "centerInsufficientSlides", "watchOverflow", "roundLengths", "touchRatio", "touchAngle", "simulateTouch", "shortSwipes", "longSwipes", "longSwipesRatio", "longSwipesMs", "followFinger", "allowTouchMove", "threshold", "touchMoveStopPropagation", "touchStartPreventDefault", "touchStartForcePreventDefault", "touchReleaseOnEdges", "uniqueNavElements", "resistance", "resistanceRatio", "watchSlidesProgress", "grabCursor", "preventClicks", "preventClicksPropagation", "slideToClickedSlide", "preloadImages", "updateOnImagesReady", "loop", "loopAdditionalSlides", "loopedSlides", "loopFillGroupWithBlank", "loopPreventsSlide", "rewind", "allowSlidePrev", "allowSlideNext", "swipeHandler", "noSwiping", "noSwipingClass", "noSwipingSelector", "passiveListeners", "containerModifierClass", "slideClass", "slideBlankClass", "slideActiveClass", "slideDuplicateActiveClass", "slideVisibleClass", "slideDuplicateClass", "slideNextClass", "slideDuplicateNextClass", "slidePrevClass", "slideDuplicatePrevClass", "wrapperClass", "runCallbacksOnInit", "observeParents", "observeSlideChildren", "a11y", "autoplay", "controller", "coverflowEffect", "cubeEffect", "fadeEffect", "flipEffect", "creativeEffect", "cardsEffect", "hashNavigation", "history", "keyboard", "lazy", "mousewheel", "parallax", "thumbs", "zoom", "class", "id", "navigation", "pagination", "scrollbar", "virtual", "config"], outputs: ["_beforeBreakpoint", "_containerClasses", "_slideClass", "_swiper", "activeIndexChange", "afterInit", "autoplay", "autoplayStart", "autoplayStop", "autoplayPause", "autoplayResume", "beforeDestroy", "beforeInit", "beforeLoopFix", "beforeResize", "beforeSlideChangeStart", "beforeTransitionStart", "breakpoint", "changeDirection", "click", "doubleTap", "doubleClick", "destroy", "fromEdge", "hashChange", "hashSet", "imagesReady", "init", "keyPress", "lazyImageLoad", "lazyImageReady", "loopFix", "momentumBounce", "navigationHide", "navigationShow", "observerUpdate", "orientationchange", "paginationHide", "paginationRender", "paginationShow", "paginationUpdate", "progress", "reachBeginning", "reachEnd", "realIndexChange", "resize", "scroll", "scrollbarDragEnd", "scrollbarDragMove", "scrollbarDragStart", "setTransition", "setTranslate", "slideChange", "slideChangeTransitionEnd", "slideChangeTransitionStart", "slideNextTransitionEnd", "slideNextTransitionStart", "slidePrevTransitionEnd", "slidePrevTransitionStart", "slideResetTransitionStart", "slideResetTransitionEnd", "sliderMove", "sliderFirstMove", "slidesLengthChange", "slidesGridLengthChange", "snapGridLengthChange", "snapIndexChange", "tap", "toEdge", "touchEnd", "touchMove", "touchMoveOpposite", "touchStart", "transitionEnd", "transitionStart", "update", "zoomChange", "swiper", "lock", "unlock"] }, { kind: "directive", type: i4.SwiperSlideDirective, selector: "ng-template[swiperSlide]", inputs: ["virtualIndex", "class", "ngClass", "data-swiper-autoplay", "zoom"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
281
|
+
}
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselComponent, decorators: [{
|
|
283
|
+
type: Component,
|
|
284
|
+
args: [{ selector: 'nxs-carousel', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div *ngIf=\"options\"\n [ngClass]=\"{'swiper-container':true,'nxs-slider-with-thumbnails':!!options.nxsThumbnails && options.nxsThumbnails.show}\"\n [style.height]=\"getMainSliderHeight()\">\n <swiper [config]=\"options\" (swiper)=\"onSwiper($event)\" (slideChange)=\"onSlideChange($event)\"\n [thumbs]=\"{ swiper: thumbnailsSwiperInstance }\">\n <ng-container *ngIf=\"hasHtmlContent\">\n <ng-template *ngFor=\"let slide of contents\" swiperSlide>\n <ng-template [ngTemplateOutlet]=\"slide\" [ngTemplateOutletContext]=\"{\n $implicit: slide\n }\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!hasHtmlContent && images?.length\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img [ngClass]=\"{'nxs-image-slide':true,'swiper-lazy':lazy}\"\n [attr.data-src]=\"lazy ? slideImage.src : null\" [src]=\"lazy ? null : slideImage.src\"\n [attr.alt]=\"slideImage.alt\" />\n <div *ngIf=\"lazy\" class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </ng-container>\n </swiper>\n @if(options?.nxsShowImagesCount){\n <div class=\"nxs-image-counter\">\n {{currentSlide+1}} / {{slidesCount}}\n </div>\n }\n</div>\n\n<div *ngIf=\"thumbnailsOptions && images?.length\"\n [style.height]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight) ? (options.nxsThumbnails.percentHeight + '%'):''\"\n [style.top]=\"(!!options.nxsThumbnails && options.nxsThumbnails.show && !!options.nxsThumbnails.percentHeight && options.nxsThumbnails.onMainSlider) ? ('-' + (options.nxsThumbnails.percentHeight) + '%'):''\"\n [ngClass]=\"{'swiper-container':true, 'nxs-slider-thumbnails-container':true,'nxs-slider-thumbnails-on-main-slider':options.nxsThumbnails && options.nxsThumbnails.onMainSlider}\">\n <swiper [config]=\"thumbnailsOptions\" (swiper)=\"onSwiperThumbnails($event)\">\n <ng-template swiperSlide *ngFor=\"let slideImage of images\">\n <img [ngClass]=\"{'nxs-image-slide':true,'swiper-lazy':lazy}\" [attr.data-src]=\"lazy ? slideImage.src : null\"\n [src]=\"lazy ? null : slideImage.src\" [attr.alt]=\"slideImage.alt\" />\n <div *ngIf=\"lazy\" class=\"swiper-lazy-preloader swiper-lazy-preloader-black\"></div>\n </ng-template>\n </swiper>\n</div>", styles: ["nxs-carousel{display:block;height:100%;position:relative;--swiper-navigation-color: #fff;--swiper-pagination-color: #fff;--swiper-theme-color: #fff}nxs-carousel .swiper-container{width:100%;height:100%;display:block;position:relative}nxs-carousel .swiper-container swiper{height:100%}nxs-carousel .swiper-container .swiper-wrapper .swiper-slide{height:100%;position:relative;width:auto;min-height:50px;background-size:cover;background-position:center;background-repeat:no-repeat}nxs-carousel .swiper-container .nxs-image-slide{height:100%;object-fit:cover;width:100%;object-position:center}nxs-carousel .swiper-container.nxs-slider-with-thumbnails{height:80%}nxs-carousel .swiper-container.nxs-slider-thumbnails-container{height:20%;background:transparent;padding:6px 0}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide{cursor:pointer;border-radius:6px;margin:0 6px;border:2px solid transparent}nxs-carousel .swiper-container.nxs-slider-thumbnails-container .swiper-slide.swiper-slide-thumb-active{border:2px solid lightblue}nxs-carousel .swiper-container.nxs-slider-thumbnails-on-main-slider{top:-20%}nxs-carousel .nxs-image-counter{position:absolute;top:0;right:0;color:#fff;padding:4px;font-weight:700;z-index:10}\n"] }]
|
|
285
|
+
}], ctorParameters: () => [{ type: i1.MatDialog }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
286
|
+
type: Inject,
|
|
287
|
+
args: [PLATFORM_ID]
|
|
288
|
+
}] }, { type: NxsCarouselModuleConfig, decorators: [{
|
|
289
|
+
type: Optional
|
|
290
|
+
}] }], propDecorators: { contents: [{
|
|
291
|
+
type: ContentChildren,
|
|
292
|
+
args: [NxsSwiperTemplateDirective, { read: TemplateRef }]
|
|
293
|
+
}], swiperComponent: [{
|
|
294
|
+
type: ViewChild,
|
|
295
|
+
args: ['swiper', { static: false }]
|
|
296
|
+
}], lazy: [{
|
|
297
|
+
type: Input
|
|
298
|
+
}], images: [{
|
|
299
|
+
type: Input
|
|
300
|
+
}], setOptions: [{
|
|
301
|
+
type: Input,
|
|
302
|
+
args: ['options']
|
|
303
|
+
}], hasHtmlContent: [{
|
|
304
|
+
type: Input
|
|
305
|
+
}], slideChange: [{
|
|
306
|
+
type: Output
|
|
307
|
+
}], slideClick: [{
|
|
308
|
+
type: Output
|
|
309
|
+
}] } });
|
|
310
|
+
|
|
311
|
+
class NxsCarouselDialogComponent {
|
|
312
|
+
data;
|
|
313
|
+
dialogRef;
|
|
314
|
+
static dialogOpened = false;
|
|
315
|
+
wrapperClass = 'nxs-carousel-wrapper';
|
|
316
|
+
constructor(data, dialogRef) {
|
|
317
|
+
this.data = data;
|
|
318
|
+
this.dialogRef = dialogRef;
|
|
319
|
+
if (data.wrapperClass)
|
|
320
|
+
this.wrapperClass += ' ' + data.wrapperClass;
|
|
321
|
+
this.dialogRef.afterOpened().subscribe(() => {
|
|
322
|
+
NxsCarouselDialogComponent.dialogOpened = true;
|
|
323
|
+
});
|
|
324
|
+
this.dialogRef.afterClosed().subscribe(() => {
|
|
325
|
+
NxsCarouselDialogComponent.dialogOpened = false;
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
329
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NxsCarouselDialogComponent, isStandalone: false, selector: "nxs-carousel-dialog", ngImport: i0, template: `
|
|
330
|
+
<div class="nxs-carousel-dialog-flex-wrapper">
|
|
331
|
+
<div class="nxs-carousel-dialog-header">
|
|
332
|
+
<button (click)="dialogRef.close()" mat-icon-button><mat-icon>close</mat-icon></button>
|
|
333
|
+
</div>
|
|
334
|
+
<div [class]="wrapperClass">
|
|
335
|
+
<nxs-carousel [options]="data.options" [images]="data.images"></nxs-carousel>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
`, isInline: true, styles: [".nxs-carousel-dialog{max-width:98vw!important;width:98vw;height:98vh}.nxs-carousel-dialog .nxs-carousel-dialog-flex-wrapper{display:flex;height:100%;flex-direction:column}.nxs-carousel-dialog .nxs-carousel-dialog-flex-wrapper .nxs-carousel-wrapper{flex:auto}.nxs-carousel-dialog .nxs-carousel-dialog-header{position:relative;display:flex;justify-content:flex-end;padding-bottom:8px}.nxs-carousel-dialog mat-dialog-container{padding:20px}.nxs-carousel-dialog .nxs-carousel-wrapper{width:100%;margin:auto;height:100%}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: NxsCarouselComponent, selector: "nxs-carousel", inputs: ["lazy", "images", "options", "hasHtmlContent"], outputs: ["slideChange", "slideClick"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
339
|
+
}
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselDialogComponent, decorators: [{
|
|
341
|
+
type: Component,
|
|
342
|
+
args: [{ selector: 'nxs-carousel-dialog', template: `
|
|
343
|
+
<div class="nxs-carousel-dialog-flex-wrapper">
|
|
344
|
+
<div class="nxs-carousel-dialog-header">
|
|
345
|
+
<button (click)="dialogRef.close()" mat-icon-button><mat-icon>close</mat-icon></button>
|
|
346
|
+
</div>
|
|
347
|
+
<div [class]="wrapperClass">
|
|
348
|
+
<nxs-carousel [options]="data.options" [images]="data.images"></nxs-carousel>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
`, encapsulation: ViewEncapsulation.None, standalone: false, styles: [".nxs-carousel-dialog{max-width:98vw!important;width:98vw;height:98vh}.nxs-carousel-dialog .nxs-carousel-dialog-flex-wrapper{display:flex;height:100%;flex-direction:column}.nxs-carousel-dialog .nxs-carousel-dialog-flex-wrapper .nxs-carousel-wrapper{flex:auto}.nxs-carousel-dialog .nxs-carousel-dialog-header{position:relative;display:flex;justify-content:flex-end;padding-bottom:8px}.nxs-carousel-dialog mat-dialog-container{padding:20px}.nxs-carousel-dialog .nxs-carousel-wrapper{width:100%;margin:auto;height:100%}\n"] }]
|
|
352
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
353
|
+
type: Inject,
|
|
354
|
+
args: [MAT_DIALOG_DATA]
|
|
355
|
+
}] }, { type: i1.MatDialogRef }] });
|
|
356
|
+
|
|
357
|
+
class NxsCarouselModule {
|
|
358
|
+
static openDialogSubscribed = false;
|
|
359
|
+
constructor(matDialog) {
|
|
360
|
+
NxsCarouselModule.subscribeToOpenDialog(matDialog);
|
|
361
|
+
}
|
|
362
|
+
static subscribeToOpenDialog(matDialog) {
|
|
363
|
+
if (this.openDialogSubscribed) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
this.openDialogSubscribed = true;
|
|
367
|
+
CarouselEvents.openCarouselDialog.subscribe((data) => {
|
|
368
|
+
if (NxsCarouselDialogComponent.dialogOpened) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
matDialog.open(NxsCarouselDialogComponent, data);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
static forRoot(config) {
|
|
375
|
+
return {
|
|
376
|
+
ngModule: NxsCarouselModule,
|
|
377
|
+
providers: [
|
|
378
|
+
{ provide: NxsCarouselModuleConfig, useValue: config },
|
|
379
|
+
],
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
383
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, declarations: [NxsCarouselComponent,
|
|
384
|
+
NxsCarouselDialogComponent,
|
|
385
|
+
NxsSwiperTemplateDirective], imports: [CommonModule,
|
|
386
|
+
MatIconModule,
|
|
387
|
+
MatButtonModule,
|
|
388
|
+
MatDialogModule,
|
|
389
|
+
SwiperModule], exports: [NxsCarouselComponent,
|
|
390
|
+
NxsSwiperTemplateDirective] });
|
|
391
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, imports: [CommonModule,
|
|
392
|
+
MatIconModule,
|
|
393
|
+
MatButtonModule,
|
|
394
|
+
MatDialogModule,
|
|
395
|
+
SwiperModule] });
|
|
396
|
+
}
|
|
397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NxsCarouselModule, decorators: [{
|
|
398
|
+
type: NgModule,
|
|
399
|
+
args: [{
|
|
400
|
+
declarations: [
|
|
401
|
+
NxsCarouselComponent,
|
|
402
|
+
NxsCarouselDialogComponent,
|
|
403
|
+
NxsSwiperTemplateDirective,
|
|
404
|
+
],
|
|
405
|
+
imports: [
|
|
406
|
+
CommonModule,
|
|
407
|
+
MatIconModule,
|
|
408
|
+
MatButtonModule,
|
|
409
|
+
MatDialogModule,
|
|
410
|
+
SwiperModule,
|
|
411
|
+
],
|
|
412
|
+
exports: [
|
|
413
|
+
NxsCarouselComponent,
|
|
414
|
+
NxsSwiperTemplateDirective,
|
|
415
|
+
],
|
|
416
|
+
}]
|
|
417
|
+
}], ctorParameters: () => [{ type: i1.MatDialog }] });
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Generated bundle index. Do not edit.
|
|
421
|
+
*/
|
|
422
|
+
|
|
423
|
+
export { NxsCarouselComponent, NxsCarouselModule, NxsSwiperTemplateDirective };
|
|
424
|
+
//# sourceMappingURL=nextalys-carousel-lib-nxs-carousel.mjs.map
|