UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

50 lines (49 loc) 2.3 kB
/// <reference path="../../index.d.ts" /> import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { FlipContext } from "../interfaces.js"; import type { IconName } from "../calcite-icon/interfaces.js"; /** * Any attributes placed on <calcite-link> component will propagate to the rendered child * * Passing a 'href' will render an anchor link, instead of a button. * * It is the consumers responsibility to add aria information, rel, target, for links, and any link attributes for form submission * * @cssproperty [--calcite-link-text-color] - Specifies the component's text color. * @slot - A slot for adding text. */ export abstract class Link extends LitElement { /** * When `true`, prevents interaction and decreases the component's opacity. * * @default false */ accessor disabled: boolean; /** * When specified, 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 URL of the linked resource, which can be set as an absolute or relative path. */ accessor href: string; /** Specifies an icon to display at the end of the component. */ accessor iconEnd: IconName; /** When `true` and the element direction is right-to-left (`"rtl"`), flips the component's `iconStart` and/or `iconEnd`. */ accessor iconFlipRtl: FlipContext; /** Specifies an icon to display at the start of the component. */ accessor iconStart: IconName; /** Specifies the relationship to the linked resource defined in `href`. */ accessor rel: string; /** Specifies the frame or window to open the linked resource. */ accessor target: string; /** * 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>; }