@acorex/cdk 19.2.0 → 19.3.0-next.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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
1
|
import 'swiper/css/bundle';
|
|
3
2
|
import type { Swiper, SwiperOptions } from 'swiper/types';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
@@ -6,11 +5,10 @@ export type AXCarousel = Swiper;
|
|
|
6
5
|
export type AXCarouselOptions = SwiperOptions;
|
|
7
6
|
export declare class AXCarouselDirective {
|
|
8
7
|
#private;
|
|
8
|
+
carousel: import("@angular/core").WritableSignal<Swiper>;
|
|
9
|
+
carouselOptions: import("@angular/core").InputSignal<SwiperOptions>;
|
|
9
10
|
private el;
|
|
10
|
-
|
|
11
|
-
carouselOption: import("@angular/core").InputSignal<SwiperOptions>;
|
|
12
|
-
constructor(el: ElementRef);
|
|
13
|
-
init(container: HTMLElement | string, option?: AXCarouselOptions): Promise<void>;
|
|
11
|
+
private init;
|
|
14
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXCarouselDirective, never>;
|
|
15
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AXCarouselDirective, "[axCarousel]",
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXCarouselDirective, "[axCarousel]", ["axCarousel"], { "carouselOptions": { "alias": "carouselOptions"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
16
14
|
}
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input,
|
|
2
|
+
import { signal, input, inject, ElementRef, effect, Directive } from '@angular/core';
|
|
3
3
|
import 'swiper/css/bundle';
|
|
4
4
|
|
|
5
5
|
class AXCarouselDirective {
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this
|
|
6
|
+
constructor() {
|
|
7
|
+
this.carousel = signal(null);
|
|
8
|
+
this.carouselOptions = input();
|
|
9
|
+
this.el = inject(ElementRef);
|
|
10
|
+
this.#eff = effect(async () => {
|
|
10
11
|
const parentElem = this.el.nativeElement;
|
|
11
|
-
parentElem.
|
|
12
|
-
parentElem.querySelector('.ax-carousel-
|
|
13
|
-
parentElem.querySelector('.ax-carousel-
|
|
14
|
-
parentElem.querySelector('.ax-carousel-
|
|
15
|
-
parentElem.querySelector('.ax-carousel-button-
|
|
16
|
-
|
|
12
|
+
const slides = parentElem.querySelectorAll('.ax-carousel-slide');
|
|
13
|
+
parentElem.querySelector('.ax-carousel-wrapper')?.classList.add('swiper-wrapper');
|
|
14
|
+
parentElem.querySelector('.ax-carousel-pagination')?.classList.add('swiper-pagination');
|
|
15
|
+
parentElem.querySelector('.ax-carousel-scrollbar')?.classList.add('swiper-scrollbar');
|
|
16
|
+
parentElem.querySelector('.ax-carousel-button-prev')?.classList.add('swiper-button-prev');
|
|
17
|
+
parentElem.querySelector('.ax-carousel-button-next')?.classList.add('swiper-button-next');
|
|
18
|
+
slides?.forEach((item) => {
|
|
19
|
+
item.classList.add('swiper-slide');
|
|
20
|
+
});
|
|
21
|
+
await this.init(this.el.nativeElement, this.carouselOptions());
|
|
17
22
|
});
|
|
18
23
|
}
|
|
19
|
-
#
|
|
24
|
+
#eff;
|
|
20
25
|
async init(container, option) {
|
|
21
26
|
const { A11y, Autoplay, Controller, EffectCoverflow, EffectCube, EffectFade, EffectFlip, EffectCreative, EffectCards, HashNavigation, History, Keyboard, Mousewheel, Navigation, Pagination, Parallax, Scrollbar, Thumbs, Virtual, Zoom, FreeMode, Grid, Manipulation, } = await import('swiper/modules');
|
|
22
|
-
|
|
27
|
+
const res = new (await import('swiper')).Swiper(container, {
|
|
23
28
|
...option,
|
|
24
29
|
modules: [
|
|
25
30
|
A11y,
|
|
@@ -47,16 +52,18 @@ class AXCarouselDirective {
|
|
|
47
52
|
Manipulation,
|
|
48
53
|
],
|
|
49
54
|
});
|
|
55
|
+
this.carousel.set(res);
|
|
50
56
|
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCarouselDirective, deps: [
|
|
52
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", type: AXCarouselDirective, isStandalone: true, selector: "[axCarousel]", inputs: {
|
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCarouselDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
58
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", type: AXCarouselDirective, isStandalone: true, selector: "[axCarousel]", inputs: { carouselOptions: { classPropertyName: "carouselOptions", publicName: "carouselOptions", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["axCarousel"], ngImport: i0 }); }
|
|
53
59
|
}
|
|
54
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXCarouselDirective, decorators: [{
|
|
55
61
|
type: Directive,
|
|
56
62
|
args: [{
|
|
57
63
|
selector: '[axCarousel]',
|
|
64
|
+
exportAs: 'axCarousel',
|
|
58
65
|
}]
|
|
59
|
-
}]
|
|
66
|
+
}] });
|
|
60
67
|
|
|
61
68
|
/**
|
|
62
69
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-carousel.mjs","sources":["../../../../libs/cdk/carousel/src/carousel.directive.ts","../../../../libs/cdk/carousel/src/acorex-cdk-carousel.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"acorex-cdk-carousel.mjs","sources":["../../../../libs/cdk/carousel/src/carousel.directive.ts","../../../../libs/cdk/carousel/src/acorex-cdk-carousel.ts"],"sourcesContent":["import { Directive, effect, ElementRef, inject, input, signal } from '@angular/core';\nimport 'swiper/css/bundle';\nimport type { Swiper, SwiperOptions } from 'swiper/types';\n\nexport type AXCarousel = Swiper;\nexport type AXCarouselOptions = SwiperOptions;\n\n@Directive({\n selector: '[axCarousel]',\n exportAs: 'axCarousel',\n})\nexport class AXCarouselDirective {\n carousel = signal<AXCarousel>(null);\n carouselOptions = input<AXCarouselOptions>();\n private el = inject(ElementRef);\n\n #eff = effect(async () => {\n const parentElem = this.el.nativeElement as HTMLElement;\n const slides = parentElem.querySelectorAll('.ax-carousel-slide');\n\n parentElem.querySelector('.ax-carousel-wrapper')?.classList.add('swiper-wrapper');\n parentElem.querySelector('.ax-carousel-pagination')?.classList.add('swiper-pagination');\n parentElem.querySelector('.ax-carousel-scrollbar')?.classList.add('swiper-scrollbar');\n parentElem.querySelector('.ax-carousel-button-prev')?.classList.add('swiper-button-prev');\n parentElem.querySelector('.ax-carousel-button-next')?.classList.add('swiper-button-next');\n\n slides?.forEach((item) => {\n item.classList.add('swiper-slide');\n });\n\n await this.init(this.el.nativeElement, this.carouselOptions());\n });\n\n private async init(container: HTMLElement | string, option?: AXCarouselOptions) {\n const {\n A11y,\n Autoplay,\n Controller,\n EffectCoverflow,\n EffectCube,\n EffectFade,\n EffectFlip,\n EffectCreative,\n EffectCards,\n HashNavigation,\n History,\n Keyboard,\n Mousewheel,\n Navigation,\n Pagination,\n Parallax,\n Scrollbar,\n Thumbs,\n Virtual,\n Zoom,\n FreeMode,\n Grid,\n Manipulation,\n } = await import('swiper/modules');\n\n const res = new (await import('swiper')).Swiper(container, {\n ...option,\n modules: [\n A11y,\n Autoplay,\n Controller,\n EffectCoverflow,\n EffectCube,\n EffectFade,\n EffectFlip,\n EffectCreative,\n EffectCards,\n HashNavigation,\n History,\n Keyboard,\n Mousewheel,\n Navigation,\n Pagination,\n Parallax,\n Scrollbar,\n Thumbs,\n Virtual,\n Zoom,\n FreeMode,\n Grid,\n Manipulation,\n ],\n });\n\n this.carousel.set(res);\n }\n}\n","/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