@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
146 lines (145 loc) • 6.91 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 { DropdownIconType } from "../calcite-button/interfaces.js";
import type { Appearance, FlipContext, Kind, Scale, Width } from "../interfaces.js";
import type { IconName } from "../calcite-icon/interfaces.js";
/**
* @cssproperty [--calcite-split-button-background-color] - Specifies the component's background color.
* @cssproperty [--calcite-split-button-background-color-hover] - Specifies the component's background color when hovered.
* @cssproperty [--calcite-split-button-background-color-focus] - Specifies the component's background color when focused.
* @cssproperty [--calcite-split-button-background-color-press] - Specifies the component's background color when active.
* @cssproperty [--calcite-split-button-border-color] - Specifies the component's border color.
* @cssproperty [--calcite-split-button-corner-radius] - Specifies the component's corner radius.
* @cssproperty [--calcite-split-button-icon-color] - Specifies the component's `iconStart` and `iconEnd` color.
* @cssproperty [--calcite-split-button-loader-color] - Specifies the component's loader color.
* @cssproperty [--calcite-split-button-text-color] - Specifies the component's text color.
* @cssproperty [--calcite-split-button-shadow] - Specifies the component's shadow.
* @cssproperty [--calcite-split-button-divider-border-color] - Specifies the component's divider border color.
* @cssproperty [--calcite-split-button-divider-color] - Specifies the component's divider color.
* @cssproperty [--calcite-split-button-dropdown-width] - Specifies the width of the component's dropdown.
* @cssproperty
* [--calcite-split-button-dropdown-background-color] - Specifies the component's dropdown background color.
* *
* @slot - A slot for adding `calcite-dropdown` content.
*/
export abstract class SplitButton extends LitElement {
/**
* Specifies the appearance style of the component.
*
* @default "solid"
*/
accessor appearance: Extract<"outline" | "outline-fill" | "solid" | "transparent", Appearance>;
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
*
* @default false
*/
accessor 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.
*
* @default false
* @see [Global download attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).
*/
accessor download: string | boolean;
/**
* Specifies the icon used for the dropdown menu.
*
* @default "chevron"
*/
accessor dropdownIconType: DropdownIconType;
/** Accessible name for the dropdown menu. */
accessor dropdownLabel: string;
/** Specifies the component's fallback `placement` for slotted content when it's initial or specified `placement` has insufficient space available. */
accessor flipPlacements: FlipPlacement[];
/** Specifies the URL of the linked resource, which can be set as an absolute or relative path. */
accessor href: string;
/**
* Specifies the kind of the component, which will apply to border and background, if applicable.
*
* @default "brand"
*/
accessor kind: Extract<"brand" | "danger" | "inverse" | "neutral", Kind>;
/**
* When `true`, a busy indicator is displayed on the primary button.
*
* @default false
*/
accessor loading: 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 container element.
*
* @default "bottom-end"
*/
accessor placement: LogicalPlacement;
/** Specifies an icon to display at the end of the primary button. */
accessor primaryIconEnd: IconName;
/** Displays the `primaryIconStart` and/or `primaryIconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */
accessor primaryIconFlipRtl: FlipContext;
/** Specifies an icon to display at the start of the primary button. */
accessor primaryIconStart: IconName;
/** Specifies an accessible name for the primary button. */
accessor primaryLabel: string;
/** Specifies the text displayed in the primary button. */
accessor primaryText: string;
/**
* 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 the component's size.
*
* @default "m"
*/
accessor 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)
*/
accessor target: string;
/**
* 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;
/**
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*
* @default "auto"
*/
accessor width: Extract<Width, "auto" | "half" | "full">;
/**
* 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 primary button is clicked. */
readonly calciteSplitButtonPrimaryClick: import("@arcgis/lumina").TargetedEvent<this, void>;
/** Fires when the dropdown menu is clicked. */
readonly calciteSplitButtonSecondaryClick: import("@arcgis/lumina").TargetedEvent<this, void>;
readonly "@eventTypes": {
calciteSplitButtonPrimaryClick: SplitButton["calciteSplitButtonPrimaryClick"]["detail"];
calciteSplitButtonSecondaryClick: SplitButton["calciteSplitButtonSecondaryClick"]["detail"];
};
}