@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
112 lines (110 loc) • 4.54 kB
TypeScript
/// <reference types="../../index.d.ts" />
import { PublicLitElement as LitElement, JsxNode, TargetedEvent } from '@arcgis/lumina';
import { FlipPlacement, MenuPlacement, OverlayPositioning } from '../../utils/floating-ui';
import { InteractiveComponent } from '../../utils/interactive';
import { DropdownIconType } from '../calcite-button/interfaces';
import { Appearance, FlipContext, Kind, Scale, Width } from '../interfaces';
import { IconNameOrString } from '../calcite-icon/interfaces';
/** @slot - A slot for adding `calcite-dropdown` content. */
export declare class SplitButton extends LitElement {
/**
* Specifies the appearance style of the component.
*
* @default "solid"
*/
appearance: Extract<"outline" | "outline-fill" | "solid" | "transparent", Appearance>;
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
*
* @default false
*/
disabled: boolean;
/**
* Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value:
* Without a value, the browser will suggest a filename/extension.
*
* @see [Global download attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).
* @default false
*/
download: string | boolean;
/**
* Specifies the icon used for the dropdown menu.
*
* @default "chevron"
*/
dropdownIconType: DropdownIconType;
/** Accessible name for the dropdown menu. */
dropdownLabel: string;
/** Specifies the component's fallback slotted content `placement` when it's initial or specified `placement` has insufficient space available. */
flipPlacements: FlipPlacement[];
/** Specifies the URL of the linked resource, which can be set as an absolute or relative path. */
href: string;
/**
* Specifies the kind of the component, which will apply to border and background, if applicable.
*
* @default "brand"
*/
kind: Extract<"brand" | "danger" | "inverse" | "neutral", Kind>;
/**
* When `true`, a busy indicator is displayed on the primary button.
*
* @default false
*/
loading: boolean;
/**
* Determines the type of positioning to use for the overlaid content.
*
* Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
*
* `"fixed"` should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
*
* @default "absolute"
*/
overlayPositioning: OverlayPositioning;
/**
* Defines the relationship between the `href` value and the current document.
*
* @mdn [rel](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)
*/
rel: string;
/**
* Determines where the component will be positioned relative to the container element.
*
* @default "bottom-end"
*/
placement: MenuPlacement;
/** Specifies an icon to display at the end of the primary button. */
primaryIconEnd: IconNameOrString;
/** Displays the `primaryIconStart` and/or `primaryIconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */
primaryIconFlipRtl: FlipContext;
/** Specifies an icon to display at the start of the primary button. */
primaryIconStart: IconNameOrString;
/** Accessible name for the primary button. */
primaryLabel: string;
/** Text displayed in the primary button. */
primaryText: string;
/**
* Specifies the size of the component.
*
* @default "m"
*/
scale: Scale;
/**
* 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)
*/
target: string;
/**
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*
* @default "auto"
*/
width: Extract<Width, "auto" | "half" | "full">;
/** Sets focus on the component's first focusable element. */
setFocus(): Promise<void>;
/** Fires when the primary button is clicked. */
readonly calciteSplitButtonPrimaryClick: TargetedEvent<this, void>;
/** Fires when the dropdown menu is clicked. */
readonly calciteSplitButtonSecondaryClick: TargetedEvent<this, void>;
}