@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
55 lines (54 loc) • 1.88 kB
TypeScript
import { EventEmitter, VNode } from "../../stencil-public-runtime";
import { CheckableFormComponent } from "../../utils/form";
import { InteractiveComponent } from "../../utils/interactive";
import { LabelableComponent } from "../../utils/label";
import { LoadableComponent } from "../../utils/loadable";
import { Scale } from "../interfaces";
export declare class Switch implements LabelableComponent, CheckableFormComponent, InteractiveComponent, LoadableComponent {
el: HTMLCalciteSwitchElement;
/** When `true`, interaction is prevented and the component is displayed with lower opacity. */
disabled: boolean;
/**
* The ID of the form that will be associated with the component.
*
* When not set, the component will be associated with its ancestor form element, if any.
*/
form: string;
/** Accessible name for the component. */
label: string;
/**
* Specifies the name of the component.
*
* Required to pass the component's `value` on form submission.
*/
name: string;
/** Specifies the size of the component. */
scale: Scale;
/** When `true`, the component is checked. */
checked: boolean;
/** The component's value. */
value: any;
labelEl: HTMLCalciteLabelElement;
switchEl: HTMLDivElement;
formEl: HTMLFormElement;
defaultValue: Switch["checked"];
defaultChecked: boolean;
/** Sets focus on the component. */
setFocus(): Promise<void>;
syncHiddenFormInput(input: HTMLInputElement): void;
keyDownHandler: (event: KeyboardEvent) => void;
onLabelClick(): void;
private toggle;
private clickHandler;
private setSwitchEl;
/**
* Fires when the `checked` value has changed.
*/
calciteSwitchChange: EventEmitter<void>;
connectedCallback(): void;
componentWillLoad(): void;
componentDidLoad(): void;
disconnectedCallback(): void;
componentDidRender(): void;
render(): VNode;
}