|
|
|
|
@ -86,11 +86,20 @@ export class CarouselProvider {
|
|
|
|
|
if (!opts.autoplay.current) return;
|
|
|
|
|
if (this.isDisabled) return;
|
|
|
|
|
if (this.paused) return;
|
|
|
|
|
const id = setInterval(() => this.next(), opts.autoplayDelay.current);
|
|
|
|
|
return () => clearInterval(id);
|
|
|
|
|
const handle = this.soma.uix.timers.interval(
|
|
|
|
|
this.autoplayTimerKey,
|
|
|
|
|
opts.autoplayDelay.current,
|
|
|
|
|
() => this.next(),
|
|
|
|
|
{ replace: true, meta: { component: 'carousel', action: 'autoplay' } }
|
|
|
|
|
);
|
|
|
|
|
return () => handle.cancel();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private get autoplayTimerKey() {
|
|
|
|
|
return `soma:carousel:${this.opts.id.current}:autoplay`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Slide detection (live DOM query) ────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
getItems(): HTMLElement[] {
|
|
|
|
|
|