@acorex/components 6.1.2 → 6.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/calendar/src/calendar.module.d.ts +2 -3
  2. package/esm2020/calendar/src/calendar.component.mjs +3 -4
  3. package/esm2020/calendar/src/calendar.module.mjs +3 -4
  4. package/esm2020/form/src/validation-rule.widget.mjs +4 -3
  5. package/esm2020/mixin/src/value-mixin.class.mjs +1 -2
  6. package/fesm2015/acorex-components-calendar.mjs +4 -6
  7. package/fesm2015/acorex-components-calendar.mjs.map +1 -1
  8. package/fesm2015/acorex-components-form.mjs +3 -2
  9. package/fesm2015/acorex-components-form.mjs.map +1 -1
  10. package/fesm2015/acorex-components-mixin.mjs +0 -1
  11. package/fesm2015/acorex-components-mixin.mjs.map +1 -1
  12. package/fesm2020/acorex-components-calendar.mjs +4 -6
  13. package/fesm2020/acorex-components-calendar.mjs.map +1 -1
  14. package/fesm2020/acorex-components-form.mjs +3 -2
  15. package/fesm2020/acorex-components-form.mjs.map +1 -1
  16. package/fesm2020/acorex-components-mixin.mjs +0 -1
  17. package/fesm2020/acorex-components-mixin.mjs.map +1 -1
  18. package/package.json +2 -22
  19. package/carousel/index.d.ts +0 -5
  20. package/carousel/public-api.d.ts +0 -7
  21. package/carousel/src/carousel-arrows.component.d.ts +0 -16
  22. package/carousel/src/carousel-item.component.d.ts +0 -8
  23. package/carousel/src/carousel-pager.component.d.ts +0 -22
  24. package/carousel/src/carousel-splidejs.class.d.ts +0 -18
  25. package/carousel/src/carousel.class.d.ts +0 -71
  26. package/carousel/src/carousel.component.d.ts +0 -111
  27. package/carousel/src/carousel.module.d.ts +0 -11
  28. package/esm2020/carousel/acorex-components-carousel.mjs +0 -5
  29. package/esm2020/carousel/public-api.mjs +0 -8
  30. package/esm2020/carousel/src/carousel-arrows.component.mjs +0 -80
  31. package/esm2020/carousel/src/carousel-item.component.mjs +0 -21
  32. package/esm2020/carousel/src/carousel-pager.component.mjs +0 -74
  33. package/esm2020/carousel/src/carousel-splidejs.class.mjs +0 -91
  34. package/esm2020/carousel/src/carousel.class.mjs +0 -10
  35. package/esm2020/carousel/src/carousel.component.mjs +0 -438
  36. package/esm2020/carousel/src/carousel.module.mjs +0 -24
  37. package/fesm2015/acorex-components-carousel.mjs +0 -726
  38. package/fesm2015/acorex-components-carousel.mjs.map +0 -1
  39. package/fesm2020/acorex-components-carousel.mjs +0 -722
  40. package/fesm2020/acorex-components-carousel.mjs.map +0 -1
@@ -1,726 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, Input, Optional, NgModule } from '@angular/core';
3
- import { AXBaseComponentMixin } from '@acorex/components/mixin';
4
- import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
5
- import * as i2 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
-
8
- class AXCarouselCore {
9
- }
10
- AXCarouselCore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselCore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11
- AXCarouselCore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselCore });
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselCore, decorators: [{
13
- type: Injectable
14
- }] });
15
-
16
- class AXCarouselSplideJS {
17
- constructor() {
18
- }
19
- mount(instance) {
20
- this._instance = instance;
21
- this._instance.host.classList.add('splide');
22
- this._instance.host.querySelector('.ax-carousel-list-container').classList.add('splide__track');
23
- const listElement = this._instance.host.querySelector('.ax-carousel-list');
24
- listElement === null || listElement === void 0 ? void 0 : listElement.classList.add('splide__list');
25
- //
26
- this.rebuild();
27
- this._instance.onItemsChanged.subscribe((items) => {
28
- var _a;
29
- (_a = items === null || items === void 0 ? void 0 : items.value) === null || _a === void 0 ? void 0 : _a.forEach(i => i.classList.add('splide__slide'));
30
- this._ref.refresh();
31
- });
32
- this._instance.items = Array.from(listElement.querySelectorAll('ax-carousel-item'));
33
- this._instance.onOptionsChanged.subscribe(() => {
34
- this.rebuild();
35
- });
36
- }
37
- _emitOnSlideChanged(i) {
38
- const oldValue = this._instance.visibleIndex;
39
- this._instance.visibleIndex = i;
40
- this._instance.onSlideChanged.emit({
41
- component: this,
42
- htmlElement: this._instance.host,
43
- value: this._instance.visibleIndex,
44
- oldValue
45
- });
46
- }
47
- _getConfig() {
48
- return {
49
- autoplay: this._instance.autoplay,
50
- type: this._instance.loop && !this._instance.rewind ? 'loop' : 'slide',
51
- rewind: this._instance.rewind,
52
- gap: this._instance.gap,
53
- perPage: this._instance.perPage,
54
- perMove: this._instance.perMove,
55
- start: this._instance.visibleIndex,
56
- interval: this._instance.interval,
57
- direction: this._instance.vertical ? 'ttb' : (this._instance.rtl ? 'rtl' : 'ltr'),
58
- arrows: false,
59
- pagination: false,
60
- padding: this._instance.padding,
61
- autoWidth: this._instance.autoWidth,
62
- focus: this._instance.centered ? 'center' : this._instance.focus,
63
- height: this._instance.height,
64
- fixedHeight: this._instance.fixedHeight,
65
- heightRatio: this._instance.heightRatio,
66
- wheel: this._instance.wheel,
67
- width: this._instance.width,
68
- fixedWidth: this._instance.fixedWidth,
69
- drag: this._instance.drag,
70
- snap: this._instance.snap,
71
- breakpoints: this._instance.breakpoints,
72
- };
73
- }
74
- next() {
75
- this._ref.go('+');
76
- }
77
- last() {
78
- this._ref.go(this._ref.length - 1);
79
- }
80
- prev() {
81
- this._ref.go('-');
82
- }
83
- first() {
84
- this._ref.go(0);
85
- }
86
- goToSlide(index) {
87
- this._ref.go(index);
88
- }
89
- goToPage(index) {
90
- this._ref.go(`>${index}`);
91
- }
92
- destroy() {
93
- this._ref.destroy();
94
- }
95
- rebuild() {
96
- if (this._ref) {
97
- this._ref.off('move');
98
- this._ref.destroy();
99
- }
100
- //
101
- this._ref = new Splide(this._instance.host, this._getConfig());
102
- this._ref.mount();
103
- this._ref.on('move', this._emitOnSlideChanged.bind(this));
104
- this._emitOnSlideChanged(this._instance.visibleIndex);
105
- }
106
- }
107
-
108
- class AXCarouselComponent extends AXBaseComponentMixin {
109
- constructor(elementRef, zone, cdr, core) {
110
- super(elementRef, cdr);
111
- this.zone = zone;
112
- this.core = core;
113
- this.onOptionsChanged = new EventEmitter();
114
- this.onSlideChanged = new EventEmitter();
115
- this.perMoveChange = new EventEmitter();
116
- this._perMove = 1;
117
- this.focusChange = new EventEmitter();
118
- this._focus = 0;
119
- this.breakpointsChange = new EventEmitter();
120
- this.heightRatioChange = new EventEmitter();
121
- this._heightRatio = 0;
122
- this.heightChange = new EventEmitter();
123
- this._height = 'auto';
124
- this.fixedHeightChange = new EventEmitter();
125
- this._fixedHeight = '';
126
- this.widthChange = new EventEmitter();
127
- this._width = 'fit-content';
128
- this.fixedWidthChange = new EventEmitter();
129
- this._fixedWidth = '';
130
- this.perPageChange = new EventEmitter();
131
- this._perPage = 1;
132
- this.gap = 10;
133
- this.autoplayChange = new EventEmitter();
134
- this._autoplay = false;
135
- this.snapChange = new EventEmitter();
136
- this._snap = false;
137
- this.autoWidthChange = new EventEmitter();
138
- this._autoWidth = true;
139
- this.dragChange = new EventEmitter();
140
- this._drag = true;
141
- this.wheelChange = new EventEmitter();
142
- this._wheel = false;
143
- this.intervalChange = new EventEmitter();
144
- this._interval = 3000;
145
- this.paddingChange = new EventEmitter();
146
- this._padding = 0;
147
- this.centeredChange = new EventEmitter();
148
- this._centered = false;
149
- this.verticalChange = new EventEmitter();
150
- this._vertical = false;
151
- this.loopChange = new EventEmitter();
152
- this._loop = false;
153
- this.rewindChange = new EventEmitter();
154
- this._rewind = false;
155
- this._visibleIndex = 0;
156
- this.onItemsChanged = new EventEmitter();
157
- this._items = [];
158
- }
159
- get perMove() {
160
- return this._perMove;
161
- }
162
- set perMove(v) {
163
- const val = Math.max(1, coerceNumberProperty(v));
164
- if (val != this._perMove) {
165
- this._perMove = val;
166
- if (this._perMove > 1) {
167
- this._vertical = false;
168
- }
169
- this.perMoveChange.emit(this.perMove);
170
- this.onOptionsChanged.emit();
171
- }
172
- }
173
- get focus() {
174
- return this._focus;
175
- }
176
- set focus(v) {
177
- if (v != this._focus) {
178
- this._focus = v;
179
- this.paddingChange.emit(v);
180
- this.onOptionsChanged.emit();
181
- }
182
- }
183
- get breakpoints() {
184
- return this._breakpoints;
185
- }
186
- set breakpoints(v) {
187
- if (v != this._breakpoints) {
188
- this._breakpoints = v;
189
- this.paddingChange.emit(v);
190
- this.onOptionsChanged.emit();
191
- }
192
- }
193
- get heightRatio() {
194
- return this._heightRatio;
195
- }
196
- set heightRatio(v) {
197
- if (v != this._heightRatio) {
198
- this._heightRatio = v;
199
- this.paddingChange.emit(v);
200
- this.onOptionsChanged.emit();
201
- }
202
- }
203
- get height() {
204
- return this._height;
205
- }
206
- set height(v) {
207
- const val = v;
208
- if (val != this._height) {
209
- this._height = val;
210
- this.heightChange.emit(this.height);
211
- this.onOptionsChanged.emit();
212
- }
213
- }
214
- get fixedHeight() {
215
- return this._fixedHeight;
216
- }
217
- set fixedHeight(v) {
218
- const val = v;
219
- if (val != this._fixedHeight) {
220
- this._fixedHeight = val;
221
- this.fixedHeightChange.emit(this.fixedHeight);
222
- this.onOptionsChanged.emit();
223
- }
224
- }
225
- get width() {
226
- return this._width;
227
- }
228
- set width(v) {
229
- const val = v;
230
- if (val != this._width) {
231
- this._width = val;
232
- this.widthChange.emit(this.width);
233
- this.onOptionsChanged.emit();
234
- }
235
- }
236
- get fixedWidth() {
237
- return this._fixedWidth;
238
- }
239
- set fixedWidth(v) {
240
- const val = v;
241
- if (val != this._fixedWidth) {
242
- this._fixedWidth = val;
243
- this.fixedWidthChange.emit(this.fixedWidth);
244
- this.onOptionsChanged.emit();
245
- }
246
- }
247
- get perPage() {
248
- return this._perPage;
249
- }
250
- set perPage(v) {
251
- const val = v;
252
- if (val != this._perPage) {
253
- this._perPage = val;
254
- this.perPageChange.emit(this.perPage);
255
- this.onOptionsChanged.emit();
256
- }
257
- }
258
- get autoplay() {
259
- return this._autoplay;
260
- }
261
- set autoplay(v) {
262
- const val = coerceBooleanProperty(v);
263
- if (val != this._autoplay) {
264
- this._autoplay = val;
265
- this.autoplayChange.emit(this.autoplay);
266
- this.onOptionsChanged.emit();
267
- }
268
- }
269
- get snap() {
270
- return this._snap;
271
- }
272
- set snap(v) {
273
- const val = coerceBooleanProperty(v);
274
- if (val != this._snap) {
275
- this._snap = val;
276
- this.snapChange.emit(this.snap);
277
- this.onOptionsChanged.emit();
278
- }
279
- }
280
- get autoWidth() {
281
- return this._autoWidth;
282
- }
283
- set autoWidth(v) {
284
- const val = coerceBooleanProperty(v);
285
- if (val != this._autoWidth) {
286
- this._autoWidth = val;
287
- this.autoWidthChange.emit(this.autoWidth);
288
- this.onOptionsChanged.emit();
289
- }
290
- }
291
- get drag() {
292
- return this._drag;
293
- }
294
- set drag(v) {
295
- const val = v;
296
- if (val != this._drag) {
297
- this._drag = val;
298
- this.dragChange.emit(this.drag);
299
- this.onOptionsChanged.emit();
300
- }
301
- }
302
- get wheel() {
303
- return this._wheel;
304
- }
305
- set wheel(v) {
306
- const val = coerceBooleanProperty(v);
307
- if (val != this._wheel) {
308
- this._wheel = val;
309
- this.wheelChange.emit(this.wheel);
310
- this.onOptionsChanged.emit();
311
- }
312
- }
313
- get interval() {
314
- return this._interval;
315
- }
316
- set interval(v) {
317
- const val = coerceNumberProperty(v);
318
- if (val != this._interval) {
319
- this.intervalChange.emit(val);
320
- this.onOptionsChanged.emit();
321
- }
322
- }
323
- get padding() {
324
- return this._padding;
325
- }
326
- set padding(v) {
327
- if (v != this._padding) {
328
- this._padding = v;
329
- this.paddingChange.emit(v);
330
- this.onOptionsChanged.emit();
331
- }
332
- }
333
- get centered() {
334
- return this._centered;
335
- }
336
- set centered(v) {
337
- const val = coerceBooleanProperty(v);
338
- if (val != this._centered) {
339
- this._centered = val;
340
- if (this._centered) {
341
- this._rewind = false;
342
- }
343
- this.centeredChange.emit(this.centered);
344
- this.rewindChange.emit(this.rewind);
345
- this.onOptionsChanged.emit();
346
- }
347
- }
348
- get vertical() {
349
- return this._vertical;
350
- }
351
- set vertical(v) {
352
- const val = coerceBooleanProperty(v);
353
- if (val != this._vertical) {
354
- this._vertical = val;
355
- this.verticalChange.emit(this.vertical);
356
- this.onOptionsChanged.emit();
357
- }
358
- }
359
- get loop() {
360
- return this._loop;
361
- }
362
- set loop(v) {
363
- const val = coerceBooleanProperty(v);
364
- if (val != this._loop) {
365
- this._loop = val;
366
- if (this._loop) {
367
- this._rewind = false;
368
- }
369
- this.loopChange.emit(this.loop);
370
- this.rewindChange.emit(this.rewind);
371
- this.onOptionsChanged.emit();
372
- }
373
- }
374
- get rewind() {
375
- return this._rewind;
376
- }
377
- set rewind(v) {
378
- const val = coerceBooleanProperty(v);
379
- if (val != this._rewind) {
380
- this._rewind = val;
381
- if (this._rewind) {
382
- this._loop = false;
383
- this._centered = false;
384
- }
385
- this.rewindChange.emit(this.rewind);
386
- this.loopChange.emit(this.loop);
387
- this.centeredChange.emit(this.centered);
388
- this.onOptionsChanged.emit();
389
- }
390
- }
391
- get visibleIndex() {
392
- return this._visibleIndex;
393
- }
394
- set visibleIndex(v) {
395
- this._visibleIndex = v;
396
- }
397
- get items() {
398
- var _a;
399
- return (_a = this._items) !== null && _a !== void 0 ? _a : [];
400
- }
401
- set items(v) {
402
- const oldValue = this.items.slice();
403
- this._items = v;
404
- this.onItemsChanged.emit({
405
- component: this,
406
- htmlElement: this._getHostElement(),
407
- oldValue,
408
- value: this.items
409
- });
410
- }
411
- onViewInit() {
412
- this.core.mount(this);
413
- }
414
- next() {
415
- this.core.next();
416
- }
417
- last() {
418
- this.core.last();
419
- }
420
- prev() {
421
- this.core.prev();
422
- }
423
- first() {
424
- this.core.first();
425
- }
426
- goToSlide(index) {
427
- this.core.goToSlide(index);
428
- }
429
- goToPage(index) {
430
- this.core.goToPage(index);
431
- }
432
- get host() {
433
- return this._getHostElement();
434
- }
435
- onDestroy() {
436
- this.core.destroy();
437
- }
438
- }
439
- AXCarouselComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: AXCarouselCore }], target: i0.ɵɵFactoryTarget.Component });
440
- AXCarouselComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: AXCarouselComponent, selector: "ax-carousel", inputs: { perMove: "perMove", focus: "focus", breakpoints: "breakpoints", heightRatio: "heightRatio", height: "height", fixedHeight: "fixedHeight", width: "width", fixedWidth: "fixedWidth", perPage: "perPage", gap: "gap", autoplay: "autoplay", snap: "snap", autoWidth: "autoWidth", drag: "drag", wheel: "wheel", interval: "interval", padding: "padding", centered: "centered", vertical: "vertical", loop: "loop", rewind: "rewind" }, outputs: { onOptionsChanged: "onOptionsChanged", onSlideChanged: "onSlideChanged", perMoveChange: "perMoveChange", focusChange: "focusChange", breakpointsChange: "breakpointsChange", heightRatioChange: "heightRatioChange", heightChange: "heightChange", fixedHeightChange: "fixedHeightChange", widthChange: "widthChange", fixedWidthChange: "fixedWidthChange", perPageChange: "perPageChange", autoplayChange: "autoplayChange", snapChange: "snapChange", autoWidthChange: "autoWidthChange", dragChange: "dragChange", wheelChange: "wheelChange", intervalChange: "intervalChange", paddingChange: "paddingChange", centeredChange: "centeredChange", verticalChange: "verticalChange", loopChange: "loopChange", rewindChange: "rewindChange", onItemsChanged: "onItemsChanged" }, host: { classAttribute: "ax-carousel" }, providers: [{
441
- provide: AXCarouselCore,
442
- useClass: AXCarouselSplideJS
443
- }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-carousel-list-container\">\r\n <div class=\"ax-carousel-list\">\r\n <ng-content select=\"ax-carousel-item\">\r\n </ng-content>\r\n </div>\r\n <ng-content select=\"ax-carousel-arrows\">\r\n </ng-content>\r\n</div>\r\n\r\n<ng-content select=\"ax-carousel-pager\">\r\n</ng-content>", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
444
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselComponent, decorators: [{
445
- type: Component,
446
- args: [{ selector: 'ax-carousel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'ax-carousel' }, providers: [{
447
- provide: AXCarouselCore,
448
- useClass: AXCarouselSplideJS
449
- }], template: "<div class=\"ax-carousel-list-container\">\r\n <div class=\"ax-carousel-list\">\r\n <ng-content select=\"ax-carousel-item\">\r\n </ng-content>\r\n </div>\r\n <ng-content select=\"ax-carousel-arrows\">\r\n </ng-content>\r\n</div>\r\n\r\n<ng-content select=\"ax-carousel-pager\">\r\n</ng-content>" }]
450
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: AXCarouselCore }]; }, propDecorators: { onOptionsChanged: [{
451
- type: Output
452
- }], onSlideChanged: [{
453
- type: Output
454
- }], perMoveChange: [{
455
- type: Output
456
- }], perMove: [{
457
- type: Input
458
- }], focusChange: [{
459
- type: Output
460
- }], focus: [{
461
- type: Input
462
- }], breakpointsChange: [{
463
- type: Output
464
- }], breakpoints: [{
465
- type: Input
466
- }], heightRatioChange: [{
467
- type: Output
468
- }], heightRatio: [{
469
- type: Input
470
- }], heightChange: [{
471
- type: Output
472
- }], height: [{
473
- type: Input
474
- }], fixedHeightChange: [{
475
- type: Output
476
- }], fixedHeight: [{
477
- type: Input
478
- }], widthChange: [{
479
- type: Output
480
- }], width: [{
481
- type: Input
482
- }], fixedWidthChange: [{
483
- type: Output
484
- }], fixedWidth: [{
485
- type: Input
486
- }], perPageChange: [{
487
- type: Output
488
- }], perPage: [{
489
- type: Input
490
- }], gap: [{
491
- type: Input
492
- }], autoplayChange: [{
493
- type: Output
494
- }], autoplay: [{
495
- type: Input
496
- }], snapChange: [{
497
- type: Output
498
- }], snap: [{
499
- type: Input
500
- }], autoWidthChange: [{
501
- type: Output
502
- }], autoWidth: [{
503
- type: Input
504
- }], dragChange: [{
505
- type: Output
506
- }], drag: [{
507
- type: Input
508
- }], wheelChange: [{
509
- type: Output
510
- }], wheel: [{
511
- type: Input
512
- }], intervalChange: [{
513
- type: Output
514
- }], interval: [{
515
- type: Input
516
- }], paddingChange: [{
517
- type: Output
518
- }], padding: [{
519
- type: Input
520
- }], centeredChange: [{
521
- type: Output
522
- }], centered: [{
523
- type: Input
524
- }], verticalChange: [{
525
- type: Output
526
- }], vertical: [{
527
- type: Input
528
- }], loopChange: [{
529
- type: Output
530
- }], loop: [{
531
- type: Input
532
- }], rewindChange: [{
533
- type: Output
534
- }], rewind: [{
535
- type: Input
536
- }], onItemsChanged: [{
537
- type: Output
538
- }] } });
539
-
540
- class AXCarouselArrowsComponent extends AXBaseComponentMixin {
541
- constructor(elementRef, cdr, parent) {
542
- super(elementRef, cdr);
543
- this.parent = parent;
544
- this.onNextClick = new EventEmitter();
545
- this.onPrevClick = new EventEmitter();
546
- }
547
- _handlePrevClick(e) {
548
- e.stopPropagation();
549
- this.parent.prev();
550
- }
551
- _handleNextClick(e) {
552
- e.stopPropagation();
553
- this.parent.next();
554
- }
555
- }
556
- AXCarouselArrowsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselArrowsComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: AXCarouselComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
557
- AXCarouselArrowsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: AXCarouselArrowsComponent, selector: "ax-carousel-arrows", inputs: { class: "class" }, outputs: { onNextClick: "onNextClick", onPrevClick: "onPrevClick" }, host: { classAttribute: "ax-carousel-arrows" }, usesInheritance: true, ngImport: i0, template: `
558
- <button
559
- class="ax-carousel-arrow-prev"
560
- [ngClass]="{ 'ax-vertical-arrow ax-top-arrow': this.parent.vertical }"
561
- (click)="_handlePrevClick($event)"
562
- >
563
- <i class="ax-ic ax-ic-chevron ax-block rtl:ax-rotate-180 {{ class }}"></i>
564
- </button>
565
- <button
566
- class="ax-carousel-arrow-next"
567
- [ngClass]="{ 'ax-vertical-arrow ax-bottom-arrow': this.parent.vertical }"
568
- (click)="_handleNextClick($event)"
569
- >
570
- <i
571
- class="ax-ic ax-ic-chevron ax-block ax-rotate-180 rtl:ax-rotate-0 {{
572
- class
573
- }}"
574
- ></i>
575
- </button>
576
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
577
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselArrowsComponent, decorators: [{
578
- type: Component,
579
- args: [{
580
- selector: 'ax-carousel-arrows',
581
- template: `
582
- <button
583
- class="ax-carousel-arrow-prev"
584
- [ngClass]="{ 'ax-vertical-arrow ax-top-arrow': this.parent.vertical }"
585
- (click)="_handlePrevClick($event)"
586
- >
587
- <i class="ax-ic ax-ic-chevron ax-block rtl:ax-rotate-180 {{ class }}"></i>
588
- </button>
589
- <button
590
- class="ax-carousel-arrow-next"
591
- [ngClass]="{ 'ax-vertical-arrow ax-bottom-arrow': this.parent.vertical }"
592
- (click)="_handleNextClick($event)"
593
- >
594
- <i
595
- class="ax-ic ax-ic-chevron ax-block ax-rotate-180 rtl:ax-rotate-0 {{
596
- class
597
- }}"
598
- ></i>
599
- </button>
600
- `,
601
- changeDetection: ChangeDetectionStrategy.OnPush,
602
- encapsulation: ViewEncapsulation.None,
603
- host: { class: 'ax-carousel-arrows' },
604
- }]
605
- }], ctorParameters: function () {
606
- return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXCarouselComponent, decorators: [{
607
- type: Optional
608
- }] }];
609
- }, propDecorators: { class: [{
610
- type: Input
611
- }], onNextClick: [{
612
- type: Output
613
- }], onPrevClick: [{
614
- type: Output
615
- }] } });
616
-
617
- class AXCarouselItemComponent extends AXBaseComponentMixin {
618
- constructor(elementRef, cdr) {
619
- super(elementRef, cdr);
620
- }
621
- }
622
- AXCarouselItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
623
- AXCarouselItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: AXCarouselItemComponent, selector: "ax-carousel-item", host: { classAttribute: "ax-carousel-item" }, usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselItemComponent, decorators: [{
625
- type: Component,
626
- args: [{
627
- selector: 'ax-carousel-item',
628
- template: '<ng-content></ng-content>',
629
- changeDetection: ChangeDetectionStrategy.OnPush,
630
- encapsulation: ViewEncapsulation.None,
631
- host: { class: 'ax-carousel-item' }
632
- }]
633
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; } });
634
-
635
- class AXCarouselPagerComponent extends AXBaseComponentMixin {
636
- constructor(elementRef, cdr, _parent) {
637
- super(elementRef, cdr);
638
- this.cdr = cdr;
639
- this._parent = _parent;
640
- this._visibleIndex = 0;
641
- this._pageIndex = 0;
642
- this._size = 1;
643
- this._dots = [];
644
- this._subs = [];
645
- _parent.perPageChange.subscribe(c => {
646
- this._size = c;
647
- this._generateDots();
648
- });
649
- _parent.onSlideChanged.subscribe((c) => {
650
- this._visibleIndex = c.value;
651
- this._generateDots();
652
- });
653
- _parent.onItemsChanged.subscribe(c => {
654
- this._generateDots();
655
- });
656
- }
657
- onViewInit() {
658
- this._size = this._parent.perPage;
659
- this._visibleIndex = this._parent.visibleIndex;
660
- this._generateDots();
661
- }
662
- _generateDots() {
663
- this._dots = [...Array(Math.ceil(this._parent.items.length / this._size)).keys()];
664
- this._setPageIndex(this._findPageIndex(this._visibleIndex));
665
- this.cdr.detectChanges();
666
- }
667
- _handleClick(e, index) {
668
- e.stopPropagation();
669
- this._setPageIndex(index);
670
- this._parent.goToPage(index);
671
- }
672
- _setPageIndex(index) {
673
- this._pageIndex = index;
674
- this.cdr.detectChanges();
675
- }
676
- _findPageIndex(slideIndex) {
677
- return Math.min(Math.ceil(slideIndex / this._size), this._dots.length - 1);
678
- }
679
- onDestroy() {
680
- this._subs.forEach(s => {
681
- s.unsubscribe();
682
- });
683
- }
684
- }
685
- AXCarouselPagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselPagerComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: AXCarouselComponent }], target: i0.ɵɵFactoryTarget.Component });
686
- AXCarouselPagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: AXCarouselPagerComponent, selector: "ax-carousel-pager", host: { classAttribute: "ax-carousel-pager" }, usesInheritance: true, ngImport: i0, template: `
687
- <button *ngFor="let d of _dots;let i=index" [class.ax-state-active]="i==_pageIndex" (click)="_handleClick($event,i)">
688
- </button>
689
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
690
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselPagerComponent, decorators: [{
691
- type: Component,
692
- args: [{
693
- selector: 'ax-carousel-pager',
694
- template: `
695
- <button *ngFor="let d of _dots;let i=index" [class.ax-state-active]="i==_pageIndex" (click)="_handleClick($event,i)">
696
- </button>
697
- `,
698
- changeDetection: ChangeDetectionStrategy.OnPush,
699
- encapsulation: ViewEncapsulation.None,
700
- host: { class: 'ax-carousel-pager' }
701
- }]
702
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXCarouselComponent }]; } });
703
-
704
- const COMPONENT = [AXCarouselComponent, AXCarouselItemComponent, AXCarouselArrowsComponent, AXCarouselPagerComponent];
705
- const MODULES = [CommonModule];
706
- class AXCarouselModule {
707
- }
708
- AXCarouselModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
709
- AXCarouselModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselModule, declarations: [AXCarouselComponent, AXCarouselItemComponent, AXCarouselArrowsComponent, AXCarouselPagerComponent], imports: [CommonModule], exports: [AXCarouselComponent, AXCarouselItemComponent, AXCarouselArrowsComponent, AXCarouselPagerComponent] });
710
- AXCarouselModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselModule, imports: [MODULES] });
711
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: AXCarouselModule, decorators: [{
712
- type: NgModule,
713
- args: [{
714
- declarations: [...COMPONENT],
715
- imports: [...MODULES],
716
- exports: [...COMPONENT],
717
- providers: [],
718
- }]
719
- }] });
720
-
721
- /**
722
- * Generated bundle index. Do not edit.
723
- */
724
-
725
- export { AXCarouselArrowsComponent, AXCarouselComponent, AXCarouselCore, AXCarouselItemComponent, AXCarouselModule, AXCarouselPagerComponent, AXCarouselSplideJS };
726
- //# sourceMappingURL=acorex-components-carousel.mjs.map