UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

88 lines (87 loc) 2.57 kB
import { EventEmitter, VNode } from "../../stencil-public-runtime"; import { FormComponent } from "../../utils/form"; import { InteractiveComponent } from "../../utils/interactive"; import { LabelableComponent } from "../../utils/label"; import { LoadableComponent } from "../../utils/loadable"; import { Scale, Width } from "../interfaces"; /** * @slot - A slot for adding `calcite-option`s. */ export declare class Select implements LabelableComponent, FormComponent, InteractiveComponent, LoadableComponent { /** * 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; /** * When `true`, the component must have a value in order for the form to submit. * * @internal */ required: boolean; /** * Specifies the size of the component. */ scale: Scale; /** The component's `selectedOption` value. */ value: string; valueHandler(value: string): void; /** * The component's selected option `HTMLElement`. * * @readonly */ selectedOption: HTMLCalciteOptionElement; selectedOptionHandler(selectedOption: HTMLCalciteOptionElement): void; /** * Specifies the width of the component. */ width: Width; labelEl: HTMLCalciteLabelElement; formEl: HTMLFormElement; defaultValue: Select["value"]; el: HTMLCalciteSelectElement; private componentToNativeEl; private mutationObserver; private selectEl; connectedCallback(): void; disconnectedCallback(): void; componentWillLoad(): void; componentDidLoad(): void; componentDidRender(): void; /** Sets focus on the component. */ setFocus(): Promise<void>; /** * Fires when the `selectedOption` changes. */ calciteSelectChange: EventEmitter<void>; private handleInternalSelectChange; protected handleOptionOrGroupChange(event: CustomEvent): void; onLabelClick(): void; private updateNativeElement; private populateInternalSelect; private clearInternalSelect; private storeSelectRef; private selectFromNativeOption; private toNativeElement; private deselectAllExcept; private emitChangeEvent; renderChevron(): VNode; render(): VNode; }