import type { CSSResultGroup } from 'lit'; import DSAIcon from '../icon/icon'; import DSATooltip from '../tooltip/tooltip'; import { ShoelaceElement } from '../../internal/shoelace-element'; /** * @summary Copies text data to the clipboard when the user clicks the trigger. * @documentation * * @dependency dsa-icon * @dependency dsa-tooltip * * @event dsa-copy - Emitted when the data has been copied. * @event dsa-error - Emitted when the data could not be copied. */ export default class DSACopyButton extends ShoelaceElement { static styles: CSSResultGroup; private readonly localize; static dependencies: { 'dsa-icon': typeof DSAIcon; 'dsa-tooltip': typeof DSATooltip; }; copyIcon: DSAIcon; successIcon: DSAIcon; errorIcon: DSAIcon; tooltip: DSATooltip; button: HTMLButtonElement; isCopying: boolean; status: 'rest' | 'success' | 'error'; /** The text value to copy. */ value: string; /** * An id that references an element in the same document from which data will be copied. If both this and `value` are * present, this value will take precedence. By default, the target element's `textContent` will be copied. To copy an * attribute, append the attribute name wrapped in square brackets, e.g. `from="el[value]"`. To copy a property, * append a dot and the property name, e.g. `from="el.value"`. */ from: string; /** Disables the copy button. */ disabled: boolean; /** A custom label to show in the tooltip. */ copyLabel: string; /** A custom label to show in the tooltip after copying. */ successLabel: string; /** A custom label to show in the tooltip when a copy error occurs. */ errorLabel: string; /** The preferred placement of the tooltip. */ tooltipPlacement: 'top' | 'right' | 'bottom' | 'left'; /** * Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with * `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, * scenarios. */ hoist: boolean; /** The icon button's size. */ size: 'small' | 'medium' | 'large'; private handleCopy; private showStatus; private resetStatus; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-copy-button': DSACopyButton; } }