UNPKG

coveo-search-ui-extensions

Version:

Small generic components to extend the functionality of Coveo's Search UI framework.

52 lines (51 loc) 1.62 kB
import { Component, IResultsComponentBindings } from 'coveo-search-ui'; export declare type ActionButtonOptions = IActionButtonOptionsWithTitle | IActionButtonOptionsWithIcon; export interface IActionButtonOptionsWithTitle extends IActionButtonBaseOptions { title: string; icon?: string; } export interface IActionButtonOptionsWithIcon extends IActionButtonBaseOptions { title?: string; icon: string; } interface IActionButtonBaseOptions { tooltip?: string; click?: () => void; } /** * The _ActionButton_ component is a simple button allowing to show an icon, text, and tooltip. * * ```html * <button class='CoveoActionButton'></button> * ``` */ export declare class ActionButton extends Component { element: HTMLElement; options: ActionButtonOptions; bindings?: IResultsComponentBindings; static ID: string; /** * The possible options for _ActionButton_. * @componentOptions */ static options: ActionButtonOptions; constructor(element: HTMLElement, options: ActionButtonOptions, bindings?: IResultsComponentBindings); /** * Updates the button icon. * @param icon Markup of the SVG icon to set. */ updateIcon(icon: string): void; /** * Updates the button tooltip. * @param tooltip The tooltip to set. */ updateTooltip(tooltip: string): void; protected render(): void; protected applyButtonStyles(): void; protected createIconElement(): HTMLElement; protected createTitleElement(): HTMLElement; private appendIcon; private appendTitle; private appendTooltip; } export {};