@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
98 lines (97 loc) • 4.31 kB
TypeScript
/// <reference path="../../index.d.ts" />
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
import type { Layout, Position, Scale, SelectionAppearance } from "../interfaces.js";
import type { OverlayPositioning } from "../../utils/floating-ui.js";
/**
* @cssproperty [--calcite-action-bar-background-color] - Specifies the component's background color.
* @cssproperty [--calcite-action-bar-corner-radius] - Specifies the component's border radius when `floating` is `true`.
* @cssproperty [--calcite-action-bar-expanded-max-width] - When `layout` is `"vertical"`, specifies the component's maximum width.
* @cssproperty [--calcite-action-bar-items-space] - Specifies the space between slotted components in the component.
* @cssproperty [--calcite-action-bar-shadow] - Specifies the component's shadow when `floating` is `true`.
* @slot - A slot for adding `calcite-action`s that will appear at the top of the component.
* @slot [actions-end] - A slot for adding `calcite-action`s that will appear at the end of the component, prior to the collapse/expand button.
* @slot [expand-tooltip] - A slot to set the `calcite-tooltip` for the expand toggle.
*/
export abstract class ActionBar extends LitElement {
/** Specifies an accessible name for the last `calcite-action-group`. */
accessor actionsEndGroupLabel: string;
/**
* When `true`, the expand-toggling behavior is disabled.
*
* @default false
*/
accessor expandDisabled: boolean;
/**
* When `true`, expands the component and its contents.
*
* @default false
*/
accessor expanded: boolean;
/**
* When `true`, the component is in a floating state.
*
* @default false
*/
accessor floating: boolean;
/**
* Specifies the layout direction of the actions.
*
* @default "vertical"
*/
accessor layout: Extract<"horizontal" | "vertical" | "grid", Layout>;
/** Overrides individual strings used by the component. */
accessor messageOverrides: {
expand?: string;
collapse?: string;
expandLabel?: string;
collapseLabel?: string;
};
/**
* When `true`, disables automatically overflowing `calcite-action`s that won't fit into menus.
*
* @default false
*/
accessor overflowActionsDisabled: 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;
/** Specifies the position of the component depending on the element's `dir` property. */
accessor position: Extract<"start" | "end", Position>;
/**
* Specifies the size of the expand `calcite-action`.
*
* @default "m"
*/
accessor scale: Scale;
/**
* Specifies the selection appearance of the component
*
* @default "neutral"
*/
accessor selectionAppearance: Extract<"neutral" | "highlight", SelectionAppearance>;
/**
* Sets focus on the component's first focusable element.
*
* @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 calciteActionBarCollapse: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the component's content area is expanded. */
readonly calciteActionBarExpand: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the `expanded` property is toggled. */
readonly calciteActionBarToggle: import("@arcgis/lumina").TargetedEvent<this, void>;
readonly "@eventTypes": {
calciteActionBarCollapse: ActionBar["calciteActionBarCollapse"]["detail"];
calciteActionBarExpand: ActionBar["calciteActionBarExpand"]["detail"];
calciteActionBarToggle: ActionBar["calciteActionBarToggle"]["detail"];
};
}