import { CSSResultArray, nothing, PropertyValues, TemplateResult } from 'lit'; import { Focusable } from '../../utils/focusable'; import '../calendar'; import '../icon'; import '../overlay'; import '../picker-button'; import '../popover'; import { EditableSegment } from './shared/segments/editable-segment'; import { LiteralSegment } from './shared/segments/literal-segment'; import { DateTimePickerLabels, Precision } from './shared/types'; import { Placement } from '../overlay/overlay-types'; declare const LuzmoDateTimePicker_base: typeof Focusable & { new (...args: any[]): import("../..").SizedElementInterface; prototype: import("../..").SizedElementInterface; } & { new (...args: any[]): import("../text-field/manage-help-text").HelpTextElementInterface; prototype: import("../text-field/manage-help-text").HelpTextElementInterface; }; /** * @element luzmo-date-time-picker * * @event change - Announces when a new date/time is committed by the user * @event input - Announces when the user's input changes the component's segments * * @slot calendar-icon - The icon used in the calendar button * @slot help-text - Default or non-negative help text to associate to your form element * @slot negative-help-text - Negative help text to associate to your form element when `invalid` */ export declare class LuzmoDateTimePicker extends LuzmoDateTimePicker_base { /** * The styles of the calendar * @internal */ static get styles(): CSSResultArray; /** * The selected date of the component. If defined, this also indicates where the calendar opens. * If not, the calendar opens at the current month, and placeholder values are shown. */ value?: string; /** * The minimum valid date a user can select */ min?: string; /** * The maximum valid date a user can select */ max?: string; /** * The date format to use for display. Can be 'mmdd', 'ddmm', or undefined (uses locale default). */ dateFormat?: 'mmdd' | 'ddmm'; /** * The separator to use between date segments (month, day, and year). * If not specified, the default separator from the locale will be used. */ dateSeparator?: string; /** * The granularity used to display the segments of the component's value */ get precision(): Precision; set precision(value: Precision); /** * @internal */ private _precision; /** * @internal */ private isUserSetPrecision; /** * Whether the `value` held by the form control is invalid. */ invalid: boolean; /** * Whether a user can interact with the value of the form control */ readonly: boolean; /** * Whether to display the form control with no visible background */ quiet: boolean; /** * Whether to display the form control with no visible background */ placement: Placement; /** * The IANA time zone identifier (eg. America/Los_Angeles) to use for parsing the date & setting it */ timeZone?: string; /** * Whether to display the form control with no visible background */ language: string; /** * Labels read by screen readers. The default values are in English * and can be overridden to localize the content. */ labels: DateTimePickerLabels; focused: boolean; /** * The selected date in the calendar in ZonedDateTime format * @internal */ private _value?; /** * The minimum allowed date a user can select in ZonedDateTime format * @internal */ private _min?; /** * The maximum allowed date a user can select in ZonedDateTime format * @internal */ private _max?; /** * The segments of the component * @internal */ private segments; /** * Whether the calendar is open * @internal */ private isCalendarOpen; /** * The first editable segment of the component * @internal */ firstEditableSegment: HTMLDivElement; /** * The input element of the component * @internal */ private input; /** * The language used to format the dates and weekdays. * @internal */ get _language(): string; /** * The time zone of the component * @internal */ private _timeZone; /** * The cached local time of the component * @internal */ private cachedLocalTime; /** * The date formatter of the component * @internal */ private dateFormatter; /** * The aria date formatter of the component * @internal */ private ariaDateFormatter; /** * The number parser of the component * @internal */ private numberParser; /** * The focus element of the component * @internal */ get focusElement(): HTMLElement; /** * The current date of the component * @internal */ private get currentDate(); /** * @return Whether the component's precision includes time segments (hour, minute, second, millisecond) * @internal */ private get includesTime(); /** * Resets the component's value and segments */ clear(): void; constructor(); protected willUpdate(changedProperties: PropertyValues): void; /** * Computes the component's most precise date property (min, max or value) or undefined if none is defined. * The order of precedence is: ZonedDateTime, CalendarDateTime, CalendarDate. * @internal */ private get mostSpecificDateValue(); /** * Converts the DateTimePicker's date properties (min, max and value) to match the provided date's type. * * @param dateValue - The date value to be used as a reference for the conversion */ private convertDatePropsToMatch; /** * Validates the component's date properties (min, max and value) compliance with one another. * If the [min, max] constraint interval is invalid, both properties are reset. * If the value is not within the [min, max] (valid) interval, it is reset. * * @param checkInterval - Whether to check the [min, max] interval */ private checkDatePropsCompliance; private isNonCompliantValue; /** * Update the component's date properties' types to include the provided precision. */ private updateDateProps; /** * Changes the component's default precision according to the most specific date property (min, max or value). */ private updateDefaultPrecision; render(): TemplateResult; private renderStateIcons; renderPicker(): TemplateResult | typeof nothing; private handleChange; renderInputContent(): TemplateResult; private renderSegments; renderLiteralSegment(segment: LiteralSegment): TemplateResult; renderEditableSegment(segment: EditableSegment): TemplateResult; private renderSegmentText; private handleKeydown; /** * The modifier parameters of the component * @internal */ private get modifierParams(); private incrementValue; private decrementValue; /** * Focuses the segment according to the direction, if there is one to focus on * * @param segment - Segment on which the event was triggered (the segment being changed) * @param elementToFocus - Defines which element will be focused: is it the previous one or the next one? */ private focusSegment; /** * The previous commited value of the component * @internal */ private previousCommitedValue; /** * Mark the user intent to commit the selected value. If the current value * is different from the previous commited value, dispatch a change event. */ private commitValue; private clearSegmentContent; private handleInput; /** * Updates the content of the segments by binding it to the `.innerText` property of the element, * instead of using string interpolation. This allows to not show user typed characters, but * only the formatted content of the segment, needed for the 'contenteditable' elements. * * @param segment - Segment on which the event was triggered (the segment being changed) * @param event - Triggered event details */ private updateSegmentContent; private createOutputString; private dispatchChange; private dispatchInput; private setValueFromSegments; private setSegments; private setNumberParser; private setDateFormatter; private setAriaDateFormatter; private getTimeOptions; } export {};