codexly-ui 0.10.40 → 0.10.42
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/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -12395,6 +12395,18 @@ class ClxCarouselComponent {
|
|
|
12395
12395
|
_autoPlayTimer = null;
|
|
12396
12396
|
_touchStartX = 0;
|
|
12397
12397
|
_zone;
|
|
12398
|
+
/** True while the window is actively being resized — suppresses the track's transition so the
|
|
12399
|
+
* browser doesn't re-trigger a 500ms transform animation on every resize frame (translateX uses
|
|
12400
|
+
* a % value, which resolves to a new pixel value on each frame and reads as a "change"). */
|
|
12401
|
+
_resizing = signal(false, ...(ngDevMode ? [{ debugName: "_resizing" }] : /* istanbul ignore next */ []));
|
|
12402
|
+
_resizeEndTimer = null;
|
|
12403
|
+
_resizeListener = () => {
|
|
12404
|
+
if (!this._resizing())
|
|
12405
|
+
this._zone.run(() => this._resizing.set(true));
|
|
12406
|
+
if (this._resizeEndTimer)
|
|
12407
|
+
clearTimeout(this._resizeEndTimer);
|
|
12408
|
+
this._resizeEndTimer = setTimeout(() => this._zone.run(() => this._resizing.set(false)), 400);
|
|
12409
|
+
};
|
|
12398
12410
|
_aspectClass = computed(() => CAROUSEL_ASPECT_RATIO_MAP[this.aspectRatio()] ?? '', ...(ngDevMode ? [{ debugName: "_aspectClass" }] : /* istanbul ignore next */ []));
|
|
12399
12411
|
_viewportClass = computed(() => {
|
|
12400
12412
|
const base = this._aspectClass();
|
|
@@ -12420,6 +12432,9 @@ class ClxCarouselComponent {
|
|
|
12420
12432
|
if (active)
|
|
12421
12433
|
this._startTimer(ms);
|
|
12422
12434
|
});
|
|
12435
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
12436
|
+
this._zone.runOutsideAngular(() => window.addEventListener('resize', this._resizeListener));
|
|
12437
|
+
}
|
|
12423
12438
|
}
|
|
12424
12439
|
ngAfterContentInit() {
|
|
12425
12440
|
if (this.autoPlay())
|
|
@@ -12427,6 +12442,10 @@ class ClxCarouselComponent {
|
|
|
12427
12442
|
}
|
|
12428
12443
|
ngOnDestroy() {
|
|
12429
12444
|
this._clearTimer();
|
|
12445
|
+
if (typeof window !== 'undefined')
|
|
12446
|
+
window.removeEventListener('resize', this._resizeListener);
|
|
12447
|
+
if (this._resizeEndTimer)
|
|
12448
|
+
clearTimeout(this._resizeEndTimer);
|
|
12430
12449
|
}
|
|
12431
12450
|
next() {
|
|
12432
12451
|
const total = this._slides().length;
|
|
@@ -12495,7 +12514,9 @@ class ClxCarouselComponent {
|
|
|
12495
12514
|
(touchend)="_onTouchEnd($event)">
|
|
12496
12515
|
|
|
12497
12516
|
<!-- Track -->
|
|
12498
|
-
<div class="flex h-full
|
|
12517
|
+
<div class="flex h-full ease-in-out will-change-transform"
|
|
12518
|
+
[class.transition-transform]="!_resizing()"
|
|
12519
|
+
[class.duration-500]="!_resizing()"
|
|
12499
12520
|
[style.transform]="'translateX(-' + currentPageIndex() * 100 + '%)'">
|
|
12500
12521
|
@for (slide of _slides(); track slide) {
|
|
12501
12522
|
<div class="flex-none w-full h-full">
|
|
@@ -12563,7 +12584,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12563
12584
|
(touchend)="_onTouchEnd($event)">
|
|
12564
12585
|
|
|
12565
12586
|
<!-- Track -->
|
|
12566
|
-
<div class="flex h-full
|
|
12587
|
+
<div class="flex h-full ease-in-out will-change-transform"
|
|
12588
|
+
[class.transition-transform]="!_resizing()"
|
|
12589
|
+
[class.duration-500]="!_resizing()"
|
|
12567
12590
|
[style.transform]="'translateX(-' + currentPageIndex() * 100 + '%)'">
|
|
12568
12591
|
@for (slide of _slides(); track slide) {
|
|
12569
12592
|
<div class="flex-none w-full h-full">
|