UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

95 lines (94 loc) 4.18 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { LogicalPlacement, OverlayPositioning, ReferenceElement } from "../../utils/floating-ui.js"; /** * @cssproperty [--calcite-tooltip-background-color] - Specifies the component's background color. * @cssproperty [--calcite-tooltip-border-color] - Specifies the component's border color. * @cssproperty [--calcite-tooltip-corner-radius] - Specifies the component's corner radius. * @cssproperty [--calcite-tooltip-max-size-x] - Specifies the component's maximum width. * @cssproperty [--calcite-tooltip-text-color] - Specifies the component's text color. * @slot - A slot for adding text. */ export abstract class Tooltip extends LitElement { /** * Closes the component when the `referenceElement` is clicked. * * @default false */ accessor closeOnClick: boolean; /** * Specifies an accessible label for the component. * * @deprecated in v1.5.0, removal target v6.0.0 - No longer necessary. Overrides the context of the component's text description, which could confuse assistive technology users. */ accessor label: string; /** Specifies the distance to position the component away from the `referenceElement`. */ accessor offsetDistance: number; /** * Specifies the distance to position the component along the `referenceElement`. * * @default 0 */ accessor offsetSkidding: number; /** * 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; /** * The `referenceElement` is used to position the component according to its `placement` value. * * Setting the value to an `HTMLElement` is preferred so the component does not need to query the DOM. * * However, a string `id` of the reference element can also be used. * * The component should not be placed within its own `referenceElement` to avoid unintended behavior. */ accessor referenceElement: ReferenceElement | 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; /** * Updates the position of the component. * * @param delayed */ reposition(delayed?: boolean): Promise<void>; /** Fires when the component is requested to be closed and before the closing transition begins. */ readonly calciteTooltipBeforeClose: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the component is added to the DOM but not rendered, and before the opening transition begins. */ readonly calciteTooltipBeforeOpen: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the component is closed and animation is complete. */ readonly calciteTooltipClose: import("@arcgis/lumina").TargetedEvent<this, void>; /** Fires when the component is open and animation is complete. */ readonly calciteTooltipOpen: import("@arcgis/lumina").TargetedEvent<this, void>; readonly "@eventTypes": { calciteTooltipBeforeClose: Tooltip["calciteTooltipBeforeClose"]["detail"]; calciteTooltipBeforeOpen: Tooltip["calciteTooltipBeforeOpen"]["detail"]; calciteTooltipClose: Tooltip["calciteTooltipClose"]["detail"]; calciteTooltipOpen: Tooltip["calciteTooltipOpen"]["detail"]; }; }