UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

61 lines (60 loc) 2.63 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { Scale } from "../interfaces.js"; /** * @cssproperty [--calcite-switch-background-color] - Specifies the component's background color. * @cssproperty [--calcite-switch-background-color-hover] - Specifies the component's background color when hovered or pressed. * @cssproperty [--calcite-switch-border-color] - [Deprecated] No longer necessary. Specifies the component's border color. * @cssproperty [--calcite-switch-corner-radius] - Specifies the component's corner radius. * @cssproperty [--calcite-switch-handle-background-color] - Specifies the handle's background color. * @cssproperty [--calcite-switch-handle-border-color] - [Deprecated] No longer necessary. Specifies the handle's border color. * @cssproperty [--calcite-switch-handle-shadow] - [Deprecated] No longer necessary. Specifies the handle's shadow. */ export abstract class Switch extends LitElement { /** * When `true`, the component is checked. * * @default false */ accessor checked: boolean; /** * When `true`, interaction is prevented and the component is displayed with lower opacity. * * @default false */ accessor disabled: boolean; /** * Specifies the `id` of the component's associated form. * * When not set, the component is associated with its ancestor form element, if one exists. */ accessor form: string; /** Specifies an accessible label for the component. */ accessor label: string; /** Specifies the component's end label text. */ accessor labelTextEnd: string; /** Specifies the component's start label text. */ accessor labelTextStart: string; /** Specifies the name of the component. Required to pass the component's `value` on form submission. */ accessor name: string; /** * Specifies the component's size. * * @default "m" */ accessor scale: Scale; /** The component's value. */ accessor value: any; /** * 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>; /** Fires when the `checked` value has changed. */ readonly calciteSwitchChange: import("@arcgis/lumina").TargetedEvent<this, void>; readonly "@eventTypes": { calciteSwitchChange: Switch["calciteSwitchChange"]["detail"]; }; }