@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
78 lines (77 loc) • 3.14 kB
TypeScript
/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { FlipContext } from "../interfaces.js";
import type { IconName } from "../calcite-icon/interfaces.js";
/**
* @cssproperty [--calcite-menu-item-accent-color] - When `active`, specifies the component's border color.
* @cssproperty [--calcite-menu-background-color] - Specifies the component's background color.
* @cssproperty [--calcite-menu-item-sub-menu-border-color] - Specifies the submenu's border color.
* @cssproperty [--calcite-menu-item-sub-menu-corner-radius] - Specifies the submenu's border radius.
* @cssproperty [--calcite-menu-text-color] - Specifies the component's text color.
* @slot [submenu-item] - A slot for adding `calcite-menu-item`s in a submenu.
*/
export abstract class MenuItem extends LitElement {
/**
* When `true`, the component is highlighted.
*
* @default false
*/
accessor active: boolean;
/**
* When `true`, the component displays a breadcrumb trail for use as a navigational aid.
*
* @default false
*/
accessor breadcrumb: boolean;
/** Specifies the URL destination of the component, which can be set as an absolute or relative path. */
accessor href: string;
/** Specifies an icon to display at the end of the component. */
accessor iconEnd: IconName;
/** Displays the `iconStart` and/or `iconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */
accessor iconFlipRtl: FlipContext;
/** Specifies an icon to display at the start of the component. */
accessor iconStart: IconName;
/**
* Specifies an accessible label for the component.
*
* @required
*/
accessor label: string;
/** Overrides individual strings used by the component. */
accessor messageOverrides: {
submenu?: string;
open?: string;
};
/**
* When `true`, the component will display any slotted `calcite-menu-item` in an open overflow menu.
*
* @default false
*/
accessor open: boolean;
/**
* Defines the relationship between the `href` value and the current document.
*
* @mdn [rel](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)
*/
accessor rel: string;
/**
* Specifies where to open the linked document defined in the `href` property.
*
* @mdn [target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target)
*/
accessor target: string;
/** Specifies the text to display. */
accessor text: string;
/**
* 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>;
/** Emits when the component is selected. */
readonly calciteMenuItemSelect: import("@arcgis/lumina").TargetedEvent<this, void>;
readonly "@eventTypes": {
calciteMenuItemSelect: MenuItem["calciteMenuItemSelect"]["detail"];
};
}