import type { CSSResultGroup } from 'lit'; import { ShoelaceElement } from '../../shoelace-element'; import type { ShoelaceFormControl } from '../../shoelace-element'; /** * @summary (Internal) Date field allows the user to input a date. * * * @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-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 DSAInternalDateField extends ShoelaceElement implements ShoelaceFormControl { static styles: CSSResultGroup; private readonly formControlController; private readonly localize; hiddenInput: HTMLInputElement; dayInput: HTMLInputElement; monthInput: HTMLInputElement; yearInput: HTMLInputElement; private focusedInput; private currentLocale; private selectedDay; private selectedMonth; private selectedYear; private dateOrder; private delimiter; private lastPressedKey; private internalValueChange; private previousTentativeDate; private previousSpinbuttonValue; /** The parent element accessible name */ parentName: string; /** A description for accessibility */ description: string; /** The name of the input, submitted as a name/value pair with form data. */ name: string; /** The current value of the input, submitted as a name/value pair with form data. */ value: string; /** The default value of the form control. Primarily used for resetting the form control. */ defaultValue: string; /** Disables the input. */ disabled: boolean; lang: string; /** Indicates whether the input should be in error state */ error: boolean; /** Makes the input readonly. */ readonly: boolean; /** * By default, form controls are associated with the nearest containing `
` element. This attribute allows you * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in * the same document or shadow root for this to work. */ form: string; /** Makes the input a required field. */ required: boolean; /** The input's minimum value. Only applies to date and number input types. */ min: number | string; /** The input's maximum value. Only applies to date and number input types. */ max: number | string; /** * Specifies the granularity that the value must adhere to, or the special value `any` which means no stepping is * implied, allowing any numeric value. Only applies to date and number input types. */ step: number | 'any'; /** Indicates that the input should receive focus on page load. */ autofocus: boolean; /** Used to customize the label or icon of the Enter key on virtual keyboards. */ enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; /** Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. */ get valueAsDate(): Date | null; set valueAsDate(newValue: Date | null); /** 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); /** Gets the validity state object */ get validity(): ValidityState; /** Gets the validation message */ get validationMessage(): string; connectedCallback(): void; private updateDateOrder; private getSpinbuttonOrder; private handleBlur; private handleChange; private handleFocus; private handleHiddenInputFocus; private handleSpinbuttonClick; private handleSpinbuttonKeydown; private handleSpinbuttonInput; private handleInvalid; private focusNextSpinbutton; private focusPreviousSpinbutton; handleDisabledChange(): void; handleValueChange(): Promise; handleLangChange(): void; handleFocusChange(): void; /** Sets focus on the input. */ focus(options?: FocusOptions): void; /** Removes focus from the input. */ blur(): void; /** Increments the value of a numeric or time input type by the value of the step attribute, multiplied by an optional number parameter. */ stepUp(stepNumber?: number): 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(stepNumber?: number): void; /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ checkValidity(): boolean; clear(): void; /** Gets the associated form, if one exists. */ getForm(): HTMLFormElement | null; /** Checks for validity and shows the browser's validation message if the control is invalid. */ reportValidity(): boolean; /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string): void; private renderSpinbutton; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-internal-date-field': DSAInternalDateField; } }