import type { CSSResultGroup } from 'lit'; import DSAIconButton from '../icon-button/icon-button'; import { InputBase } from '../../internal/components/input-base/input-base'; import type { ShoelaceFormControl } from '../../internal/shoelace-element'; /** * @summary Custom input for amounts, with strict restrictions on the value that can be entered. * * @dependency dsa-icon-button * @dependency dsa-error-text * @dependency dsa-success-text * * @slot label - The input's label. Alternatively, you can use the `label` attribute. * @slot prefix - Used to prepend a presentational icon or similar element to the input. * @slot suffix - Used to postpend a presentational icon or similar element to the input. * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute. * @slot tooltip - The tooltip slot allows additional information to be passed along the label. * * @event dsa-blur - Emitted when the control loses focus. * @event dsa-change - Emitted when an alteration to the control's value is committed by the user. * @event dsa-clear - Emitted when the clear button is activated. * @event dsa-focus - Emitted when the control gains focus. * @event dsa-input - Emitted when the control receives input. * @event dsa-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied. */ export default class DSAInputAmount extends InputBase implements ShoelaceFormControl { static styles: CSSResultGroup; static dependencies: { 'dsa-icon-button': typeof DSAIconButton; 'dsa-success-text': typeof import("../success-text/success-text").default; 'dsa-error-text': typeof import("../error-text/error-text").default; }; private readonly localize; protected input: HTMLInputElement; /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */ get valueAsNumber(): number; set valueAsNumber(newValue: number); protected handleChange(): void; protected handleInput(): void; protected handleKeyDown(event: KeyboardEvent): void; private getSafeStep; private adjustAmountValue; /** Increments the value of a numeric or time input type by the value of the step attribute, multiplied by an optional number parameter. */ stepUp(): void; /** Decrements the value of a numeric or time input type by the value of the step attribute, multiplied by an optional number parameter. */ stepDown(): void; /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ checkValidity(): boolean; /** Checks for validity and shows the browser's validation message if the control is invalid. */ reportValidity(): boolean; private checkAmountValidity; renderInput(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-input-amount': DSAInputAmount; } }