@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
66 lines (65 loc) • 2.45 kB
TypeScript
import { EventEmitter, VNode } from "../../stencil-public-runtime";
import { ItemKeyboardEvent } from "../dropdown/interfaces";
import { RequestedItem } from "../dropdown-group/interfaces";
import { FlipContext, Scale } from "../interfaces";
import { LoadableComponent } from "../../utils/loadable";
/**
* @slot - A slot for adding text.
*/
export declare class DropdownItem implements LoadableComponent {
el: HTMLCalciteDropdownItemElement;
/** When `true`, the component is selected. */
selected: boolean;
/** Displays the `iconStart` and/or `iconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */
iconFlipRtl: FlipContext;
/** Specifies an icon to display at the start of the component. */
iconStart: string;
/** Specifies an icon to display at the end of the component. */
iconEnd: string;
/**
* Specifies the URL of the linked resource, which can be set as an absolute or relative path.
*
* Determines if the component will render as an anchor.
*/
href: string;
/** Accessible name for the component. */
label: string;
/** Specifies the relationship to the linked document defined in `href`. */
rel: string;
/** Specifies the frame or window to open the linked document. */
target: string;
/** Fires when the component is selected. */
calciteDropdownItemSelect: EventEmitter<void>;
/**
* @internal
*/
calciteInternalDropdownItemSelect: EventEmitter<RequestedItem>;
/** @internal */
calciteInternalDropdownItemKeyEvent: EventEmitter<ItemKeyboardEvent>;
/** @internal */
calciteInternalDropdownCloseRequest: EventEmitter<void>;
/** Sets focus on the component. */
setFocus(): Promise<void>;
componentWillLoad(): void;
componentDidLoad(): void;
connectedCallback(): void;
render(): VNode;
onClick(): void;
keyDownHandler(event: KeyboardEvent): void;
updateActiveItemOnChange(event: CustomEvent): void;
/** id of containing group */
private parentDropdownGroupEl;
/** requested group */
private requestedDropdownGroup;
/** requested item */
private requestedDropdownItem;
/** what selection mode is the parent dropdown group in */
private selectionMode;
/** if href is requested, track the rendered child link*/
private childLink;
/** Specifies the scale of dropdown-item controlled by the parent, defaults to m */
scale: Scale;
private initialize;
private determineActiveItem;
private emitRequestedItem;
}