ngx-freshok-carousel 0.0.2
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/README.md +63 -0
- package/fesm2022/ngx-freshok-carousel.mjs +546 -0
- package/fesm2022/ngx-freshok-carousel.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/ngx-carousel-controls/ngx-carousel-controls.component.d.ts +9 -0
- package/lib/ngx-carousel.component.d.ts +27 -0
- package/lib/ngx-carousel.types.d.ts +20 -0
- package/lib/services/ngx-autoplay..service.d.ts +15 -0
- package/lib/services/ngx-carousel.service.d.ts +17 -0
- package/lib/services/ngx-layout.service.d.ts +9 -0
- package/lib/services/ngx-state.service.d.ts +42 -0
- package/lib/services/ngx-swipe.service.d.ts +24 -0
- package/package.json +42 -0
- package/public-api.d.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Carousel
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build carousel
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/carousel
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, signal, inject, computed, effect, Injectable, Component, Renderer2, ContentChild, ViewChild, Input } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_CAROUSEL_CONFIG = {
|
|
6
|
+
autoplay: true, // автопроигрывание слайдов
|
|
7
|
+
interval: 5000, // время переключения слайдов
|
|
8
|
+
loop: true, // бесконечная прокрутка
|
|
9
|
+
pauseOnHover: true, // останавливать автопрокрутку при наведении
|
|
10
|
+
animation: 'slide', // тип анимации
|
|
11
|
+
startIndex: 0, // начальный номер слайда
|
|
12
|
+
slidesToShow: 1, // по умолчанию показываем 1 слайд
|
|
13
|
+
showArrows: true,
|
|
14
|
+
showDots: true,
|
|
15
|
+
spaceBetween: 0,
|
|
16
|
+
speed: 500,
|
|
17
|
+
breakpoints: [], // по умолчанию нет брейкпоинтов
|
|
18
|
+
};
|
|
19
|
+
const NGX_CAROUSEL_CONFIG = new InjectionToken('NGX_CAROUSEL_CONFIG');
|
|
20
|
+
|
|
21
|
+
class NgxStateService {
|
|
22
|
+
config = signal({});
|
|
23
|
+
width = signal(0);
|
|
24
|
+
slides = signal([]);
|
|
25
|
+
currentSlide = signal(0);
|
|
26
|
+
appCfg = inject(NGX_CAROUSEL_CONFIG, { optional: true });
|
|
27
|
+
/* ========= ACTIVECONFIG ========= */
|
|
28
|
+
activeConfig = computed(() => {
|
|
29
|
+
return {
|
|
30
|
+
...DEFAULT_CAROUSEL_CONFIG,
|
|
31
|
+
...this.appCfg ?? {},
|
|
32
|
+
...this.config(),
|
|
33
|
+
...this.activeBreakpoint() ?? {}
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
slidesToShow = computed(() => this.activeConfig().slidesToShow ?? 1);
|
|
37
|
+
autoplay = computed(() => this.activeConfig().autoplay ?? true);
|
|
38
|
+
interval = computed(() => this.activeConfig().interval ?? 5000);
|
|
39
|
+
pauseOnHover = computed(() => this.activeConfig().pauseOnHover ?? true);
|
|
40
|
+
space = computed(() => this.activeConfig().spaceBetween ?? 0);
|
|
41
|
+
isFade = computed(() => this.activeConfig().animation === 'fade');
|
|
42
|
+
loop = computed(() => this.activeConfig().loop);
|
|
43
|
+
isArrows = computed(() => this.activeConfig().showArrows);
|
|
44
|
+
isDots = computed(() => this.activeConfig().showDots);
|
|
45
|
+
speed = computed(() => this.activeConfig().speed ?? 500);
|
|
46
|
+
/* ========= BREAKPOINTS ========= */
|
|
47
|
+
activeBreakpoint = computed(() => {
|
|
48
|
+
const breakpoints = this.config().breakpoints ?? [];
|
|
49
|
+
const w = this.width();
|
|
50
|
+
return [...breakpoints]
|
|
51
|
+
.sort((a, b) => b.breakpoint - a.breakpoint)
|
|
52
|
+
.find(bp => w >= bp.breakpoint) ?? null;
|
|
53
|
+
});
|
|
54
|
+
/* ========= CLONES ========= */
|
|
55
|
+
slidesWithClones = computed(() => {
|
|
56
|
+
if (this.isFade()) {
|
|
57
|
+
return this.slides();
|
|
58
|
+
}
|
|
59
|
+
const slides = this.slides();
|
|
60
|
+
const count = this.slidesToShow();
|
|
61
|
+
if (!this.loop() || slides.length < count) {
|
|
62
|
+
return slides;
|
|
63
|
+
}
|
|
64
|
+
return [
|
|
65
|
+
...slides.slice(-count),
|
|
66
|
+
...slides,
|
|
67
|
+
...slides.slice(0, count),
|
|
68
|
+
];
|
|
69
|
+
});
|
|
70
|
+
constructor() {
|
|
71
|
+
effect(() => {
|
|
72
|
+
const slides = this.slides();
|
|
73
|
+
const cfg = this.activeConfig();
|
|
74
|
+
if (!slides.length)
|
|
75
|
+
return;
|
|
76
|
+
const index = this.loop() ?
|
|
77
|
+
(cfg.startIndex ?? 0) + this.slidesToShow() :
|
|
78
|
+
cfg.startIndex ?? 0;
|
|
79
|
+
this.setCurrentSlide(index);
|
|
80
|
+
});
|
|
81
|
+
// setInterval(() => {
|
|
82
|
+
// console.log("ACTIVE", this.activeConfig())
|
|
83
|
+
// }, 1000)
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
console.log("ACTIVE", this.activeConfig());
|
|
86
|
+
}, 2000);
|
|
87
|
+
}
|
|
88
|
+
/* ========= INIT ========= */
|
|
89
|
+
init(customConfig = {}) {
|
|
90
|
+
this.config.set({
|
|
91
|
+
...DEFAULT_CAROUSEL_CONFIG,
|
|
92
|
+
...this.appCfg ?? {},
|
|
93
|
+
...customConfig
|
|
94
|
+
});
|
|
95
|
+
// console.log("🔸 this.config:", this.config())
|
|
96
|
+
}
|
|
97
|
+
setWidth(width) {
|
|
98
|
+
this.width.set(width);
|
|
99
|
+
// console.log("ACTIVE", this.activeConfig())
|
|
100
|
+
}
|
|
101
|
+
setSlides(slides) {
|
|
102
|
+
this.slides.set(slides);
|
|
103
|
+
}
|
|
104
|
+
setCurrentSlide(index) {
|
|
105
|
+
this.currentSlide.set(index);
|
|
106
|
+
}
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
108
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxStateService });
|
|
109
|
+
}
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxStateService, decorators: [{
|
|
111
|
+
type: Injectable
|
|
112
|
+
}], ctorParameters: () => [] });
|
|
113
|
+
|
|
114
|
+
class NgxCarouselService {
|
|
115
|
+
state = inject(NgxStateService);
|
|
116
|
+
jumpTimer = null;
|
|
117
|
+
disableTransition = signal(false);
|
|
118
|
+
isAnimating = signal(false);
|
|
119
|
+
next() {
|
|
120
|
+
if (!this.startAnimation())
|
|
121
|
+
return;
|
|
122
|
+
const length = this.state.slidesWithClones().length;
|
|
123
|
+
if (length <= 1)
|
|
124
|
+
return;
|
|
125
|
+
if (this.state.isFade()) {
|
|
126
|
+
const nextNum = (this.state.currentSlide() + 1) % length;
|
|
127
|
+
this.state.setCurrentSlide(nextNum);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.disableTransition.set(false);
|
|
131
|
+
const current = this.state.currentSlide();
|
|
132
|
+
const slidesToShow = this.state.slidesToShow();
|
|
133
|
+
if (this.state.loop()) {
|
|
134
|
+
// Переходим к следующему слайду (даже если это клон)
|
|
135
|
+
this.state.setCurrentSlide(current + 1);
|
|
136
|
+
// Если достигли клона
|
|
137
|
+
if (current + slidesToShow >= length - 1) {
|
|
138
|
+
// Сбрасываем на первый оригинальный слайд
|
|
139
|
+
const index = this.getRealIndex(current + 1);
|
|
140
|
+
this.scheduleJumpToReal(index);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else if (current + 1 < length) {
|
|
144
|
+
// В режиме без loop просто проверяем границы
|
|
145
|
+
this.state.setCurrentSlide(current + 1);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
prev() {
|
|
149
|
+
if (!this.startAnimation())
|
|
150
|
+
return;
|
|
151
|
+
const length = this.state.slidesWithClones().length;
|
|
152
|
+
if (length <= 1)
|
|
153
|
+
return;
|
|
154
|
+
if (this.state.isFade()) {
|
|
155
|
+
const prev = (this.state.currentSlide() - 1 + length) % length;
|
|
156
|
+
this.state.setCurrentSlide(prev);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.disableTransition.set(false);
|
|
160
|
+
const current = this.state.currentSlide();
|
|
161
|
+
const slidesToShow = this.state.slidesToShow();
|
|
162
|
+
if (this.state.activeConfig().loop) {
|
|
163
|
+
// Переходим к предыдущему слайду (даже если это клон)
|
|
164
|
+
this.state.setCurrentSlide(current - 1);
|
|
165
|
+
if (current - slidesToShow <= 0) {
|
|
166
|
+
const index = this.getRealIndex(current - 1);
|
|
167
|
+
this.scheduleJumpToReal(index);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else if (current > 0) {
|
|
171
|
+
this.state.setCurrentSlide(current - 1);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
scheduleJumpToReal(realIndex) {
|
|
175
|
+
//Если таймер уже запущен, то остановить и обнулить
|
|
176
|
+
if (this.jumpTimer) {
|
|
177
|
+
clearTimeout(this.jumpTimer);
|
|
178
|
+
this.jumpTimer = null;
|
|
179
|
+
}
|
|
180
|
+
const slidesToShow = this.state.slidesToShow();
|
|
181
|
+
const realTarget = realIndex + slidesToShow;
|
|
182
|
+
// Заново запысываем новый таймер
|
|
183
|
+
this.jumpTimer = setTimeout(() => {
|
|
184
|
+
this.disableTransition.set(true);
|
|
185
|
+
this.state.setCurrentSlide(realTarget);
|
|
186
|
+
requestAnimationFrame(() => {
|
|
187
|
+
requestAnimationFrame(() => {
|
|
188
|
+
this.disableTransition.set(false);
|
|
189
|
+
if (this.jumpTimer) {
|
|
190
|
+
clearTimeout(this.jumpTimer);
|
|
191
|
+
this.jumpTimer = null;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}, this.state.speed());
|
|
196
|
+
}
|
|
197
|
+
goTo(index) {
|
|
198
|
+
const length = this.state.slides().length;
|
|
199
|
+
if (length <= 0)
|
|
200
|
+
return;
|
|
201
|
+
const slidestToShow = this.state.slidesToShow();
|
|
202
|
+
if (this.state.loop()) {
|
|
203
|
+
// В режиме loop просто устанавливаем целевой индекс
|
|
204
|
+
this.state.setCurrentSlide(index + slidestToShow);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
this.state.setCurrentSlide(index);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
getDisplayIndex() {
|
|
211
|
+
const length = this.state.slidesWithClones().length;
|
|
212
|
+
if (length <= 0)
|
|
213
|
+
return 0;
|
|
214
|
+
const current = this.state.currentSlide();
|
|
215
|
+
const slidesToShow = this.state.slidesToShow();
|
|
216
|
+
// Если loop отключен, то просто вернем индекс текущего слайда
|
|
217
|
+
if (!this.state.loop())
|
|
218
|
+
return current;
|
|
219
|
+
// Если на клоне последнего (индекс 0), показываем последний реальный
|
|
220
|
+
if (current === 0)
|
|
221
|
+
return length - 1;
|
|
222
|
+
// Если на клоне первого (индекс len + 1), показываем первый реальный
|
|
223
|
+
if (current === length - slidesToShow)
|
|
224
|
+
return 0;
|
|
225
|
+
// Иначе вычитаем slidesToShow, так как реальные слайды начинаются с индекса slidesToShow
|
|
226
|
+
return current - slidesToShow;
|
|
227
|
+
}
|
|
228
|
+
startAnimation() {
|
|
229
|
+
if (this.isAnimating())
|
|
230
|
+
return false;
|
|
231
|
+
this.isAnimating.set(true);
|
|
232
|
+
const duration = this.state.speed();
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
this.isAnimating.set(false);
|
|
235
|
+
}, duration);
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
getRealIndex(virtualIndex) {
|
|
239
|
+
const length = this.state.slides().length;
|
|
240
|
+
const slidesToShow = this.state.slidesToShow();
|
|
241
|
+
if (!this.state.loop())
|
|
242
|
+
return virtualIndex;
|
|
243
|
+
let real = virtualIndex - slidesToShow;
|
|
244
|
+
if (real < 0)
|
|
245
|
+
real += length;
|
|
246
|
+
if (real >= length)
|
|
247
|
+
real -= length;
|
|
248
|
+
return real;
|
|
249
|
+
}
|
|
250
|
+
shiftBy(slidesDragged) {
|
|
251
|
+
if (slidesDragged === 0)
|
|
252
|
+
return;
|
|
253
|
+
if (!this.startAnimation())
|
|
254
|
+
return;
|
|
255
|
+
const current = this.state.currentSlide();
|
|
256
|
+
const slidesToShow = this.state.slidesToShow();
|
|
257
|
+
const total = this.state.slidesWithClones().length;
|
|
258
|
+
let target = current + slidesDragged;
|
|
259
|
+
this.disableTransition.set(false);
|
|
260
|
+
if (!this.state.loop()) {
|
|
261
|
+
const max = total - slidesToShow;
|
|
262
|
+
target = Math.max(0, Math.min(target, max));
|
|
263
|
+
this.state.setCurrentSlide(target);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
this.state.setCurrentSlide(target);
|
|
267
|
+
// вычисляем РЕАЛЬНЫЙ индекс
|
|
268
|
+
const realIndex = this.getRealIndex(target);
|
|
269
|
+
// если ушли в клоны — снапаемся туда же, но в реальной зоне
|
|
270
|
+
if (target < slidesToShow || target >= total - slidesToShow) {
|
|
271
|
+
this.scheduleJumpToReal(realIndex);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
275
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselService });
|
|
276
|
+
}
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselService, decorators: [{
|
|
278
|
+
type: Injectable
|
|
279
|
+
}] });
|
|
280
|
+
|
|
281
|
+
class NgxCarouselControlsComponent {
|
|
282
|
+
carousel = inject(NgxCarouselService);
|
|
283
|
+
state = inject(NgxStateService);
|
|
284
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
285
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: NgxCarouselControlsComponent, isStandalone: true, selector: "lib-ngx-carousel-controls", ngImport: i0, template: "@if(state.isArrows()) {\r\n <div class=\"ngx-carousel__controls\">\r\n <button\r\n (click)=\"carousel.prev()\"\r\n >\r\n Prev\r\n </button>\r\n \r\n <button\r\n (click)=\"carousel.next()\"\r\n >\r\n Next\r\n </button>\r\n </div>\r\n}\r\n\r\n@if(state.isDots()) {\r\n <div class=\"ngx-carousel__controls bullets\">\r\n <div \r\n class=\"ngx-carousel__dots\"\r\n >\r\n @for(dot of state.slides(); track $index; let i = $index) {\r\n <button\r\n class=\"ngx-carousel__dot\"\r\n [class.active]=\"carousel.getDisplayIndex() == i\"\r\n (click)=\"carousel.goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n </div>\r\n}\r\n\r\n\r\n", styles: [".ngx-carousel__controls{position:absolute;display:flex;align-items:center;justify-content:space-between;padding:0 20px;top:var(--user-controls-top, 50%);transform:translateY(-50%);left:0;right:0;pointer-events:none}.ngx-carousel__controls.bullets{top:unset;bottom:10px}button{pointer-events:auto;cursor:pointer}.ngx-carousel__dots{position:absolute;bottom:20px;left:50%;transform:translate(-50%);display:flex;align-items:center;justify-content:center;gap:20px}.ngx-carousel__dot{pointer-events:auto;cursor:pointer;width:20px;height:20px;border:2px solid blue;background-color:#ff0;border-radius:50%}.ngx-carousel__dot.active{background-color:orange}\n"] });
|
|
286
|
+
}
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselControlsComponent, decorators: [{
|
|
288
|
+
type: Component,
|
|
289
|
+
args: [{ selector: 'lib-ngx-carousel-controls', imports: [], template: "@if(state.isArrows()) {\r\n <div class=\"ngx-carousel__controls\">\r\n <button\r\n (click)=\"carousel.prev()\"\r\n >\r\n Prev\r\n </button>\r\n \r\n <button\r\n (click)=\"carousel.next()\"\r\n >\r\n Next\r\n </button>\r\n </div>\r\n}\r\n\r\n@if(state.isDots()) {\r\n <div class=\"ngx-carousel__controls bullets\">\r\n <div \r\n class=\"ngx-carousel__dots\"\r\n >\r\n @for(dot of state.slides(); track $index; let i = $index) {\r\n <button\r\n class=\"ngx-carousel__dot\"\r\n [class.active]=\"carousel.getDisplayIndex() == i\"\r\n (click)=\"carousel.goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n </div>\r\n}\r\n\r\n\r\n", styles: [".ngx-carousel__controls{position:absolute;display:flex;align-items:center;justify-content:space-between;padding:0 20px;top:var(--user-controls-top, 50%);transform:translateY(-50%);left:0;right:0;pointer-events:none}.ngx-carousel__controls.bullets{top:unset;bottom:10px}button{pointer-events:auto;cursor:pointer}.ngx-carousel__dots{position:absolute;bottom:20px;left:50%;transform:translate(-50%);display:flex;align-items:center;justify-content:center;gap:20px}.ngx-carousel__dot{pointer-events:auto;cursor:pointer;width:20px;height:20px;border:2px solid blue;background-color:#ff0;border-radius:50%}.ngx-carousel__dot.active{background-color:orange}\n"] }]
|
|
290
|
+
}] });
|
|
291
|
+
|
|
292
|
+
class NgxAutoplayService {
|
|
293
|
+
carousel = inject(NgxCarouselService);
|
|
294
|
+
state = inject(NgxStateService);
|
|
295
|
+
isPlaying = signal(true);
|
|
296
|
+
timerAutoplay = null;
|
|
297
|
+
constructor() {
|
|
298
|
+
effect(() => {
|
|
299
|
+
if (!this.state.autoplay() || this.state.slides().length <= 1) {
|
|
300
|
+
this.stop();
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.state.autoplay() ?
|
|
304
|
+
this.resume() :
|
|
305
|
+
this.stop();
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
start() {
|
|
309
|
+
if (!this.state.autoplay() || !this.isPlaying())
|
|
310
|
+
return;
|
|
311
|
+
this.stop();
|
|
312
|
+
const delay = this.state.interval() ?? 5000;
|
|
313
|
+
this.timerAutoplay = setInterval(() => this.carousel.next(), delay);
|
|
314
|
+
}
|
|
315
|
+
stop() {
|
|
316
|
+
this.isPlaying.set(false);
|
|
317
|
+
if (this.timerAutoplay) {
|
|
318
|
+
clearInterval(this.timerAutoplay);
|
|
319
|
+
this.timerAutoplay = null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
pause() {
|
|
323
|
+
if (this.state.pauseOnHover()) {
|
|
324
|
+
this.stop();
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
resume() {
|
|
328
|
+
if (this.state.autoplay()) {
|
|
329
|
+
this.isPlaying.set(true);
|
|
330
|
+
setTimeout(() => this.start(), 0);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxAutoplayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
334
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxAutoplayService });
|
|
335
|
+
}
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxAutoplayService, decorators: [{
|
|
337
|
+
type: Injectable
|
|
338
|
+
}], ctorParameters: () => [] });
|
|
339
|
+
|
|
340
|
+
class NgxLayoutService {
|
|
341
|
+
state = inject(NgxStateService);
|
|
342
|
+
/* ========= GEOMETRY ========= */
|
|
343
|
+
slideWidthPx = computed(() => this.state.width() / this.state.slidesToShow() - this.state.space() / 2);
|
|
344
|
+
slideStepPx = computed(() => this.slideWidthPx() + this.state.space());
|
|
345
|
+
translatePx = computed(() => {
|
|
346
|
+
if (this.state.isFade())
|
|
347
|
+
return 'none';
|
|
348
|
+
return `translate(-${this.state.currentSlide() * this.slideStepPx()}px)`;
|
|
349
|
+
});
|
|
350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxLayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
351
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxLayoutService });
|
|
352
|
+
}
|
|
353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxLayoutService, decorators: [{
|
|
354
|
+
type: Injectable
|
|
355
|
+
}] });
|
|
356
|
+
|
|
357
|
+
class NgxSwipeService {
|
|
358
|
+
// Порог в пикселях для различения клика и свайпа
|
|
359
|
+
CLICK_LIMIT = 5; // px
|
|
360
|
+
SWIPE_LIMIT = 0.05; // %
|
|
361
|
+
carousel = inject(NgxCarouselService);
|
|
362
|
+
autoplay = inject(NgxAutoplayService);
|
|
363
|
+
state = inject(NgxStateService);
|
|
364
|
+
layout = inject(NgxLayoutService);
|
|
365
|
+
renderer;
|
|
366
|
+
carouselList;
|
|
367
|
+
startX = 0;
|
|
368
|
+
currentX = 0;
|
|
369
|
+
isSwiping = signal(false);
|
|
370
|
+
// private config = computed(() => this.carousel.getConfig())
|
|
371
|
+
// Определяем, был ли свайп достаточным, чтобы считать его жестом, а не кликом.
|
|
372
|
+
// Будет использоваться для блокировки кликов по ссылкам.
|
|
373
|
+
isSwipedEnough = signal(false);
|
|
374
|
+
registerSlideList(element) {
|
|
375
|
+
this.carouselList = element;
|
|
376
|
+
}
|
|
377
|
+
setRenderer(renderer) {
|
|
378
|
+
this.renderer = renderer;
|
|
379
|
+
}
|
|
380
|
+
onPointerDown(event) {
|
|
381
|
+
if (this.carousel.isAnimating())
|
|
382
|
+
return;
|
|
383
|
+
this.startX = event.clientX;
|
|
384
|
+
this.currentX = 0;
|
|
385
|
+
this.isSwipedEnough.set(false);
|
|
386
|
+
this.isSwiping.set(true);
|
|
387
|
+
this.autoplay.stop();
|
|
388
|
+
// Отключаем transition в начале свайпа (через Renderer2)
|
|
389
|
+
this.renderer.setStyle(this.carouselList.nativeElement, 'transition', 'none');
|
|
390
|
+
}
|
|
391
|
+
onPointerMove(event) {
|
|
392
|
+
this.currentX = event.clientX - this.startX;
|
|
393
|
+
if (this.state.isFade())
|
|
394
|
+
return;
|
|
395
|
+
if (!this.isSwiping())
|
|
396
|
+
return;
|
|
397
|
+
// Если отключена бесконечная прокрутка, то останавливаем свайп
|
|
398
|
+
// при достижении первого и последнего слайда
|
|
399
|
+
if (!this.state.loop()) {
|
|
400
|
+
const length = this.state.slides().length;
|
|
401
|
+
const current = this.state.currentSlide();
|
|
402
|
+
const slidesToshow = this.state.slidesToShow();
|
|
403
|
+
if ((current <= 0) && (this.currentX > 0))
|
|
404
|
+
return; // свайпаем на предыдущий слайд
|
|
405
|
+
if ((current >= length - slidesToshow) && (this.currentX < 0))
|
|
406
|
+
return; // свайпаем на следующий слайд
|
|
407
|
+
}
|
|
408
|
+
// Проверяем, превысили ли мы порог, чтобы считать это "свайпом", а не кликом
|
|
409
|
+
if (Math.abs(this.currentX) > this.CLICK_LIMIT) {
|
|
410
|
+
this.isSwipedEnough.set(true);
|
|
411
|
+
// pointercapture гарантирует, что все pointermove события будут приходить на этот элемент,
|
|
412
|
+
// даже если палец/мышь вышли за пределы слайдера.
|
|
413
|
+
// Без него свайп часто "обрывается", если пользователь ведёт чуть в сторону.
|
|
414
|
+
this.carouselList.nativeElement.setPointerCapture(event.pointerId);
|
|
415
|
+
}
|
|
416
|
+
// Смещение в пикселях к текущему слайду
|
|
417
|
+
const baseTranslate = -this.state.currentSlide() * this.layout.slideStepPx();
|
|
418
|
+
// Смещение в пикселях (текущее + пользовательское)
|
|
419
|
+
const offsetPx = baseTranslate + this.currentX;
|
|
420
|
+
// Обновляем transform напрямую
|
|
421
|
+
this.renderer.setStyle(this.carouselList.nativeElement, 'transform', `translateX(${offsetPx}px)`);
|
|
422
|
+
}
|
|
423
|
+
onPointerUp(event) {
|
|
424
|
+
if (this.state.isFade()) {
|
|
425
|
+
if (this.currentX < -50)
|
|
426
|
+
this.carousel.next();
|
|
427
|
+
if (this.currentX > 50)
|
|
428
|
+
this.carousel.prev();
|
|
429
|
+
this.isSwiping.set(false);
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
if (!this.isSwiping())
|
|
433
|
+
return;
|
|
434
|
+
// 1. Включаем transition обратно, прежде чем менять currentSlide()
|
|
435
|
+
this.renderer.setStyle(this.carouselList.nativeElement, 'transition', `transform ${this.state.speed()}ms ease`);
|
|
436
|
+
const swipeDistance = this.currentX;
|
|
437
|
+
const limit = this.carouselList.nativeElement.clientWidth * this.SWIPE_LIMIT;
|
|
438
|
+
const step = this.layout.slideStepPx();
|
|
439
|
+
const slidesDragged = Math.round(swipeDistance / step) * -1; // сколько слайдов было пролистано за одно перерягивание. Домножаем на -1 так как направление перетягивания swipeDistance по своему знаку противоположно той стороне, куда нужно сместить слайды. То есть при свайпе вправо (листаем вперед), swipeDistance станет отрицательным, а слайды нам нужно сдвинуть в бОльшую сторону
|
|
440
|
+
if (swipeDistance < -limit) {
|
|
441
|
+
Math.abs(slidesDragged) > 0 ?
|
|
442
|
+
this.carousel.shiftBy(slidesDragged) :
|
|
443
|
+
this.carousel.next();
|
|
444
|
+
}
|
|
445
|
+
else if (swipeDistance > limit) {
|
|
446
|
+
Math.abs(slidesDragged) > 0 ?
|
|
447
|
+
this.carousel.shiftBy(slidesDragged) :
|
|
448
|
+
this.carousel.prev();
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
// Возврат на место, так как длинна свайпа недостаточная по длинне
|
|
452
|
+
// (так как transition уже включен, это будет плавно)
|
|
453
|
+
this.snapBack();
|
|
454
|
+
}
|
|
455
|
+
// 2. Сбрасываем флаги
|
|
456
|
+
this.isSwiping.set(false);
|
|
457
|
+
this.isSwipedEnough.set(false);
|
|
458
|
+
this.currentX = 0;
|
|
459
|
+
this.autoplay.resume();
|
|
460
|
+
}
|
|
461
|
+
snapBack() {
|
|
462
|
+
const offsetPx = -this.state.currentSlide() * this.layout.slideStepPx();
|
|
463
|
+
// Просто устанавливаем transform в текущую позицию. Transition уже включен в onPointerUp.
|
|
464
|
+
this.renderer
|
|
465
|
+
.setStyle(this.carouselList.nativeElement, 'transform', `translateX(${offsetPx}px)`);
|
|
466
|
+
}
|
|
467
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxSwipeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
468
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxSwipeService });
|
|
469
|
+
}
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxSwipeService, decorators: [{
|
|
471
|
+
type: Injectable
|
|
472
|
+
}] });
|
|
473
|
+
|
|
474
|
+
class NgxCarouselComponent {
|
|
475
|
+
slides;
|
|
476
|
+
config;
|
|
477
|
+
carouselList;
|
|
478
|
+
slideTemplate;
|
|
479
|
+
controlsTemplate;
|
|
480
|
+
renderer = inject(Renderer2);
|
|
481
|
+
resizeObserver;
|
|
482
|
+
carousel = inject(NgxCarouselService);
|
|
483
|
+
autoplay = inject(NgxAutoplayService);
|
|
484
|
+
swipe = inject(NgxSwipeService);
|
|
485
|
+
state = inject(NgxStateService);
|
|
486
|
+
layout = inject(NgxLayoutService);
|
|
487
|
+
ngOnInit() {
|
|
488
|
+
this.watchResize();
|
|
489
|
+
this.state.init(this.config);
|
|
490
|
+
this.state.setSlides(this.slides);
|
|
491
|
+
}
|
|
492
|
+
ngAfterViewInit() {
|
|
493
|
+
this.swipe.registerSlideList(this.carouselList);
|
|
494
|
+
this.swipe.setRenderer(this.renderer);
|
|
495
|
+
this.resizeObserver.observe(this.carouselList.nativeElement);
|
|
496
|
+
}
|
|
497
|
+
watchResize() {
|
|
498
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
499
|
+
const width = entries[0].contentRect.width;
|
|
500
|
+
this.state.setWidth(width);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
504
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: NgxCarouselComponent, isStandalone: true, selector: "lib-ngx-carousel", inputs: { slides: "slides", config: "config" }, providers: [
|
|
505
|
+
NgxCarouselService,
|
|
506
|
+
NgxAutoplayService,
|
|
507
|
+
NgxSwipeService,
|
|
508
|
+
NgxStateService,
|
|
509
|
+
NgxLayoutService,
|
|
510
|
+
], queries: [{ propertyName: "slideTemplate", first: true, predicate: ["slideTemplate"], descendants: true, static: true }, { propertyName: "controlsTemplate", first: true, predicate: ["controlsTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "carouselList", first: true, predicate: ["carouselList"], descendants: true, static: true }], ngImport: i0, template: "<div\r\n class=\"ngx-carousel\"\r\n (keydown.arrowRight)=\"carousel.next()\"\r\n (keydown.arrowLeft)=\"carousel.prev()\"\r\n (mouseleave)=\"autoplay.resume()\"\r\n (mouseover)=\"autoplay.pause()\"\r\n (focusin)=\"autoplay.pause()\"\r\n (focusout)=\"autoplay.resume()\"\r\n>\r\n <ul\r\n #carouselList\r\n class=\"ngx-carousel__list\"\r\n [class.no-transition]=\"carousel.disableTransition()\"\r\n [style.transform]=\"layout.translatePx()\"\r\n [style.transition]=\"`transform ${state.speed()}ms ease`\"\r\n (pointerdown)=\"swipe.onPointerDown($event)\"\r\n (pointermove)=\"swipe.onPointerMove($event)\"\r\n (pointerup)=\"swipe.onPointerUp($event)\"\r\n (pointercancel)=\"swipe.onPointerUp($event)\"\r\n (pointerleave)=\"swipe.onPointerUp($event)\"\r\n >\r\n @for(slideData of state.slidesWithClones(); track $index; let i = $index) {\r\n <li\r\n class=\"ngx-carousel__slide\"\r\n [class.active]=\"i === state.currentSlide()\"\r\n [style.width]=\"layout.slideWidthPx() + 'px'\"\r\n [style.marginRight.px]=\"state.space()\"\r\n >\r\n <ng-container \r\n [ngTemplateOutlet]=\"slideTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: slideData, index: i }\"\r\n ></ng-container>\r\n </li>\r\n } \r\n </ul>\r\n\r\n @if(controlsTemplate) {\r\n <ng-container \r\n [ngTemplateOutlet]=\"controlsTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: carousel}\"\r\n />\r\n } @else {\r\n <lib-ngx-carousel-controls />\r\n }\r\n</div>\r\n", styles: [".ngx-carousel{outline:none;overflow:hidden;position:relative;width:100%;height:auto}.ngx-carousel__list{display:flex;position:relative;width:100%;height:var(--carousel-list-height, 100%);margin:0;padding:0;list-style:none;-webkit-user-select:none;user-select:none;touch-action:pan-y;cursor:grab}.ngx-carousel__list.no-transition{transition:none!important}.ngx-carousel__slide{width:100%;height:100%;display:flex;flex-shrink:0;position:relative}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgxCarouselControlsComponent, selector: "lib-ngx-carousel-controls" }] });
|
|
511
|
+
}
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NgxCarouselComponent, decorators: [{
|
|
513
|
+
type: Component,
|
|
514
|
+
args: [{ selector: 'lib-ngx-carousel', imports: [NgTemplateOutlet, NgxCarouselControlsComponent], providers: [
|
|
515
|
+
NgxCarouselService,
|
|
516
|
+
NgxAutoplayService,
|
|
517
|
+
NgxSwipeService,
|
|
518
|
+
NgxStateService,
|
|
519
|
+
NgxLayoutService,
|
|
520
|
+
], template: "<div\r\n class=\"ngx-carousel\"\r\n (keydown.arrowRight)=\"carousel.next()\"\r\n (keydown.arrowLeft)=\"carousel.prev()\"\r\n (mouseleave)=\"autoplay.resume()\"\r\n (mouseover)=\"autoplay.pause()\"\r\n (focusin)=\"autoplay.pause()\"\r\n (focusout)=\"autoplay.resume()\"\r\n>\r\n <ul\r\n #carouselList\r\n class=\"ngx-carousel__list\"\r\n [class.no-transition]=\"carousel.disableTransition()\"\r\n [style.transform]=\"layout.translatePx()\"\r\n [style.transition]=\"`transform ${state.speed()}ms ease`\"\r\n (pointerdown)=\"swipe.onPointerDown($event)\"\r\n (pointermove)=\"swipe.onPointerMove($event)\"\r\n (pointerup)=\"swipe.onPointerUp($event)\"\r\n (pointercancel)=\"swipe.onPointerUp($event)\"\r\n (pointerleave)=\"swipe.onPointerUp($event)\"\r\n >\r\n @for(slideData of state.slidesWithClones(); track $index; let i = $index) {\r\n <li\r\n class=\"ngx-carousel__slide\"\r\n [class.active]=\"i === state.currentSlide()\"\r\n [style.width]=\"layout.slideWidthPx() + 'px'\"\r\n [style.marginRight.px]=\"state.space()\"\r\n >\r\n <ng-container \r\n [ngTemplateOutlet]=\"slideTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: slideData, index: i }\"\r\n ></ng-container>\r\n </li>\r\n } \r\n </ul>\r\n\r\n @if(controlsTemplate) {\r\n <ng-container \r\n [ngTemplateOutlet]=\"controlsTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: carousel}\"\r\n />\r\n } @else {\r\n <lib-ngx-carousel-controls />\r\n }\r\n</div>\r\n", styles: [".ngx-carousel{outline:none;overflow:hidden;position:relative;width:100%;height:auto}.ngx-carousel__list{display:flex;position:relative;width:100%;height:var(--carousel-list-height, 100%);margin:0;padding:0;list-style:none;-webkit-user-select:none;user-select:none;touch-action:pan-y;cursor:grab}.ngx-carousel__list.no-transition{transition:none!important}.ngx-carousel__slide{width:100%;height:100%;display:flex;flex-shrink:0;position:relative}\n"] }]
|
|
521
|
+
}], propDecorators: { slides: [{
|
|
522
|
+
type: Input,
|
|
523
|
+
args: [{ required: true }]
|
|
524
|
+
}], config: [{
|
|
525
|
+
type: Input
|
|
526
|
+
}], carouselList: [{
|
|
527
|
+
type: ViewChild,
|
|
528
|
+
args: ['carouselList', { static: true }]
|
|
529
|
+
}], slideTemplate: [{
|
|
530
|
+
type: ContentChild,
|
|
531
|
+
args: ['slideTemplate', { static: true }]
|
|
532
|
+
}], controlsTemplate: [{
|
|
533
|
+
type: ContentChild,
|
|
534
|
+
args: ['controlsTemplate', { static: true }]
|
|
535
|
+
}] } });
|
|
536
|
+
|
|
537
|
+
/*
|
|
538
|
+
* Public API Surface of carousel
|
|
539
|
+
*/
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Generated bundle index. Do not edit.
|
|
543
|
+
*/
|
|
544
|
+
|
|
545
|
+
export { DEFAULT_CAROUSEL_CONFIG, NGX_CAROUSEL_CONFIG, NgxCarouselComponent };
|
|
546
|
+
//# sourceMappingURL=ngx-freshok-carousel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-freshok-carousel.mjs","sources":["../../../projects/carousel/src/lib/ngx-carousel.types.ts","../../../projects/carousel/src/lib/services/ngx-state.service.ts","../../../projects/carousel/src/lib/services/ngx-carousel.service.ts","../../../projects/carousel/src/lib/components/ngx-carousel-controls/ngx-carousel-controls.component.ts","../../../projects/carousel/src/lib/components/ngx-carousel-controls/ngx-carousel-controls.component.html","../../../projects/carousel/src/lib/services/ngx-autoplay..service.ts","../../../projects/carousel/src/lib/services/ngx-layout.service.ts","../../../projects/carousel/src/lib/services/ngx-swipe.service.ts","../../../projects/carousel/src/lib/ngx-carousel.component.ts","../../../projects/carousel/src/lib/ngx-carousel.component.html","../../../projects/carousel/src/public-api.ts","../../../projects/carousel/src/ngx-freshok-carousel.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\n\r\nexport interface NgxCarouselBreakpoint extends NgxCarouselConfig {\r\n breakpoint: number; // Ширина экрана, при которой применяется конфигурация (max-width)\r\n}\r\n\r\nexport interface NgxCarouselConfig {\r\n autoplay?: boolean,\r\n interval?: number,\r\n loop?: boolean,\r\n pauseOnHover?: boolean;\r\n animation?: 'slide' | 'fade',\r\n startIndex?: number,\r\n slidesToShow?: number\r\n showArrows?: boolean;\r\n showDots?: boolean;\r\n spaceBetween?: number;\r\n speed?: number;\r\n breakpoints?: NgxCarouselBreakpoint[],\r\n}\r\n\r\nexport const DEFAULT_CAROUSEL_CONFIG: NgxCarouselConfig = {\r\n autoplay: true, // автопроигрывание слайдов\r\n interval: 5000, // время переключения слайдов\r\n loop: true, // бесконечная прокрутка\r\n pauseOnHover: true, // останавливать автопрокрутку при наведении\r\n animation: 'slide', // тип анимации\r\n startIndex: 0, // начальный номер слайда\r\n slidesToShow: 1, // по умолчанию показываем 1 слайд\r\n showArrows: true,\r\n showDots: true,\r\n spaceBetween: 0,\r\n speed: 500,\r\n breakpoints: [], // по умолчанию нет брейкпоинтов\r\n}\r\n\r\nexport const NGX_CAROUSEL_CONFIG = new InjectionToken<NgxCarouselConfig>(\r\n 'NGX_CAROUSEL_CONFIG'\r\n);\r\n","import { computed, effect, inject, Injectable, signal } from '@angular/core';\r\nimport { DEFAULT_CAROUSEL_CONFIG, NGX_CAROUSEL_CONFIG, NgxCarouselConfig } from '../ngx-carousel.types';\r\n\r\n@Injectable()\r\nexport class NgxStateService {\r\n private config = signal<NgxCarouselConfig>({});\r\n width = signal(0)\r\n slides = signal<any[]>([]);\r\n currentSlide = signal(0);\r\n\r\n private appCfg = inject(NGX_CAROUSEL_CONFIG, { optional: true });\r\n\r\n /* ========= ACTIVECONFIG ========= */\r\n activeConfig = computed(() => {\r\n return {\r\n ...DEFAULT_CAROUSEL_CONFIG,\r\n ...this.appCfg ?? {},\r\n ...this.config(),\r\n ...this.activeBreakpoint() ?? {}\r\n }\r\n })\r\n\r\n slidesToShow = computed(() => this.activeConfig().slidesToShow ?? 1);\r\n autoplay = computed(() => this.activeConfig().autoplay ?? true);\r\n interval = computed(() => this.activeConfig().interval ?? 5000);\r\n pauseOnHover = computed(() => this.activeConfig().pauseOnHover ?? true);\r\n space = computed(() => this.activeConfig().spaceBetween ?? 0);\r\n isFade = computed(() => this.activeConfig().animation === 'fade');\r\n loop = computed(() => this.activeConfig().loop)\r\n isArrows = computed(() => this.activeConfig().showArrows)\r\n isDots = computed(() => this.activeConfig().showDots)\r\n speed = computed(() => this.activeConfig().speed ?? 500)\r\n\r\n /* ========= BREAKPOINTS ========= */\r\n activeBreakpoint = computed<Partial<NgxCarouselConfig> | null>(() => {\r\n const breakpoints = this.config().breakpoints ?? []\r\n const w = this.width();\r\n\r\n return [...breakpoints]\r\n .sort((a, b) => b.breakpoint - a.breakpoint)\r\n .find(bp => w >= bp.breakpoint) ?? null\r\n })\r\n\r\n /* ========= CLONES ========= */\r\n slidesWithClones = computed(() => {\r\n if (this.isFade()) {\r\n return this.slides();\r\n }\r\n\r\n const slides = this.slides();\r\n const count = this.slidesToShow();\r\n\r\n if (!this.loop() || slides.length < count) {\r\n return slides;\r\n }\r\n\r\n return [\r\n ...slides.slice(-count),\r\n ...slides,\r\n ...slides.slice(0, count),\r\n ];\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const slides = this.slides()\r\n const cfg = this.activeConfig()\r\n\r\n if (!slides.length) return\r\n\r\n const index = this.loop() ?\r\n (cfg.startIndex ?? 0) + this.slidesToShow() :\r\n cfg.startIndex ?? 0\r\n\r\n this.setCurrentSlide(index)\r\n })\r\n\r\n // setInterval(() => {\r\n // console.log(\"ACTIVE\", this.activeConfig())\r\n\r\n // }, 1000)\r\n setTimeout(() => {\r\n console.log(\"ACTIVE\", this.activeConfig())\r\n\r\n }, 2000)\r\n }\r\n\r\n /* ========= INIT ========= */\r\n init(customConfig: NgxCarouselConfig = {}) {\r\n this.config.set({\r\n ...DEFAULT_CAROUSEL_CONFIG,\r\n ...this.appCfg ?? {},\r\n ...customConfig\r\n });\r\n // console.log(\"🔸 this.config:\", this.config())\r\n }\r\n\r\n setWidth(width: number) {\r\n this.width.set(width)\r\n // console.log(\"ACTIVE\", this.activeConfig())\r\n }\r\n\r\n setSlides(slides: any[]) {\r\n this.slides.set(slides);\r\n }\r\n\r\n setCurrentSlide(index: number) {\r\n this.currentSlide.set(index);\r\n }\r\n}\r\n","import { inject, Injectable, signal } from '@angular/core';\r\nimport { NgxStateService } from './ngx-state.service';\r\n\r\n@Injectable()\r\nexport class NgxCarouselService {\r\n private state = inject(NgxStateService)\r\n\r\n private jumpTimer: any = null;\r\n\r\n disableTransition = signal(false);\r\n isAnimating = signal(false);\r\n\r\n\r\n next() {\r\n if (!this.startAnimation()) return\r\n\r\n const length = this.state.slidesWithClones().length\r\n if (length <= 1) return;\r\n\r\n if (this.state.isFade()) {\r\n const nextNum = (this.state.currentSlide() + 1) % length\r\n this.state.setCurrentSlide(nextNum)\r\n return\r\n }\r\n\r\n this.disableTransition.set(false);\r\n const current = this.state.currentSlide();\r\n const slidesToShow = this.state.slidesToShow()\r\n\r\n if (this.state.loop()) {\r\n // Переходим к следующему слайду (даже если это клон)\r\n this.state.setCurrentSlide(current + 1);\r\n\r\n // Если достигли клона\r\n if (current + slidesToShow >= length - 1) {\r\n // Сбрасываем на первый оригинальный слайд\r\n const index = this.getRealIndex(current + 1)\r\n this.scheduleJumpToReal(index);\r\n }\r\n } else if (current + 1 < length) {\r\n // В режиме без loop просто проверяем границы\r\n this.state.setCurrentSlide(current + 1);\r\n }\r\n }\r\n\r\n prev() {\r\n if (!this.startAnimation()) return;\r\n\r\n const length = this.state.slidesWithClones().length;\r\n if (length <= 1) return;\r\n\r\n if (this.state.isFade()) {\r\n const prev = (this.state.currentSlide() - 1 + length) % length;\r\n this.state.setCurrentSlide(prev);\r\n return;\r\n }\r\n\r\n this.disableTransition.set(false);\r\n const current = this.state.currentSlide();\r\n const slidesToShow = this.state.slidesToShow();\r\n\r\n if (this.state.activeConfig().loop) {\r\n // Переходим к предыдущему слайду (даже если это клон)\r\n this.state.setCurrentSlide(current - 1);\r\n\r\n if (current - slidesToShow <= 0) {\r\n const index = this.getRealIndex(current - 1);\r\n this.scheduleJumpToReal(index);\r\n }\r\n } else if (current > 0) {\r\n this.state.setCurrentSlide(current - 1);\r\n }\r\n }\r\n\r\n private scheduleJumpToReal(realIndex: number) {\r\n //Если таймер уже запущен, то остановить и обнулить\r\n if (this.jumpTimer) {\r\n clearTimeout(this.jumpTimer)\r\n this.jumpTimer = null\r\n }\r\n\r\n const slidesToShow = this.state.slidesToShow()\r\n const realTarget = realIndex + slidesToShow\r\n\r\n // Заново запысываем новый таймер\r\n this.jumpTimer = setTimeout(() => {\r\n this.disableTransition.set(true)\r\n this.state.setCurrentSlide(realTarget)\r\n\r\n requestAnimationFrame(() => {\r\n requestAnimationFrame(() => {\r\n this.disableTransition.set(false)\r\n if (this.jumpTimer) {\r\n clearTimeout(this.jumpTimer)\r\n this.jumpTimer = null\r\n }\r\n })\r\n })\r\n }, this.state.speed());\r\n }\r\n\r\n goTo(index: number) {\r\n const length = this.state.slides().length\r\n if (length <= 0) return;\r\n\r\n const slidestToShow = this.state.slidesToShow();\r\n\r\n if (this.state.loop()) {\r\n // В режиме loop просто устанавливаем целевой индекс\r\n this.state.setCurrentSlide(index + slidestToShow);\r\n } else {\r\n this.state.setCurrentSlide(index);\r\n }\r\n }\r\n\r\n getDisplayIndex(): number {\r\n const length = this.state.slidesWithClones().length;\r\n if (length <= 0) return 0;\r\n\r\n const current = this.state.currentSlide();\r\n const slidesToShow = this.state.slidesToShow();\r\n\r\n // Если loop отключен, то просто вернем индекс текущего слайда\r\n if (!this.state.loop()) return current;\r\n\r\n // Если на клоне последнего (индекс 0), показываем последний реальный\r\n if (current === 0) return length - 1;\r\n\r\n // Если на клоне первого (индекс len + 1), показываем первый реальный\r\n if (current === length - slidesToShow) return 0;\r\n\r\n // Иначе вычитаем slidesToShow, так как реальные слайды начинаются с индекса slidesToShow\r\n return current - slidesToShow;\r\n }\r\n\r\n startAnimation(): boolean {\r\n if (this.isAnimating()) return false;\r\n this.isAnimating.set(true);\r\n\r\n const duration = this.state.speed();\r\n\r\n setTimeout(() => {\r\n this.isAnimating.set(false);\r\n }, duration);\r\n\r\n return true;\r\n }\r\n\r\n private getRealIndex(virtualIndex: number): number {\r\n const length = this.state.slides().length\r\n const slidesToShow = this.state.slidesToShow()\r\n\r\n if (!this.state.loop()) return virtualIndex\r\n\r\n let real = virtualIndex - slidesToShow\r\n\r\n if (real < 0) real += length\r\n if (real >= length) real -= length\r\n\r\n return real\r\n }\r\n\r\n shiftBy(slidesDragged: number) {\r\n if (slidesDragged === 0) return;\r\n if (!this.startAnimation()) return;\r\n\r\n const current = this.state.currentSlide();\r\n const slidesToShow = this.state.slidesToShow();\r\n const total = this.state.slidesWithClones().length;\r\n\r\n let target = current + slidesDragged;\r\n\r\n this.disableTransition.set(false);\r\n\r\n if (!this.state.loop()) {\r\n const max = total - slidesToShow;\r\n target = Math.max(0, Math.min(target, max));\r\n this.state.setCurrentSlide(target);\r\n return;\r\n }\r\n\r\n this.state.setCurrentSlide(target);\r\n\r\n // вычисляем РЕАЛЬНЫЙ индекс\r\n const realIndex = this.getRealIndex(target);\r\n\r\n // если ушли в клоны — снапаемся туда же, но в реальной зоне\r\n if (target < slidesToShow || target >= total - slidesToShow) {\r\n this.scheduleJumpToReal(realIndex);\r\n }\r\n }\r\n}\r\n","import { Component, inject, } from '@angular/core';\r\nimport { NgxCarouselService } from '../../services/ngx-carousel.service';\r\nimport { NgxStateService } from '../../services/ngx-state.service';\r\n\r\n@Component({\r\n selector: 'lib-ngx-carousel-controls',\r\n imports: [],\r\n templateUrl: './ngx-carousel-controls.component.html',\r\n styleUrl: './ngx-carousel-controls.component.scss',\r\n})\r\nexport class NgxCarouselControlsComponent {\r\n carousel = inject(NgxCarouselService);\r\n state = inject(NgxStateService)\r\n}\r\n","@if(state.isArrows()) {\r\n <div class=\"ngx-carousel__controls\">\r\n <button\r\n (click)=\"carousel.prev()\"\r\n >\r\n Prev\r\n </button>\r\n \r\n <button\r\n (click)=\"carousel.next()\"\r\n >\r\n Next\r\n </button>\r\n </div>\r\n}\r\n\r\n@if(state.isDots()) {\r\n <div class=\"ngx-carousel__controls bullets\">\r\n <div \r\n class=\"ngx-carousel__dots\"\r\n >\r\n @for(dot of state.slides(); track $index; let i = $index) {\r\n <button\r\n class=\"ngx-carousel__dot\"\r\n [class.active]=\"carousel.getDisplayIndex() == i\"\r\n (click)=\"carousel.goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n </div>\r\n}\r\n\r\n\r\n","import { effect, inject, Injectable, signal } from '@angular/core';\r\nimport { NgxCarouselService } from './ngx-carousel.service';\r\nimport { NgxStateService } from './ngx-state.service';\r\n\r\n@Injectable()\r\nexport class NgxAutoplayService {\r\n private carousel = inject(NgxCarouselService)\r\n state = inject(NgxStateService)\r\n private isPlaying = signal(true)\r\n private timerAutoplay: any = null\r\n\r\n constructor() {\r\n effect(() => {\r\n if(!this.state.autoplay() || this.state.slides().length <= 1) {\r\n this.stop()\r\n return\r\n }\r\n\r\n this.state.autoplay() ?\r\n this.resume() :\r\n this.stop()\r\n })\r\n }\r\n\r\n private start() {\r\n\r\n if (!this.state.autoplay() || !this.isPlaying()) return\r\n \r\n this.stop()\r\n const delay = this.state.interval() ?? 5000\r\n this.timerAutoplay = setInterval(() => this.carousel.next(), delay )\r\n }\r\n\r\n stop() {\r\n this.isPlaying.set(false)\r\n if (this.timerAutoplay) {\r\n clearInterval(this.timerAutoplay)\r\n this.timerAutoplay = null\r\n }\r\n }\r\n\r\n pause() {\r\n if(this.state.pauseOnHover()) {\r\n this.stop();\r\n }\r\n }\r\n\r\n resume() {\r\n if(this.state.autoplay()) {\r\n this.isPlaying.set(true);\r\n\r\n setTimeout(() => this.start(), 0);\r\n }\r\n }\r\n}\r\n","import { computed, inject, Injectable, signal } from '@angular/core';\r\nimport { NgxStateService } from './ngx-state.service';\r\n\r\n@Injectable()\r\nexport class NgxLayoutService {\r\n\r\n private state = inject(NgxStateService);\r\n\r\n /* ========= GEOMETRY ========= */\r\n slideWidthPx = computed(() => \r\n this.state.width() / this.state.slidesToShow() - this.state.space() / 2\r\n );\r\n\r\n slideStepPx = computed(() => this.slideWidthPx() + this.state.space());\r\n\r\n translatePx = computed(() => {\r\n if (this.state.isFade()) return 'none';\r\n return `translate(-${this.state.currentSlide() * this.slideStepPx()}px)`;\r\n });\r\n}\r\n","import { ElementRef, inject, Injectable, Renderer2, signal } from '@angular/core';\r\nimport { NgxCarouselService } from './ngx-carousel.service';\r\nimport { NgxAutoplayService } from './ngx-autoplay..service';\r\nimport { NgxStateService } from './ngx-state.service';\r\nimport { NgxLayoutService } from './ngx-layout.service';\r\n\r\n@Injectable()\r\nexport class NgxSwipeService {\r\n // Порог в пикселях для различения клика и свайпа\r\n private readonly CLICK_LIMIT = 5; // px\r\n private readonly SWIPE_LIMIT = 0.05; // %\r\n\r\n private carousel = inject(NgxCarouselService);\r\n private autoplay = inject(NgxAutoplayService);\r\n private state = inject(NgxStateService)\r\n private layout = inject(NgxLayoutService)\r\n\r\n private renderer!: Renderer2;\r\n private carouselList!: ElementRef<HTMLDivElement>;\r\n private startX = 0;\r\n private currentX = 0;\r\n\r\n private isSwiping = signal(false);\r\n // private config = computed(() => this.carousel.getConfig())\r\n\r\n // Определяем, был ли свайп достаточным, чтобы считать его жестом, а не кликом.\r\n // Будет использоваться для блокировки кликов по ссылкам.\r\n isSwipedEnough = signal(false);\r\n\r\n registerSlideList(element: ElementRef<HTMLDivElement>) {\r\n this.carouselList = element;\r\n }\r\n\r\n setRenderer(renderer: Renderer2) {\r\n this.renderer = renderer;\r\n }\r\n\r\n onPointerDown(event: PointerEvent) {\r\n if (this.carousel.isAnimating()) return\r\n\r\n this.startX = event.clientX;\r\n this.currentX = 0;\r\n this.isSwipedEnough.set(false);\r\n this.isSwiping.set(true);\r\n this.autoplay.stop();\r\n\r\n // Отключаем transition в начале свайпа (через Renderer2)\r\n this.renderer.setStyle(this.carouselList.nativeElement, 'transition', 'none');\r\n }\r\n\r\n onPointerMove(event: PointerEvent) {\r\n this.currentX = event.clientX - this.startX\r\n\r\n if (this.state.isFade()) return\r\n if (!this.isSwiping()) return;\r\n\r\n // Если отключена бесконечная прокрутка, то останавливаем свайп\r\n // при достижении первого и последнего слайда\r\n if (!this.state.loop()) {\r\n const length = this.state.slides().length\r\n const current = this.state.currentSlide();\r\n const slidesToshow = this.state.slidesToShow()\r\n\r\n if ((current <= 0) && (this.currentX > 0)) return // свайпаем на предыдущий слайд\r\n if ((current >= length - slidesToshow) && (this.currentX < 0)) return // свайпаем на следующий слайд\r\n }\r\n\r\n // Проверяем, превысили ли мы порог, чтобы считать это \"свайпом\", а не кликом\r\n if (Math.abs(this.currentX) > this.CLICK_LIMIT) {\r\n this.isSwipedEnough.set(true);\r\n\r\n // pointercapture гарантирует, что все pointermove события будут приходить на этот элемент, \r\n // даже если палец/мышь вышли за пределы слайдера.\r\n // Без него свайп часто \"обрывается\", если пользователь ведёт чуть в сторону.\r\n this.carouselList.nativeElement.setPointerCapture(event.pointerId);\r\n }\r\n\r\n // Смещение в пикселях к текущему слайду\r\n const baseTranslate = -this.state.currentSlide() * this.layout.slideStepPx()\r\n\r\n // Смещение в пикселях (текущее + пользовательское)\r\n const offsetPx = baseTranslate + this.currentX\r\n\r\n // Обновляем transform напрямую\r\n this.renderer.setStyle(\r\n this.carouselList.nativeElement,\r\n 'transform',\r\n `translateX(${offsetPx}px)`\r\n );\r\n }\r\n\r\n onPointerUp(event: PointerEvent) {\r\n if (this.state.isFade()) {\r\n if (this.currentX < -50) this.carousel.next()\r\n if (this.currentX > 50) this.carousel.prev()\r\n\r\n this.isSwiping.set(false)\r\n return\r\n }\r\n\r\n if (!this.isSwiping()) return;\r\n\r\n // 1. Включаем transition обратно, прежде чем менять currentSlide()\r\n this.renderer.setStyle(\r\n this.carouselList.nativeElement,\r\n 'transition',\r\n `transform ${this.state.speed()}ms ease`\r\n );\r\n\r\n const swipeDistance = this.currentX;\r\n const limit = this.carouselList.nativeElement.clientWidth * this.SWIPE_LIMIT;\r\n const step = this.layout.slideStepPx()\r\n const slidesDragged = Math.round(swipeDistance / step) * -1 // сколько слайдов было пролистано за одно перерягивание. Домножаем на -1 так как направление перетягивания swipeDistance по своему знаку противоположно той стороне, куда нужно сместить слайды. То есть при свайпе вправо (листаем вперед), swipeDistance станет отрицательным, а слайды нам нужно сдвинуть в бОльшую сторону\r\n\r\n if (swipeDistance < -limit) {\r\n Math.abs(slidesDragged) > 0 ?\r\n this.carousel.shiftBy(slidesDragged) :\r\n this.carousel.next()\r\n } else if (swipeDistance > limit) {\r\n Math.abs(slidesDragged) > 0 ?\r\n this.carousel.shiftBy(slidesDragged) :\r\n this.carousel.prev()\r\n } else {\r\n // Возврат на место, так как длинна свайпа недостаточная по длинне \r\n // (так как transition уже включен, это будет плавно)\r\n this.snapBack();\r\n }\r\n\r\n // 2. Сбрасываем флаги\r\n this.isSwiping.set(false);\r\n this.isSwipedEnough.set(false);\r\n this.currentX = 0;\r\n this.autoplay.resume();\r\n }\r\n\r\n private snapBack() {\r\n const offsetPx = -this.state.currentSlide() * this.layout.slideStepPx();\r\n\r\n // Просто устанавливаем transform в текущую позицию. Transition уже включен в onPointerUp.\r\n this.renderer\r\n .setStyle(\r\n this.carouselList.nativeElement,\r\n 'transform',\r\n `translateX(${offsetPx}px)`\r\n )\r\n }\r\n}","import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n AfterViewInit,\r\n Component,\r\n ContentChild,\r\n ElementRef,\r\n inject,\r\n Input,\r\n OnInit,\r\n Renderer2,\r\n TemplateRef,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { NgxCarouselService } from './services/ngx-carousel.service';\r\nimport { NgxCarouselControlsComponent } from './components/ngx-carousel-controls/ngx-carousel-controls.component';\r\nimport { NgxAutoplayService } from './services/ngx-autoplay..service';\r\nimport { NgxSwipeService } from './services/ngx-swipe.service';\r\nimport { NgxStateService } from './services/ngx-state.service';\r\nimport { NgxCarouselConfig } from './ngx-carousel.types';\r\nimport { NgxLayoutService } from './services/ngx-layout.service';\r\n\r\n@Component({\r\n selector: 'lib-ngx-carousel',\r\n imports: [NgTemplateOutlet, NgxCarouselControlsComponent],\r\n templateUrl: './ngx-carousel.component.html',\r\n styleUrl: './ngx-carousel.component.scss',\r\n providers: [\r\n NgxCarouselService,\r\n NgxAutoplayService,\r\n NgxSwipeService,\r\n NgxStateService,\r\n NgxLayoutService,\r\n ],\r\n})\r\nexport class NgxCarouselComponent implements OnInit, AfterViewInit {\r\n @Input({ required: true }) slides!: any[];\r\n @Input() config!: NgxCarouselConfig;\r\n\r\n @ViewChild('carouselList', { static: true }) \r\n carouselList!: ElementRef<HTMLDivElement>;\r\n @ContentChild('slideTemplate', { static: true }) \r\n slideTemplate!: TemplateRef<any>;\r\n @ContentChild('controlsTemplate', {static: true}) \r\n controlsTemplate!: TemplateRef<any>\r\n\r\n private readonly renderer = inject(Renderer2);\r\n private resizeObserver!: ResizeObserver;\r\n\r\n carousel = inject(NgxCarouselService);\r\n autoplay = inject(NgxAutoplayService);\r\n swipe = inject(NgxSwipeService);\r\n state = inject(NgxStateService);\r\n layout = inject(NgxLayoutService);\r\n\r\n ngOnInit() {\r\n this.watchResize();\r\n this.state.init(this.config)\r\n this.state.setSlides(this.slides)\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n this.swipe.registerSlideList(this.carouselList);\r\n this.swipe.setRenderer(this.renderer);\r\n\r\n this.resizeObserver.observe(this.carouselList.nativeElement);\r\n }\r\n\r\n private watchResize() {\r\n this.resizeObserver = new ResizeObserver((entries) => {\r\n const width = entries[0].contentRect.width;\r\n this.state.setWidth(width);\r\n });\r\n }\r\n}\r\n","<div\r\n class=\"ngx-carousel\"\r\n (keydown.arrowRight)=\"carousel.next()\"\r\n (keydown.arrowLeft)=\"carousel.prev()\"\r\n (mouseleave)=\"autoplay.resume()\"\r\n (mouseover)=\"autoplay.pause()\"\r\n (focusin)=\"autoplay.pause()\"\r\n (focusout)=\"autoplay.resume()\"\r\n>\r\n <ul\r\n #carouselList\r\n class=\"ngx-carousel__list\"\r\n [class.no-transition]=\"carousel.disableTransition()\"\r\n [style.transform]=\"layout.translatePx()\"\r\n [style.transition]=\"`transform ${state.speed()}ms ease`\"\r\n (pointerdown)=\"swipe.onPointerDown($event)\"\r\n (pointermove)=\"swipe.onPointerMove($event)\"\r\n (pointerup)=\"swipe.onPointerUp($event)\"\r\n (pointercancel)=\"swipe.onPointerUp($event)\"\r\n (pointerleave)=\"swipe.onPointerUp($event)\"\r\n >\r\n @for(slideData of state.slidesWithClones(); track $index; let i = $index) {\r\n <li\r\n class=\"ngx-carousel__slide\"\r\n [class.active]=\"i === state.currentSlide()\"\r\n [style.width]=\"layout.slideWidthPx() + 'px'\"\r\n [style.marginRight.px]=\"state.space()\"\r\n >\r\n <ng-container \r\n [ngTemplateOutlet]=\"slideTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: slideData, index: i }\"\r\n ></ng-container>\r\n </li>\r\n } \r\n </ul>\r\n\r\n @if(controlsTemplate) {\r\n <ng-container \r\n [ngTemplateOutlet]=\"controlsTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: carousel}\"\r\n />\r\n } @else {\r\n <lib-ngx-carousel-controls />\r\n }\r\n</div>\r\n","/*\r\n * Public API Surface of carousel\r\n */\r\n\r\nexport * from './lib/ngx-carousel.component';\r\nexport * from './lib/ngx-carousel.types';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAqBa,MAAA,uBAAuB,GAAsB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A,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,4BAA4B,EAAA,QAAA,EAAA,2BAAA,EAAA,CAAA,EAAA,CAAA;;4FAW7C,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAbhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,EAG9C,SAAA,EAAA;wBACT,kBAAkB;wBAClB,kBAAkB;wBAClB,eAAe;wBACf,eAAe;wBACf,gBAAgB;AACjB,qBAAA,EAAA,QAAA,EAAA,siDAAA,EAAA,MAAA,EAAA,CAAA,gcAAA,CAAA,EAAA;8BAG0B,MAAM,EAAA,CAAA;sBAAhC,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAChB,MAAM,EAAA,CAAA;sBAAd;gBAGD,YAAY,EAAA,CAAA;sBADX,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,cAAc,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAG3C,aAAa,EAAA,CAAA;sBADZ,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,eAAe,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAG/C,gBAAgB,EAAA,CAAA;sBADf,YAAY;AAAC,gBAAA,IAAA,EAAA,CAAA,kBAAkB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC;;;AE1ClD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NgxCarouselService } from '../../services/ngx-carousel.service';
|
|
2
|
+
import { NgxStateService } from '../../services/ngx-state.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NgxCarouselControlsComponent {
|
|
5
|
+
carousel: NgxCarouselService;
|
|
6
|
+
state: NgxStateService;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxCarouselControlsComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxCarouselControlsComponent, "lib-ngx-carousel-controls", never, {}, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnInit, TemplateRef } from '@angular/core';
|
|
2
|
+
import { NgxCarouselService } from './services/ngx-carousel.service';
|
|
3
|
+
import { NgxAutoplayService } from './services/ngx-autoplay..service';
|
|
4
|
+
import { NgxSwipeService } from './services/ngx-swipe.service';
|
|
5
|
+
import { NgxStateService } from './services/ngx-state.service';
|
|
6
|
+
import { NgxCarouselConfig } from './ngx-carousel.types';
|
|
7
|
+
import { NgxLayoutService } from './services/ngx-layout.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class NgxCarouselComponent implements OnInit, AfterViewInit {
|
|
10
|
+
slides: any[];
|
|
11
|
+
config: NgxCarouselConfig;
|
|
12
|
+
carouselList: ElementRef<HTMLDivElement>;
|
|
13
|
+
slideTemplate: TemplateRef<any>;
|
|
14
|
+
controlsTemplate: TemplateRef<any>;
|
|
15
|
+
private readonly renderer;
|
|
16
|
+
private resizeObserver;
|
|
17
|
+
carousel: NgxCarouselService;
|
|
18
|
+
autoplay: NgxAutoplayService;
|
|
19
|
+
swipe: NgxSwipeService;
|
|
20
|
+
state: NgxStateService;
|
|
21
|
+
layout: NgxLayoutService;
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
ngAfterViewInit(): void;
|
|
24
|
+
private watchResize;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxCarouselComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxCarouselComponent, "lib-ngx-carousel", never, { "slides": { "alias": "slides"; "required": true; }; "config": { "alias": "config"; "required": false; }; }, {}, ["slideTemplate", "controlsTemplate"], never, true, never>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export interface NgxCarouselBreakpoint extends NgxCarouselConfig {
|
|
3
|
+
breakpoint: number;
|
|
4
|
+
}
|
|
5
|
+
export interface NgxCarouselConfig {
|
|
6
|
+
autoplay?: boolean;
|
|
7
|
+
interval?: number;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
pauseOnHover?: boolean;
|
|
10
|
+
animation?: 'slide' | 'fade';
|
|
11
|
+
startIndex?: number;
|
|
12
|
+
slidesToShow?: number;
|
|
13
|
+
showArrows?: boolean;
|
|
14
|
+
showDots?: boolean;
|
|
15
|
+
spaceBetween?: number;
|
|
16
|
+
speed?: number;
|
|
17
|
+
breakpoints?: NgxCarouselBreakpoint[];
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULT_CAROUSEL_CONFIG: NgxCarouselConfig;
|
|
20
|
+
export declare const NGX_CAROUSEL_CONFIG: InjectionToken<NgxCarouselConfig>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NgxStateService } from './ngx-state.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NgxAutoplayService {
|
|
4
|
+
private carousel;
|
|
5
|
+
state: NgxStateService;
|
|
6
|
+
private isPlaying;
|
|
7
|
+
private timerAutoplay;
|
|
8
|
+
constructor();
|
|
9
|
+
private start;
|
|
10
|
+
stop(): void;
|
|
11
|
+
pause(): void;
|
|
12
|
+
resume(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxAutoplayService, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxAutoplayService>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class NgxCarouselService {
|
|
3
|
+
private state;
|
|
4
|
+
private jumpTimer;
|
|
5
|
+
disableTransition: import("@angular/core").WritableSignal<boolean>;
|
|
6
|
+
isAnimating: import("@angular/core").WritableSignal<boolean>;
|
|
7
|
+
next(): void;
|
|
8
|
+
prev(): void;
|
|
9
|
+
private scheduleJumpToReal;
|
|
10
|
+
goTo(index: number): void;
|
|
11
|
+
getDisplayIndex(): number;
|
|
12
|
+
startAnimation(): boolean;
|
|
13
|
+
private getRealIndex;
|
|
14
|
+
shiftBy(slidesDragged: number): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxCarouselService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxCarouselService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class NgxLayoutService {
|
|
3
|
+
private state;
|
|
4
|
+
slideWidthPx: import("@angular/core").Signal<number>;
|
|
5
|
+
slideStepPx: import("@angular/core").Signal<number>;
|
|
6
|
+
translatePx: import("@angular/core").Signal<string>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxLayoutService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxLayoutService>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { NgxCarouselConfig } from '../ngx-carousel.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NgxStateService {
|
|
4
|
+
private config;
|
|
5
|
+
width: import("@angular/core").WritableSignal<number>;
|
|
6
|
+
slides: import("@angular/core").WritableSignal<any[]>;
|
|
7
|
+
currentSlide: import("@angular/core").WritableSignal<number>;
|
|
8
|
+
private appCfg;
|
|
9
|
+
activeConfig: import("@angular/core").Signal<{
|
|
10
|
+
autoplay?: boolean;
|
|
11
|
+
interval?: number;
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
pauseOnHover?: boolean;
|
|
14
|
+
animation?: "slide" | "fade";
|
|
15
|
+
startIndex?: number;
|
|
16
|
+
slidesToShow?: number;
|
|
17
|
+
showArrows?: boolean;
|
|
18
|
+
showDots?: boolean;
|
|
19
|
+
spaceBetween?: number;
|
|
20
|
+
speed?: number;
|
|
21
|
+
breakpoints?: import("ngx-freshok-carousel").NgxCarouselBreakpoint[];
|
|
22
|
+
}>;
|
|
23
|
+
slidesToShow: import("@angular/core").Signal<number>;
|
|
24
|
+
autoplay: import("@angular/core").Signal<boolean>;
|
|
25
|
+
interval: import("@angular/core").Signal<number>;
|
|
26
|
+
pauseOnHover: import("@angular/core").Signal<boolean>;
|
|
27
|
+
space: import("@angular/core").Signal<number>;
|
|
28
|
+
isFade: import("@angular/core").Signal<boolean>;
|
|
29
|
+
loop: import("@angular/core").Signal<boolean | undefined>;
|
|
30
|
+
isArrows: import("@angular/core").Signal<boolean | undefined>;
|
|
31
|
+
isDots: import("@angular/core").Signal<boolean | undefined>;
|
|
32
|
+
speed: import("@angular/core").Signal<number>;
|
|
33
|
+
activeBreakpoint: import("@angular/core").Signal<Partial<NgxCarouselConfig> | null>;
|
|
34
|
+
slidesWithClones: import("@angular/core").Signal<any[]>;
|
|
35
|
+
constructor();
|
|
36
|
+
init(customConfig?: NgxCarouselConfig): void;
|
|
37
|
+
setWidth(width: number): void;
|
|
38
|
+
setSlides(slides: any[]): void;
|
|
39
|
+
setCurrentSlide(index: number): void;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxStateService, never>;
|
|
41
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxStateService>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NgxSwipeService {
|
|
4
|
+
private readonly CLICK_LIMIT;
|
|
5
|
+
private readonly SWIPE_LIMIT;
|
|
6
|
+
private carousel;
|
|
7
|
+
private autoplay;
|
|
8
|
+
private state;
|
|
9
|
+
private layout;
|
|
10
|
+
private renderer;
|
|
11
|
+
private carouselList;
|
|
12
|
+
private startX;
|
|
13
|
+
private currentX;
|
|
14
|
+
private isSwiping;
|
|
15
|
+
isSwipedEnough: import("@angular/core").WritableSignal<boolean>;
|
|
16
|
+
registerSlideList(element: ElementRef<HTMLDivElement>): void;
|
|
17
|
+
setRenderer(renderer: Renderer2): void;
|
|
18
|
+
onPointerDown(event: PointerEvent): void;
|
|
19
|
+
onPointerMove(event: PointerEvent): void;
|
|
20
|
+
onPointerUp(event: PointerEvent): void;
|
|
21
|
+
private snapBack;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSwipeService, never>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxSwipeService>;
|
|
24
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ngx-freshok-carousel",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "This is a test library written for the 'Fresh-ok' project.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"freshok",
|
|
7
|
+
"carousel",
|
|
8
|
+
"angular"
|
|
9
|
+
],
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Yuri",
|
|
12
|
+
"email": "sidorenkourij970@gmail.com"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/Yuri3K/angular-carousel-lib"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^19.2.0",
|
|
20
|
+
"@angular/core": "^19.2.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"homepage": "https://github.com/Yuri3K/angular-carousel-lib#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/Yuri3K/angular-carousel-lib/issues"
|
|
30
|
+
},
|
|
31
|
+
"module": "fesm2022/ngx-freshok-carousel.mjs",
|
|
32
|
+
"typings": "index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
"./package.json": {
|
|
35
|
+
"default": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./index.d.ts",
|
|
39
|
+
"default": "./fesm2022/ngx-freshok-carousel.mjs"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/public-api.d.ts
ADDED