import type { CSSResultGroup } from 'lit'; import DSAErrorText from '../error-text/error-text'; import DSAIconButton from '../icon-button/icon-button'; import { ShoelaceElement } from '../../internal/shoelace-element'; import { HasSlotController } from '../../internal/slot'; /** * @summary The search combines a styled input and a submit button. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/composants/search-recherche/search-bar-barre-de-recherche/web-e6IC9FgP * * @dependency dsa-icon-button * @dependency dsa-error-text * * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute. * * @event dsa-change - Emitted when an alteration to the search input control's value is committed by the user. * @event dsa-input - Emitted when the search input control receives input. * @event dsa-clear - Emitted when the clear button is activated. * @event dsa-focus - Emitted when the search input control gains focus. * @event dsa-blur - Emitted when the search input control loses focus. * @event dsa-submit - Emitted when the submit button is activated, or when the user presses 'Enter' on the input. */ export default class DSASearch extends ShoelaceElement { static styles: CSSResultGroup; static dependencies: { 'dsa-icon-button': typeof DSAIconButton; 'dsa-error-text': typeof DSAErrorText; }; private readonly localize; protected readonly hasSlotController: HasSlotController; input: HTMLInputElement; submitButton: HTMLButtonElement; clearButton: DSAIconButton; private hasFocus; /** The form control's size. */ size: 'small' | 'medium' | 'large'; /** The form control's variant. */ variant: 'base' | 'layer' | 'floating'; /** The current value of the input */ value: string; /** The form control's help text. If you need to display HTML, use the `help-text` slot instead. */ helpText: string; /** Indicates whether the form control should be in error state */ error: boolean; /** An error message that is shown when `error` is set to true. If there are several messages, must be a * string of messages separated by a pipe, e.g. "Error 1|Error 2|Error 3" */ errorMessage: string | string[]; /** Provides a custom accessible label for the input element */ accessibleName: string; /** Provides a custom placeholder for the input element */ placeholder: string; private handleChange; private handleInput; private handleInputFocus; private handleInputBlur; private handleClearClick; private handleKeyDown; private handleSubmitClick; protected getDescriptionIds(): string; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-search': DSASearch; } }