@cdevhub/ngx-tw 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +264 -49
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +11 -7
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-alert.mjs +43 -29
- package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs +103 -0
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +56 -31
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +61 -35
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +154 -93
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +35 -22
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +416 -216
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +152 -81
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +99 -47
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +42 -29
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +46 -29
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +205 -110
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +141 -74
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +16 -11
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +395 -149
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +305 -150
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +56 -43
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +51 -33
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +905 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +49 -26
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +133 -74
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +28 -17
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +37 -21
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +63 -48
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +622 -0
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +142 -72
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +101 -46
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +57 -30
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +108 -57
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +46 -26
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select.mjs +227 -122
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-separator.mjs +21 -12
- package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +58 -44
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs +25 -14
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +155 -79
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +47 -25
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs +29 -16
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -42
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +107 -64
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +113 -47
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +61 -32
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +88 -42
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +266 -118
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +102 -52
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +798 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +16 -8
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +22 -14
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +243 -95
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +149 -82
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +100 -55
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +50 -28
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +1129 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +554 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw.mjs +7 -0
- package/fesm2022/cdevhub-ngx-tw.mjs.map +1 -1
- package/package.json +45 -17
- package/theme/_dark.css +16 -12
- package/theme/_semantic.css +3 -2
- package/theme/index.css +10 -2
- package/types/cdevhub-ngx-tw-aspect-ratio.d.ts +40 -0
- package/types/cdevhub-ngx-tw-calendar.d.ts +39 -8
- package/types/cdevhub-ngx-tw-code-block.d.ts +8 -7
- package/types/cdevhub-ngx-tw-command-palette.d.ts +7 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +36 -10
- package/types/cdevhub-ngx-tw-file-upload.d.ts +250 -0
- package/types/cdevhub-ngx-tw-form-field.d.ts +22 -3
- package/types/cdevhub-ngx-tw-icon-lucide.d.ts +21 -3
- package/types/cdevhub-ngx-tw-number-input.d.ts +130 -0
- package/types/cdevhub-ngx-tw-popover.d.ts +8 -0
- package/types/cdevhub-ngx-tw-select.d.ts +1 -1
- package/types/cdevhub-ngx-tw-stepper.d.ts +30 -2
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +8 -0
- package/types/cdevhub-ngx-tw-table.d.ts +30 -1
- package/types/cdevhub-ngx-tw-tabs.d.ts +8 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +217 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +31 -6
- package/types/cdevhub-ngx-tw-toast.d.ts +1 -1
- package/types/cdevhub-ngx-tw-transfer.d.ts +330 -0
- package/types/cdevhub-ngx-tw-tree.d.ts +189 -0
- package/types/cdevhub-ngx-tw.d.ts +7 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, ElementRef, signal, computed, ChangeDetectionStrategy, Component, model, output, DestroyRef, viewChild, contentChildren, afterNextRender, isDevMode, effect, Directive } from '@angular/core';
|
|
2
|
+
import { input, inject, ElementRef, signal, computed, ChangeDetectionStrategy, Component, model, output, DestroyRef, viewChild, contentChildren, afterNextRender, isDevMode, effect, untracked, Directive } from '@angular/core';
|
|
3
3
|
import { tv } from 'tailwind-variants';
|
|
4
4
|
|
|
5
5
|
// `CarouselComponent` is the canonical "structural-layout primitive" exception
|
|
@@ -236,18 +236,23 @@ const carouselVariants = tv({
|
|
|
236
236
|
*/
|
|
237
237
|
class CarouselSlideComponent {
|
|
238
238
|
/** Optional human-readable label for the slide. When provided, used in the slide's `aria-label` as `"{index + 1} of {total}: {label}"`. When `null`, uses `"{index + 1} of {total}"` only. Defaults to `null`. */
|
|
239
|
-
label = input(null,
|
|
239
|
+
label = input(null, /* @ts-ignore */
|
|
240
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
240
241
|
/** When `true`, the slide is rendered but skipped by Prev/Next, Indicators, keyboard nav, and autoplay. Programmatic `scrollTo` still lands on it. Visually muted (`opacity-50`, `cursor-not-allowed`). Defaults to `false`. */
|
|
241
|
-
disabled = input(false,
|
|
242
|
+
disabled = input(false, /* @ts-ignore */
|
|
243
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
242
244
|
/** @internal Direct parent carousel. A `tw-carousel-slide` outside a `tw-carousel` is a programmer error — the DI failure throws naturally. */
|
|
243
245
|
carousel = inject(CarouselComponent);
|
|
244
246
|
/** @internal Host element reference used by the carousel's `IntersectionObserver`. */
|
|
245
247
|
_hostEl = inject((ElementRef)).nativeElement;
|
|
246
248
|
/** @internal Visibility flag set by the carousel's IntersectionObserver. Initial value is `true` so the first paint does not flash `inert` on every slide. */
|
|
247
|
-
_isVisible = signal(true,
|
|
248
|
-
|
|
249
|
+
_isVisible = signal(true, /* @ts-ignore */
|
|
250
|
+
...(ngDevMode ? [{ debugName: "_isVisible" }] : /* istanbul ignore next */ []));
|
|
251
|
+
_isHidden = computed(() => !this._isVisible(), /* @ts-ignore */
|
|
252
|
+
...(ngDevMode ? [{ debugName: "_isHidden" }] : /* istanbul ignore next */ []));
|
|
249
253
|
/** @internal 0-based index in the parent carousel's slide content. -1 until contentChildren materialises. */
|
|
250
|
-
index = computed(() => this.carousel.slides().indexOf(this),
|
|
254
|
+
index = computed(() => this.carousel.slides().indexOf(this), /* @ts-ignore */
|
|
255
|
+
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
251
256
|
/** @internal Resolved `aria-label` per the `slideOf` / `slideOfWithLabel` template. */
|
|
252
257
|
accessibleName = computed(() => {
|
|
253
258
|
const labels = this.carousel.resolvedLabels();
|
|
@@ -266,17 +271,20 @@ class CarouselSlideComponent {
|
|
|
266
271
|
index: oneBasedIndex,
|
|
267
272
|
total,
|
|
268
273
|
});
|
|
269
|
-
},
|
|
274
|
+
}, /* @ts-ignore */
|
|
275
|
+
...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
270
276
|
slideClasses = computed(() => {
|
|
271
277
|
const base = this.carousel._slotClasses().slide();
|
|
272
278
|
return this.disabled() ? `${base} opacity-50 cursor-not-allowed` : base;
|
|
273
|
-
},
|
|
279
|
+
}, /* @ts-ignore */
|
|
280
|
+
...(ngDevMode ? [{ debugName: "slideClasses" }] : /* istanbul ignore next */ []));
|
|
274
281
|
/** @internal Per-slide `flex-basis`. Reads from the carousel so each slide sizes along the viewport's main axis (width for horizontal, height for vertical via `flex-direction`). */
|
|
275
|
-
_basis = computed(() => this.carousel.slideBasis(),
|
|
276
|
-
|
|
277
|
-
static
|
|
282
|
+
_basis = computed(() => this.carousel.slideBasis(), /* @ts-ignore */
|
|
283
|
+
...(ngDevMode ? [{ debugName: "_basis" }] : /* istanbul ignore next */ []));
|
|
284
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselSlideComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
285
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.7", type: CarouselSlideComponent, isStandalone: true, selector: "tw-carousel-slide", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-roledescription": "\"slide\"", "attr.aria-label": "accessibleName()", "attr.aria-hidden": "_isHidden() ? \"true\" : null", "attr.inert": "_isHidden() ? \"\" : null", "class": "slideClasses()", "style.flex-basis": "_basis()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
278
286
|
}
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselSlideComponent, decorators: [{
|
|
280
288
|
type: Component,
|
|
281
289
|
args: [{
|
|
282
290
|
selector: 'tw-carousel-slide',
|
|
@@ -306,37 +314,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
306
314
|
class CarouselComponent {
|
|
307
315
|
// ── Inputs (17, cap-exempt: structural-layout primitive — precedent SplitComponent) ──
|
|
308
316
|
/** Axis along which slides flow. `'horizontal'` is the canonical case; `'vertical'` is supported for tickers and feature lists. Defaults to `'horizontal'`. */
|
|
309
|
-
orientation = input('horizontal',
|
|
317
|
+
orientation = input('horizontal', /* @ts-ignore */
|
|
318
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
310
319
|
/** Number of slides visible in the viewport. May be fractional (e.g. `1.2` for a "peek" of the next slide). Values below `0.5` are clamped to `0.5`; values above the slide count are clamped to the slide count. Defaults to `1`. */
|
|
311
|
-
slidesPerView = input(1,
|
|
320
|
+
slidesPerView = input(1, /* @ts-ignore */
|
|
321
|
+
...(ngDevMode ? [{ debugName: "slidesPerView" }] : /* istanbul ignore next */ []));
|
|
312
322
|
/** Number of slides advanced per navigation action (button click, keyboard, indicator). Non-integer values are floored. Defaults to `1`. */
|
|
313
|
-
slidesToScroll = input(1,
|
|
323
|
+
slidesToScroll = input(1, /* @ts-ignore */
|
|
324
|
+
...(ngDevMode ? [{ debugName: "slidesToScroll" }] : /* istanbul ignore next */ []));
|
|
314
325
|
/** Inter-slide gap on the scroll axis. Mapped via the canonical spacing scale. Defaults to `'md'`. */
|
|
315
|
-
gap = input('md',
|
|
326
|
+
gap = input('md', /* @ts-ignore */
|
|
327
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
316
328
|
/** When `true`, navigation wraps around at the boundaries. Prev at slide 0 jumps to the last page; Next at the last page jumps to slide 0. Implementation is jumpless via a brief opacity mask. Defaults to `false`. */
|
|
317
|
-
loop = input(false,
|
|
329
|
+
loop = input(false, /* @ts-ignore */
|
|
330
|
+
...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
|
|
318
331
|
/** When `true`, the carousel auto-advances by `slidesToScroll` every `autoplayInterval` ms. Pauses on hover, focus-in, drag, document hidden, or user interaction. Defaults to `false`. */
|
|
319
|
-
autoplay = input(false,
|
|
332
|
+
autoplay = input(false, /* @ts-ignore */
|
|
333
|
+
...(ngDevMode ? [{ debugName: "autoplay" }] : /* istanbul ignore next */ []));
|
|
320
334
|
/** Milliseconds between autoplay advances. Values below `1000` are clamped to `1000` per WCAG 2.2.2. Defaults to `5000`. */
|
|
321
|
-
autoplayInterval = input(5000,
|
|
335
|
+
autoplayInterval = input(5000, /* @ts-ignore */
|
|
336
|
+
...(ngDevMode ? [{ debugName: "autoplayInterval" }] : /* istanbul ignore next */ []));
|
|
322
337
|
/** Pauses autoplay while the pointer is over the container. Defaults to `true` because losing autoplay on hover is the expected gallery behavior — opt-out is the special case. */
|
|
323
|
-
pauseOnHover = input(true,
|
|
338
|
+
pauseOnHover = input(true, /* @ts-ignore */
|
|
339
|
+
...(ngDevMode ? [{ debugName: "pauseOnHover" }] : /* istanbul ignore next */ []));
|
|
324
340
|
/** Pauses autoplay while keyboard focus is anywhere inside the container. Defaults to `true` for WCAG 2.2.2 compliance — opt-out is the special case. */
|
|
325
|
-
pauseOnFocusIn = input(true,
|
|
341
|
+
pauseOnFocusIn = input(true, /* @ts-ignore */
|
|
342
|
+
...(ngDevMode ? [{ debugName: "pauseOnFocusIn" }] : /* istanbul ignore next */ []));
|
|
326
343
|
/** When `true`, the user may pan the slides via mouse pointer drag; touch is left to native scroll. Pointer events are intercepted only when the drag exceeds a 6-pixel threshold so clicks inside slides still work. Defaults to `true` because galleries are draggable by user expectation — opt-out is the special case. */
|
|
327
|
-
draggable = input(true,
|
|
344
|
+
draggable = input(true, /* @ts-ignore */
|
|
345
|
+
...(ngDevMode ? [{ debugName: "draggable" }] : /* istanbul ignore next */ []));
|
|
328
346
|
/** When `true`, the viewport responds to Arrow / Home / End / PageUp / PageDown when focus is inside it. Defaults to `true` for keyboard accessibility — opt-out is the special case. */
|
|
329
|
-
keyboard = input(true,
|
|
347
|
+
keyboard = input(true, /* @ts-ignore */
|
|
348
|
+
...(ngDevMode ? [{ debugName: "keyboard" }] : /* istanbul ignore next */ []));
|
|
330
349
|
/** CSS `scroll-snap-align` value applied to each slide. `'start'` is the standard gallery behavior; `'center'` is used for peek/preview layouts. Defaults to `'start'`. */
|
|
331
|
-
snapAlign = input('start',
|
|
350
|
+
snapAlign = input('start', /* @ts-ignore */
|
|
351
|
+
...(ngDevMode ? [{ debugName: "snapAlign" }] : /* istanbul ignore next */ []));
|
|
332
352
|
/** Two-way bound 0-based index of the first visible slide in the current page. Setting from the parent scrolls the viewport smoothly to align that slide; reading reflects user-driven scroll position after `scrollend`. Defaults to `0`. */
|
|
333
|
-
activeIndex = model(0,
|
|
353
|
+
activeIndex = model(0, /* @ts-ignore */
|
|
354
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
334
355
|
/** Accessible name for the carousel region. If both this and `ariaLabelledBy` are `null`, a one-time dev-mode `console.warn` is logged (production builds never log). Defaults to `null`. */
|
|
335
|
-
ariaLabel = input(null,
|
|
356
|
+
ariaLabel = input(null, /* @ts-ignore */
|
|
357
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
336
358
|
/** ID of an element labeling the carousel. Either `ariaLabel` or `ariaLabelledBy` SHOULD be provided. Defaults to `null`. */
|
|
337
|
-
ariaLabelledBy = input(null,
|
|
359
|
+
ariaLabelledBy = input(null, /* @ts-ignore */
|
|
360
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
|
|
338
361
|
/** Localizable strings for prev/next/pause/resume/indicator/slide-of templates. Unset keys fall back to the English defaults in `DEFAULT_CAROUSEL_LABELS`. Defaults to `{}`. */
|
|
339
|
-
labels = input({},
|
|
362
|
+
labels = input({}, /* @ts-ignore */
|
|
363
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
340
364
|
// ── Outputs ───────────────────────────────────────────────────
|
|
341
365
|
/** Fires when the active index changes. Payload identifies the previous and new index plus the trigger source. */
|
|
342
366
|
slideChange = output();
|
|
@@ -347,7 +371,8 @@ class CarouselComponent {
|
|
|
347
371
|
// ── Internal references ────────────────────────────────────────
|
|
348
372
|
_destroyRef = inject(DestroyRef);
|
|
349
373
|
/** @internal The scrollable viewport element. */
|
|
350
|
-
_viewportRef = viewChild.required('viewport'
|
|
374
|
+
_viewportRef = viewChild.required('viewport', /* @ts-ignore */
|
|
375
|
+
...(ngDevMode ? [{ debugName: "_viewportRef" }] : /* istanbul ignore next */ []));
|
|
351
376
|
/** @internal Projected slides in DOM order. */
|
|
352
377
|
slides = contentChildren(CarouselSlideComponent, { ...(ngDevMode ? { debugName: "slides" } : /* istanbul ignore next */ {}), descendants: false });
|
|
353
378
|
// ── Resolved configuration ─────────────────────────────────────
|
|
@@ -355,7 +380,8 @@ class CarouselComponent {
|
|
|
355
380
|
resolvedLabels = computed(() => ({
|
|
356
381
|
...DEFAULT_CAROUSEL_LABELS,
|
|
357
382
|
...this.labels(),
|
|
358
|
-
}),
|
|
383
|
+
}), /* @ts-ignore */
|
|
384
|
+
...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
|
|
359
385
|
/** @internal Effective `slidesPerView` clamped to `[0.5, slideCount]`. */
|
|
360
386
|
_effectiveSlidesPerView = computed(() => {
|
|
361
387
|
const count = this.slides().length;
|
|
@@ -363,15 +389,18 @@ class CarouselComponent {
|
|
|
363
389
|
if (count === 0)
|
|
364
390
|
return Math.max(0.5, raw);
|
|
365
391
|
return Math.max(0.5, Math.min(raw, count));
|
|
366
|
-
},
|
|
392
|
+
}, /* @ts-ignore */
|
|
393
|
+
...(ngDevMode ? [{ debugName: "_effectiveSlidesPerView" }] : /* istanbul ignore next */ []));
|
|
367
394
|
/** @internal Effective `slidesToScroll` floored to a positive integer. Read by child indicators directive (`CarouselIndicatorsComponent._onClick`) as a signal. */
|
|
368
395
|
_effectiveSlidesToScroll = computed(() => {
|
|
369
396
|
return Math.max(1, Math.floor(this.slidesToScroll()));
|
|
370
|
-
},
|
|
397
|
+
}, /* @ts-ignore */
|
|
398
|
+
...(ngDevMode ? [{ debugName: "_effectiveSlidesToScroll" }] : /* istanbul ignore next */ []));
|
|
371
399
|
/** @internal Autoplay interval clamped to ≥ 1000 ms per WCAG 2.2.2. */
|
|
372
400
|
_effectiveAutoplayInterval = computed(() => {
|
|
373
401
|
return Math.max(1000, this.autoplayInterval());
|
|
374
|
-
},
|
|
402
|
+
}, /* @ts-ignore */
|
|
403
|
+
...(ngDevMode ? [{ debugName: "_effectiveAutoplayInterval" }] : /* istanbul ignore next */ []));
|
|
375
404
|
/** Number of distinct pages (groups of `slidesToScroll` slides) the carousel can land on. Reactive. */
|
|
376
405
|
pageCount = computed(() => {
|
|
377
406
|
const count = this.slides().length;
|
|
@@ -380,58 +409,79 @@ class CarouselComponent {
|
|
|
380
409
|
const perView = this._effectiveSlidesPerView();
|
|
381
410
|
const toScroll = this._effectiveSlidesToScroll();
|
|
382
411
|
return Math.max(1, Math.ceil((count - perView) / toScroll) + 1);
|
|
383
|
-
},
|
|
412
|
+
}, /* @ts-ignore */
|
|
413
|
+
...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
|
|
384
414
|
/** 0-based page index that contains `activeIndex`. Reactive. */
|
|
385
415
|
activePage = computed(() => {
|
|
386
416
|
return Math.floor(this.activeIndex() / this._effectiveSlidesToScroll());
|
|
387
|
-
},
|
|
417
|
+
}, /* @ts-ignore */
|
|
418
|
+
...(ngDevMode ? [{ debugName: "activePage" }] : /* istanbul ignore next */ []));
|
|
388
419
|
/** The highest slide index the carousel can land on given the current `slidesPerView`. Equals `max(0, slideCount - ceil(effectiveSlidesPerView))`. Reactive. Every site that asks "where is the last legal landing position?" goes through this signal. */
|
|
389
420
|
lastReachableIndex = computed(() => {
|
|
390
421
|
const count = this.slides().length;
|
|
391
422
|
if (count === 0)
|
|
392
423
|
return 0;
|
|
393
424
|
return Math.max(0, count - Math.ceil(this._effectiveSlidesPerView()));
|
|
394
|
-
},
|
|
425
|
+
}, /* @ts-ignore */
|
|
426
|
+
...(ngDevMode ? [{ debugName: "lastReachableIndex" }] : /* istanbul ignore next */ []));
|
|
395
427
|
/** @internal `true` when the carousel is at slide 0 (drives prev directive `disabled`). */
|
|
396
|
-
isAtStart = computed(() => this.activeIndex() <= 0,
|
|
428
|
+
isAtStart = computed(() => this.activeIndex() <= 0, /* @ts-ignore */
|
|
429
|
+
...(ngDevMode ? [{ debugName: "isAtStart" }] : /* istanbul ignore next */ []));
|
|
397
430
|
/** @internal `true` when the carousel is at the last reachable slide (drives next directive `disabled`). */
|
|
398
|
-
isAtEnd = computed(() => this.activeIndex() >= this.lastReachableIndex(),
|
|
431
|
+
isAtEnd = computed(() => this.activeIndex() >= this.lastReachableIndex(), /* @ts-ignore */
|
|
432
|
+
...(ngDevMode ? [{ debugName: "isAtEnd" }] : /* istanbul ignore next */ []));
|
|
399
433
|
/** @internal Per-slide `flex-basis`. Read by each `CarouselSlideComponent` host style binding to size slides along the viewport's main axis. Reactive. */
|
|
400
434
|
slideBasis = computed(() => {
|
|
401
435
|
const perView = this._effectiveSlidesPerView();
|
|
402
436
|
const gapPx = GAP_PX[this.gap()];
|
|
403
437
|
// calc((100% - ((perView - 1) * gap-px)) / perView)
|
|
404
438
|
return `calc((100% - ${(perView - 1) * gapPx}px) / ${perView})`;
|
|
405
|
-
},
|
|
439
|
+
}, /* @ts-ignore */
|
|
440
|
+
...(ngDevMode ? [{ debugName: "slideBasis" }] : /* istanbul ignore next */ []));
|
|
406
441
|
// ── tv() resolution ────────────────────────────────────────────
|
|
407
442
|
_variantResult = computed(() => carouselVariants({
|
|
408
443
|
orientation: this.orientation(),
|
|
409
444
|
snapAlign: this.snapAlign(),
|
|
410
445
|
gap: this.gap(),
|
|
411
|
-
}),
|
|
446
|
+
}), /* @ts-ignore */
|
|
447
|
+
...(ngDevMode ? [{ debugName: "_variantResult" }] : /* istanbul ignore next */ []));
|
|
412
448
|
/** @internal Slot-class accessor used by child slides and indicators. */
|
|
413
|
-
_slotClasses = computed(() => this._variantResult(),
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
449
|
+
_slotClasses = computed(() => this._variantResult(), /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "_slotClasses" }] : /* istanbul ignore next */ []));
|
|
451
|
+
rootClasses = computed(() => this._variantResult().root(), /* @ts-ignore */
|
|
452
|
+
...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
|
|
453
|
+
viewportClasses = computed(() => this._variantResult().viewport(), /* @ts-ignore */
|
|
454
|
+
...(ngDevMode ? [{ debugName: "viewportClasses" }] : /* istanbul ignore next */ []));
|
|
455
|
+
pauseControlClasses = computed(() => this._variantResult().pauseControl(), /* @ts-ignore */
|
|
456
|
+
...(ngDevMode ? [{ debugName: "pauseControlClasses" }] : /* istanbul ignore next */ []));
|
|
417
457
|
// ── State signals ──────────────────────────────────────────────
|
|
418
458
|
/** @internal Last interaction source — written before any navigation triggers scroll, read by the settle handler. */
|
|
419
|
-
_lastInteractionSource = signal(null,
|
|
459
|
+
_lastInteractionSource = signal(null, /* @ts-ignore */
|
|
460
|
+
...(ngDevMode ? [{ debugName: "_lastInteractionSource" }] : /* istanbul ignore next */ []));
|
|
420
461
|
/** @internal Suppresses the scroll-end recompute during a loop-jump. */
|
|
421
|
-
_isLoopJumping = signal(false,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
462
|
+
_isLoopJumping = signal(false, /* @ts-ignore */
|
|
463
|
+
...(ngDevMode ? [{ debugName: "_isLoopJumping" }] : /* istanbul ignore next */ []));
|
|
464
|
+
_isHovered = signal(false, /* @ts-ignore */
|
|
465
|
+
...(ngDevMode ? [{ debugName: "_isHovered" }] : /* istanbul ignore next */ []));
|
|
466
|
+
_hasFocusInside = signal(false, /* @ts-ignore */
|
|
467
|
+
...(ngDevMode ? [{ debugName: "_hasFocusInside" }] : /* istanbul ignore next */ []));
|
|
468
|
+
_isTabVisible = signal(true, /* @ts-ignore */
|
|
469
|
+
...(ngDevMode ? [{ debugName: "_isTabVisible" }] : /* istanbul ignore next */ []));
|
|
470
|
+
_isDragging = signal(false, /* @ts-ignore */
|
|
471
|
+
...(ngDevMode ? [{ debugName: "_isDragging" }] : /* istanbul ignore next */ []));
|
|
472
|
+
_isManuallyPaused = signal(false, /* @ts-ignore */
|
|
473
|
+
...(ngDevMode ? [{ debugName: "_isManuallyPaused" }] : /* istanbul ignore next */ []));
|
|
474
|
+
_postInteractionPauseUntil = signal(null, /* @ts-ignore */
|
|
475
|
+
...(ngDevMode ? [{ debugName: "_postInteractionPauseUntil" }] : /* istanbul ignore next */ []));
|
|
428
476
|
/** @internal RTL sign factor applied to scroll-position math. `+1` LTR, `-1` RTL. */
|
|
429
|
-
_rtlSign = signal(1,
|
|
477
|
+
_rtlSign = signal(1, /* @ts-ignore */
|
|
478
|
+
...(ngDevMode ? [{ debugName: "_rtlSign" }] : /* istanbul ignore next */ []));
|
|
430
479
|
// ── Resolved pause-control labels ──────────────────────────────
|
|
431
480
|
_pauseControlAriaLabel = computed(() => {
|
|
432
481
|
const labels = this.resolvedLabels();
|
|
433
482
|
return this._isManuallyPaused() ? labels.resumeAutoplay : labels.pauseAutoplay;
|
|
434
|
-
},
|
|
483
|
+
}, /* @ts-ignore */
|
|
484
|
+
...(ngDevMode ? [{ debugName: "_pauseControlAriaLabel" }] : /* istanbul ignore next */ []));
|
|
435
485
|
/** @internal Public accessor for the template. */
|
|
436
486
|
_isManuallyPausedView = this._isManuallyPaused.asReadonly();
|
|
437
487
|
// ── Internal API used by child directives / indicators ─────────
|
|
@@ -512,13 +562,18 @@ class CarouselComponent {
|
|
|
512
562
|
prevPaused = paused;
|
|
513
563
|
});
|
|
514
564
|
// Slide-set changes: re-observe with IntersectionObserver, clamp activeIndex.
|
|
565
|
+
// Only `slides()` is a reactive trigger. The activeIndex read+write is wrapped
|
|
566
|
+
// in `untracked` so the clamp does not register `activeIndex` as a dependency —
|
|
567
|
+
// otherwise the `.set` would re-trigger this effect (read→write signal cycle).
|
|
515
568
|
effect(() => {
|
|
516
569
|
const slides = this.slides();
|
|
517
570
|
this._reobserveSlides(slides);
|
|
518
571
|
const count = slides.length;
|
|
519
|
-
|
|
520
|
-
this.activeIndex
|
|
521
|
-
|
|
572
|
+
untracked(() => {
|
|
573
|
+
if (count > 0 && this.activeIndex() > count - 1) {
|
|
574
|
+
this.activeIndex.set(count - 1);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
522
577
|
});
|
|
523
578
|
this._destroyRef.onDestroy(() => {
|
|
524
579
|
this._teardownViewport();
|
|
@@ -540,7 +595,8 @@ class CarouselComponent {
|
|
|
540
595
|
if (until !== null && Date.now() < until)
|
|
541
596
|
return true;
|
|
542
597
|
return false;
|
|
543
|
-
},
|
|
598
|
+
}, /* @ts-ignore */
|
|
599
|
+
...(ngDevMode ? [{ debugName: "_isPaused" }] : /* istanbul ignore next */ []));
|
|
544
600
|
_currentPauseReason() {
|
|
545
601
|
if (this._isManuallyPaused())
|
|
546
602
|
return 'manual';
|
|
@@ -1061,14 +1117,20 @@ class CarouselComponent {
|
|
|
1061
1117
|
case 'ArrowLeft':
|
|
1062
1118
|
if (horizontal) {
|
|
1063
1119
|
this._lastInteractionSource.set('keyboard');
|
|
1064
|
-
|
|
1120
|
+
if (rtl)
|
|
1121
|
+
this.next();
|
|
1122
|
+
else
|
|
1123
|
+
this.prev();
|
|
1065
1124
|
handled = true;
|
|
1066
1125
|
}
|
|
1067
1126
|
break;
|
|
1068
1127
|
case 'ArrowRight':
|
|
1069
1128
|
if (horizontal) {
|
|
1070
1129
|
this._lastInteractionSource.set('keyboard');
|
|
1071
|
-
|
|
1130
|
+
if (rtl)
|
|
1131
|
+
this.prev();
|
|
1132
|
+
else
|
|
1133
|
+
this.next();
|
|
1072
1134
|
handled = true;
|
|
1073
1135
|
}
|
|
1074
1136
|
break;
|
|
@@ -1114,8 +1176,8 @@ class CarouselComponent {
|
|
|
1114
1176
|
const next = !this._isManuallyPaused();
|
|
1115
1177
|
this._isManuallyPaused.set(next);
|
|
1116
1178
|
}
|
|
1117
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1118
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1179
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1180
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: CarouselComponent, isStandalone: true, selector: "tw-carousel", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, slidesPerView: { classPropertyName: "slidesPerView", publicName: "slidesPerView", isSignal: true, isRequired: false, transformFunction: null }, slidesToScroll: { classPropertyName: "slidesToScroll", publicName: "slidesToScroll", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, autoplayInterval: { classPropertyName: "autoplayInterval", publicName: "autoplayInterval", isSignal: true, isRequired: false, transformFunction: null }, pauseOnHover: { classPropertyName: "pauseOnHover", publicName: "pauseOnHover", isSignal: true, isRequired: false, transformFunction: null }, pauseOnFocusIn: { classPropertyName: "pauseOnFocusIn", publicName: "pauseOnFocusIn", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, snapAlign: { classPropertyName: "snapAlign", publicName: "snapAlign", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeIndex: "activeIndexChange", slideChange: "slideChange", autoplayPaused: "autoplayPaused", autoplayResumed: "autoplayResumed" }, host: { attributes: { "role": "region" }, listeners: { "pointerenter": "_onPointerEnter()", "pointerleave": "_onPointerLeave()", "focusin": "_onFocusIn()", "focusout": "_onFocusOut($event)" }, properties: { "attr.aria-roledescription": "\"carousel\"", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "class": "rootClasses()" } }, queries: [{ propertyName: "slides", predicate: CarouselSlideComponent, isSignal: true }], viewQueries: [{ propertyName: "_viewportRef", first: true, predicate: ["viewport"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1119
1181
|
<div
|
|
1120
1182
|
#viewport
|
|
1121
1183
|
data-tw-carousel-viewport
|
|
@@ -1160,7 +1222,7 @@ class CarouselComponent {
|
|
|
1160
1222
|
<ng-content />
|
|
1161
1223
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1162
1224
|
}
|
|
1163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselComponent, decorators: [{
|
|
1164
1226
|
type: Component,
|
|
1165
1227
|
args: [{
|
|
1166
1228
|
selector: 'tw-carousel',
|
|
@@ -1230,13 +1292,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
1230
1292
|
*/
|
|
1231
1293
|
class CarouselIndicatorsComponent {
|
|
1232
1294
|
/** Visual style. `'dots'` = small filled circles; `'lines'` = short horizontal/vertical bars; `'numbers'` = text 1, 2, 3 inside small pills. Defaults to `'dots'`. */
|
|
1233
|
-
variant = input('dots',
|
|
1295
|
+
variant = input('dots', /* @ts-ignore */
|
|
1296
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1234
1297
|
/** Color of the active indicator. Inactive indicators use neutral `fg-muted` tokens. Defaults to `'primary'`. */
|
|
1235
|
-
color = input('primary',
|
|
1298
|
+
color = input('primary', /* @ts-ignore */
|
|
1299
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1236
1300
|
/** Indicator size (diameter/length and gap between indicators). Defaults to `'md'`. */
|
|
1237
|
-
size = input('md',
|
|
1301
|
+
size = input('md', /* @ts-ignore */
|
|
1302
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1238
1303
|
/** When `'overlay'`, the indicators float absolutely-positioned over the carousel with a `bg-overlay-control` translucent capsule backdrop for contrast. When `'below'`, they sit below the carousel as a normal block. Defaults to `'below'`. */
|
|
1239
|
-
position = input('below',
|
|
1304
|
+
position = input('below', /* @ts-ignore */
|
|
1305
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1240
1306
|
/** @internal Direct parent carousel. */
|
|
1241
1307
|
carousel = inject(CarouselComponent);
|
|
1242
1308
|
_variantResult = computed(() => carouselVariants({
|
|
@@ -1246,8 +1312,10 @@ class CarouselIndicatorsComponent {
|
|
|
1246
1312
|
position: this.position(),
|
|
1247
1313
|
gap: this.carousel.gap(),
|
|
1248
1314
|
snapAlign: this.carousel.snapAlign(),
|
|
1249
|
-
}),
|
|
1250
|
-
|
|
1315
|
+
}), /* @ts-ignore */
|
|
1316
|
+
...(ngDevMode ? [{ debugName: "_variantResult" }] : /* istanbul ignore next */ []));
|
|
1317
|
+
rootClasses = computed(() => this._variantResult().indicators(), /* @ts-ignore */
|
|
1318
|
+
...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
|
|
1251
1319
|
/**
|
|
1252
1320
|
* @internal Sequence of page indices to render. Returns `[]` when the
|
|
1253
1321
|
* parent carousel's `slidesPerView` is not `1` — a single dot can never
|
|
@@ -1265,7 +1333,8 @@ class CarouselIndicatorsComponent {
|
|
|
1265
1333
|
for (let i = 0; i < count; i++)
|
|
1266
1334
|
out[i] = i;
|
|
1267
1335
|
return out;
|
|
1268
|
-
},
|
|
1336
|
+
}, /* @ts-ignore */
|
|
1337
|
+
...(ngDevMode ? [{ debugName: "_pages" }] : /* istanbul ignore next */ []));
|
|
1269
1338
|
constructor() {
|
|
1270
1339
|
if (isDevMode()) {
|
|
1271
1340
|
let warned = false;
|
|
@@ -1296,8 +1365,8 @@ class CarouselIndicatorsComponent {
|
|
|
1296
1365
|
this.carousel._setLastInteractionSource('indicator');
|
|
1297
1366
|
this.carousel.scrollTo(targetIndex);
|
|
1298
1367
|
}
|
|
1299
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1300
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1368
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselIndicatorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: CarouselIndicatorsComponent, isStandalone: true, selector: "tw-carousel-indicators", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "rootClasses()" } }, ngImport: i0, template: `
|
|
1301
1370
|
@for (page of _pages(); track page) {
|
|
1302
1371
|
<button
|
|
1303
1372
|
type="button"
|
|
@@ -1313,7 +1382,7 @@ class CarouselIndicatorsComponent {
|
|
|
1313
1382
|
}
|
|
1314
1383
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1315
1384
|
}
|
|
1316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselIndicatorsComponent, decorators: [{
|
|
1317
1386
|
type: Component,
|
|
1318
1387
|
args: [{
|
|
1319
1388
|
selector: 'tw-carousel-indicators',
|
|
@@ -1354,7 +1423,8 @@ class CarouselPrevDirective {
|
|
|
1354
1423
|
_hasLabelledBy = this._hostEl.hasAttribute('aria-labelledby');
|
|
1355
1424
|
_isButton = this._hostEl.tagName === 'BUTTON';
|
|
1356
1425
|
/** @internal True when prev is unavailable (at start and !loop). */
|
|
1357
|
-
_isDisabled = computed(() => !this.carousel.loop() && this.carousel.isAtStart(),
|
|
1426
|
+
_isDisabled = computed(() => !this.carousel.loop() && this.carousel.isAtStart(), /* @ts-ignore */
|
|
1427
|
+
...(ngDevMode ? [{ debugName: "_isDisabled" }] : /* istanbul ignore next */ []));
|
|
1358
1428
|
_ariaLabel() {
|
|
1359
1429
|
// Consumer-provided aria-label wins outright. Consumer-provided
|
|
1360
1430
|
// aria-labelledby suppresses our binding so the two labels don't compete.
|
|
@@ -1378,10 +1448,10 @@ class CarouselPrevDirective {
|
|
|
1378
1448
|
this.carousel._setLastInteractionSource('button');
|
|
1379
1449
|
this.carousel.prev();
|
|
1380
1450
|
}
|
|
1381
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1382
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselPrevDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1452
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: CarouselPrevDirective, isStandalone: true, selector: "[twCarouselPrev]", host: { listeners: { "click": "_onClick($event)" }, properties: { "attr.aria-label": "_ariaLabel()", "attr.disabled": "_isButtonDisabled()", "attr.aria-disabled": "_isDisabled() ? \"true\" : null", "attr.tabindex": "_isTabindex()" } }, ngImport: i0 });
|
|
1383
1453
|
}
|
|
1384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselPrevDirective, decorators: [{
|
|
1385
1455
|
type: Directive,
|
|
1386
1456
|
args: [{
|
|
1387
1457
|
selector: '[twCarouselPrev]',
|
|
@@ -1407,7 +1477,8 @@ class CarouselNextDirective {
|
|
|
1407
1477
|
_consumerLabel = this._hostEl.getAttribute('aria-label');
|
|
1408
1478
|
_hasLabelledBy = this._hostEl.hasAttribute('aria-labelledby');
|
|
1409
1479
|
_isButton = this._hostEl.tagName === 'BUTTON';
|
|
1410
|
-
_isDisabled = computed(() => !this.carousel.loop() && this.carousel.isAtEnd(),
|
|
1480
|
+
_isDisabled = computed(() => !this.carousel.loop() && this.carousel.isAtEnd(), /* @ts-ignore */
|
|
1481
|
+
...(ngDevMode ? [{ debugName: "_isDisabled" }] : /* istanbul ignore next */ []));
|
|
1411
1482
|
_ariaLabel() {
|
|
1412
1483
|
if (this._consumerLabel !== null)
|
|
1413
1484
|
return this._consumerLabel;
|
|
@@ -1429,10 +1500,10 @@ class CarouselNextDirective {
|
|
|
1429
1500
|
this.carousel._setLastInteractionSource('button');
|
|
1430
1501
|
this.carousel.next();
|
|
1431
1502
|
}
|
|
1432
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1433
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1503
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselNextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1504
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: CarouselNextDirective, isStandalone: true, selector: "[twCarouselNext]", host: { listeners: { "click": "_onClick($event)" }, properties: { "attr.aria-label": "_ariaLabel()", "attr.disabled": "_isButtonDisabled()", "attr.aria-disabled": "_isDisabled() ? \"true\" : null", "attr.tabindex": "_isTabindex()" } }, ngImport: i0 });
|
|
1434
1505
|
}
|
|
1435
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CarouselNextDirective, decorators: [{
|
|
1436
1507
|
type: Directive,
|
|
1437
1508
|
args: [{
|
|
1438
1509
|
selector: '[twCarouselNext]',
|