@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
88 lines (87 loc) • 3.55 kB
TypeScript
/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { FlipPlacement, LogicalPlacement, OverlayPositioning } from "../../utils/floating-ui.js";
import type { Appearance, Scale } from "../interfaces.js";
/**
* @cssproperty [--calcite-action-menu-items-space] - Specifies the space between actions in the menu.
* @slot - A slot for adding `calcite-action`s.
* @slot [trigger] - A slot for adding a `calcite-action` to trigger opening the menu.
* @slot [tooltip] - A slot for adding a tooltip for the menu.
*/
export abstract class ActionMenu extends LitElement {
/**
* Specifies the appearance of the component.
*
* @default "solid"
*/
accessor appearance: Extract<"solid" | "transparent", Appearance>;
/**
* When `true`, expands the component and its contents.
*
* @default false
*/
accessor expanded: boolean;
/** Specifies the component's fallback `placement` for slotted content when it's initial or specified `placement` has insufficient space available. */
accessor flipPlacements: FlipPlacement[];
/**
* Specifies an accessible label for the component.
*
* @required
*/
accessor label: string;
/**
* When `true`, the component is open.
*
* @default false
*/
accessor open: boolean;
/**
* Specifies the type of positioning to use for overlaid content, where:
*
* `"absolute"` works for most cases - positioning the component inside of overflowing parent containers, which affects the container's layout, and
*
* `"fixed"` is used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
*
* @default "absolute"
*/
accessor overlayPositioning: OverlayPositioning;
/**
* Determines where the component will be positioned relative to the `referenceElement`.
*
* @default "auto"
*/
accessor placement: LogicalPlacement;
/**
* Specifies the size of the component's trigger `calcite-action`.
*
* @default "m"
*/
accessor scale: Scale;
/**
* When `true` and the component is `open`, disables top layer placement.
*
* Only set this if you need complex z-index control or if top layer placement causes conflicts with third-party components.
*
* @default false
* @mdn [Top Layer](https://developer.mozilla.org/en-US/docs/Glossary/Top_layer)
*/
accessor topLayerDisabled: boolean;
/**
* 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 component's content area is collapsed. */
readonly calciteActionMenuCollapse: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the component's content area is expanded. */
readonly calciteActionMenuExpand: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the `open` property is toggled. */
readonly calciteActionMenuOpen: import("@arcgis/lumina").TargetedEvent<this, void>;
readonly "@eventTypes": {
calciteActionMenuCollapse: ActionMenu["calciteActionMenuCollapse"]["detail"];
calciteActionMenuExpand: ActionMenu["calciteActionMenuExpand"]["detail"];
calciteActionMenuOpen: ActionMenu["calciteActionMenuOpen"]["detail"];
};
}