UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

103 lines (102 loc) 5.78 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { CarouselItem } from "../calcite-carousel-item/customElement.js"; import type { ArrowType, AutoplayType } from "./interfaces.js"; /** * @cssproperty [--calcite-carousel-pagination-background-color] - Specifies the background color of the component's pagination items, navigation arrows, and autoplay controls. * @cssproperty [--calcite-carousel-pagination-background-color-hover] - Specifies the background color of the component's pagination items, navigation arrows, and autoplay controls when hovered. * @cssproperty [--calcite-carousel-pagination-background-color-press] - Specifies the background color of the component's pagination items, navigation arrows, and autoplay controls when pressed. * @cssproperty [--calcite-carousel-pagination-background-color-selected] - Specifies the background color of the component's pagination items, navigation arrows, and autoplay controls when selected. * @cssproperty [--calcite-carousel-pagination-icon-color] - Specifies the icon color of the component's pagination items and autoplay controls. * @cssproperty [--calcite-carousel-pagination-icon-color-hover] - Specifies the icon color of the component's pagination items when hovered or pressed. * @cssproperty [--calcite-carousel-pagination-icon-color-selected] - Specifies the icon color of the component's pagination items when selected. * @cssproperty [--calcite-carousel-control-icon-color] - Specifies the icon color of the component's navigation arrow controls. * @cssproperty [--calcite-carousel-control-icon-color-hover] - Specifies the icon color of the component's navigation arrow controls when hovered or pressed. * @cssproperty [--calcite-carousel-autoplay-progress-background-color] - Specifies the background color of the component's autoplay progress when `autoplay` is specified. * @cssproperty [--calcite-carousel-autoplay-progress-fill-color] - Specifies the fill color of the component's autoplay progress when `autoplay` is specified. * @slot - A slot for adding `calcite-carousel-item`s. */ export abstract class Carousel extends LitElement { /** * Specifies how and if the "previous" and "next" arrows are displayed. * * @default "inline" */ accessor arrowType: ArrowType; /** * When `true`, the carousel will autoplay and controls will be displayed. When "paused" at time of initialization, the carousel will not autoplay, but controls will be displayed. * * @default false */ accessor autoplay: AutoplayType; /** * When `autoplay` is `true`, specifies in milliseconds the length of time to display each Carousel Item. * * @default 6000 */ accessor autoplayDuration: number; /** * Specifies if the component's controls are positioned absolutely on top of slotted Carousel Items. * * @default false */ accessor controlOverlay: boolean; /** * When `true`, interaction is prevented and the component is displayed with lower opacity. * * @default false */ accessor disabled: boolean; /** * Specifies an accessible label for the component. * * @required */ accessor label: string; /** Overrides individual strings used by the component. */ accessor messageOverrides: { previous?: string; next?: string; play?: string; pause?: string; carousel?: string; carouselItemProgress?: string; paginationStatus?: string; }; /** * When `true`, the component's pagination controls are hidden. * * @default false */ accessor paginationDisabled: boolean; /** The component's selected `calcite-carousel-item`. */ get selectedItem(): CarouselItem; /** Plays the carousel. If `autoplay` is not enabled (initialized either to `true` or `"paused"`), these methods will have no effect. */ play(): Promise<void>; /** * Sets focus on the component. * * @param options - When specified an optional object customizes the component's focusing process. When `preventScroll` is `true`, scrolling will not occur on the component. * @mdn [focus(options)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options) */ setFocus(options?: FocusOptions): Promise<void>; /** Stops the carousel. If `autoplay` is not enabled (initialized either to `true` or `"paused"`), these methods will have no effect. */ stop(): Promise<void>; /** Fires when the selected `calcite-carousel-item` changes. */ readonly calciteCarouselChange: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the carousel autoplay state pauses due to a user hovering over the component or focusing on the component or slotted content */ readonly calciteCarouselPause: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the carousel autoplay is invoked by the user. */ readonly calciteCarouselPlay: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the carousel autoplay state resumes due to a user no longer hovering over the component or focusing on the component or slotted content */ readonly calciteCarouselResume: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the carousel autoplay state is stopped by a user. */ readonly calciteCarouselStop: import("@arcgis/lumina").TargetedEvent<this, void>; readonly "@eventTypes": { calciteCarouselChange: Carousel["calciteCarouselChange"]["detail"]; calciteCarouselPause: Carousel["calciteCarouselPause"]["detail"]; calciteCarouselPlay: Carousel["calciteCarouselPlay"]["detail"]; calciteCarouselResume: Carousel["calciteCarouselResume"]["detail"]; calciteCarouselStop: Carousel["calciteCarouselStop"]["detail"]; }; }