import { EventEmitter } from "../../stencil-public-runtime"; import { ThemeableComponent } from "../../common"; import { DuetIconName, DuetTheme } from "../../common-types"; export type DuetChipVariation = "button" | "filter" | "input" | "radio"; export type DuetChipSize = "medium" | "large"; export type DuetChipEvent = { originalEvent?: Event; checked: boolean; value: string; component: "duet-chip"; }; export declare class DuetChip implements ThemeableComponent { focus: boolean; /** * Own Properties. */ private chipId; private focusableElement; private deleteButtonElement; private deleteLabels; private selectedForDeletionLabels; /** * Reference to host HTML element. */ element: HTMLDuetChipElement; popupElement: HTMLDuetPopupMenuElement; popupOpen: boolean; inputChipHover: boolean; inputChipDeleteFocus: boolean; /** * Adds accessible label for the chip that is only shown for screen readers. * Typically, this label text replaces the visible text on the button for * users who use assistive technology. With input variation this is not used, * as the accessible label is automatically generated. */ accessibleLabel: string; /** * Variation of the chip. * Button should be used to present a list of actions or suggestions. It behaves like a button and must be used * together with a click handler. Filter acts like a checkbox, it can be toggled on or off, and it should be * used with a value. Input represents items input by the user, and the chip can be removed with a click. * Radio behaves like a radio button, it can be toggled on or off, and it should be used with a value and name. */ variation: DuetChipVariation; /** * Size of the chip. Use "large" for a chip that has the same height as default duet-input and duet-button. */ size: DuetChipSize; /** * Id of the DuetPopupMenu that is controlled by the chip. */ popup: string; /** * Icon to display to the left of the chip content. */ icon: DuetIconName; /** * Theme of the button. */ theme: DuetTheme; /** * Adds a unique identifier for the chip. */ identifier: string; /** * The value of the html input when used as filter, or the button's value. */ value: string; /** * Name attribute of the html input (filter) or button. */ name: string; /** * Selected state of the input chip. Deleting the input chip with backspace key should be done only for a selected * chip. If a chip is not selected, backspace key should select it. * @internal */ selected: boolean; /** * Checked state of the filter chip. */ checked: boolean; clearOtherRadioButtons(): void; /** * Makes the chip look inactive and announced as unavailable to assistive technologies. Prevents the default action. * Not available for the input variation. */ disabled: boolean; removeDisabledAttributeWhenFalse(): void; /** * If the component expands or collapses adjacent content, then use this property * to add the aria-expanded attribute to the opening element. Set the value to convey * the current expanded (true) or collapsed (false) state of the content. */ accessibleExpanded: boolean; /** * Use this property to add an aria-haspopup attribute. */ accessiblePopup: string; /** * Emitted when the checked property has changed (applicable only for the filter variation). */ duetChange: EventEmitter; /** * Emitted when an input chip is removed. */ duetRemove: EventEmitter; /** * Emitted when the chip receives focus. */ duetFocus: EventEmitter; /** * Emitted when the chip loses focus. */ duetBlur: EventEmitter; /** * Component lifecycle events. */ componentWillLoad(): void; connectedCallback(): void; disconnectedCallback(): void; componentDidRender(): void; private enforceNoDisabledSelected; private radioInputListenersRemove; private radioInputListenersAdd; private radioInputSetUp; private popupSetUp; /** * Component event handling. */ private onFocus; private onBlur; private emitChange; /** * Change checked state and emit duetChange event. */ private onFilterChange; /** * Change checked state and emit duetChange event. */ private onRadioChange; private onRadioClick; /** * Stop propagation and prevent default if popup is present, as the popup controls value and checked state. */ private onFilterClick; private getAccessibleExpanded; private getAccessiblePopup; private getAccessibleDeleteLabel; private getAccessibleInputChipLabel; /** * Remove input chip */ private onRemoveClick; /** * Sets focus. Use this method instead of the global focus(). */ setFocus(options?: FocusOptions): Promise; /** * @internal */ setDeleteFocus(): Promise; /** * Removes input chip. Use this method instead of the native remove() so the component can * emit appropriate event */ removeChip(): Promise; render(): any; }