import { LitElement, PropertyValues } from 'lit'; import { langsArray } from '../../../common/helpers/flatpickr/index'; import '../../reusable/button'; import flatpickr from 'flatpickr'; import { BaseOptions } from 'flatpickr/dist/types/options'; type SupportedLocale = (typeof langsArray)[number]; declare const TimePicker_base: (new (...args: any[]) => import("../../../common/mixins/form-input").FormMixinInterface) & typeof LitElement; /** * Timepicker: uses Flatpickr library,time picker implementation -- `https://flatpickr.js.org/examples/#time-picker` * @fires on-change - Emitted when the selected time changes. Event.detail has the shape: * { time: string | null, source?: string } * - time: formatted time string when a time is selected, or null when cleared. * - source: 'clear' when the value was cleared; otherwise undefined. * @slot tooltip - Slot for tooltip. * @attr {string} [name=''] - The name of the input, used for form submission. * @attr {string} [value=''] - The value of the input. * @attr {string} [invalidText=''] - The custom validation message when the input is invalid. */ export declare class TimePicker extends TimePicker_base { static styles: import("lit").CSSResult[]; /** Label text. */ accessor label: string; /** Visually hide the label. */ accessor hideLabel: boolean; /** Sets desired locale and, if supported, dynamically loads language lib */ accessor locale: SupportedLocale | string; /** * @deprecated Use `value` (Date or time string) to prefill the time instead. * Legacy: initial hour when `value` is unset. */ accessor defaultHour: number | null; /** * @deprecated Use `value` (Date or time string) to prefill the time instead. * Legacy: initial minute when `value` is unset. */ accessor defaultMinute: number | null; /** * @deprecated Use `value` (Date or time string) to prefill the time instead. * Legacy: initial seconds when `value` is unset. */ accessor defaultSeconds: number | null; /** Allows manual input of time string (when true, user can type a time) */ accessor allowManualInput: boolean; /** * Current time value for the component. * * - Uncontrolled: populated from `defaultHour` / `defaultMinute` / `defaultSeconds` and user selections. * - Controlled: can be set from the host (e.g. Vue `:value`) as a `Date` or time string. */ value: string | Date | null; /** Sets default error message. */ accessor defaultErrorMessage: string; /** Sets validation warning messaging. */ accessor warnText: string; /** Sets caption to be displayed under primary time picker elements. */ accessor caption: string; /** Sets timepicker form input value to required. */ accessor required: boolean; /** Input size. "xs", "sm", "md", or "lg". */ accessor size: string; /** Sets entire timepicker form element to enabled/disabled. */ accessor timepickerDisabled: boolean; /** Sets entire timepicker form element to readonly. */ accessor readonly: boolean; /** Sets 24-hour formatting true/false. */ accessor twentyFourHourFormat: boolean | null; /** Enable seconds in the timepicker UI. */ accessor enableSeconds: boolean; /** Sets lower boundary of time selection. */ accessor minTime: string | number | Date; /** Sets upper boundary of time selection. */ accessor maxTime: string | number | Date; /** Sets aria label attribute for error message. */ accessor errorAriaLabel: string; /** Sets title attribute for error message. */ accessor errorTitle: string; /** Sets aria label attribute for warning message. */ accessor warningAriaLabel: string; /** Sets title attribute for warning message. */ accessor warningTitle: string; /** Sets whether the Flatpickr calendar UI should use static positioning. */ accessor staticPosition: boolean; /** * Sets whether user has interacted with timepicker for error handling. * @internal */ private accessor _hasInteracted; /** Flatpickr instantiation. * @internal */ private accessor flatpickrInstance; /** * Queries the anchor DOM element. * @ignore */ private accessor _inputEl; /** Tracks if we're in a clear operation to prevent duplicate events * @internal */ private accessor _isClearing; /** Tracks if user has explicitly cleared the input despite having defaults * @internal */ private accessor _userHasCleared; /** Customizable text strings. */ accessor textStrings: { requiredText: string; clearAll: string; pleaseSelectDate: string; noTimeSelected: string; pleaseSelectValidDate: string; }; /** Internal text strings. * @internal */ accessor _textStrings: { requiredText: string; clearAll: string; pleaseSelectDate: string; noTimeSelected: string; pleaseSelectValidDate: string; }; /** Control flag to determine if Flatpickr should open * @internal */ private _shouldFlatpickrOpen; /** Track whether change originated from Flatpickr to avoid feedback loops. * @internal */ private _isFromFlatpickr; /** Track whether Flatpickr styles and instance have been initialized. * @internal */ private _initialized; /** Track destroyed state so we don't re-initialize after disconnect. * @internal */ private _isDestroyed; /** Track visibility polling timeout ID. * @internal */ private _visibilityPollTimeoutId; /** Track when legacy/default values are being applied to avoid feedback loops. * @internal */ private _applyingDefaults; /** Internal ID used to associate the input with its calendar container. * @internal */ private _anchorId; /** Store submit event listener reference for cleanup * @internal */ private _submitListener; /** Debounced re-initialization helper used when configuration changes. * @internal */ private debouncedUpdate; /** * Parses a time string (e.g. "14:30" or "14:30:45") or Date/number into a Date object * anchored to today, or returns null if invalid. */ private parseTimeString; private _timesEqual; private _incomingValueToDate; connectedCallback(): void; private hasValue; private updateFormValue; render(): import("lit-html").TemplateResult<1>; private renderValidationMessage; private getRawValue; getTimepickerClasses(): { 'time-picker': boolean; 'time-picker__disabled': boolean; }; private _padSecondsForInput; private syncFlatpickrFromHostValue; firstUpdated(changedProperties: PropertyValues): Promise; private isElementVisible; updated(changedProperties: PropertyValues): void; private _handleClear; private setupAnchor; private removeCalendarElement; initializeFlatpickr(): Promise; updateFlatpickrOptions(): Promise; getComponentFlatpickrOptions(): Promise>; setInitialDates(instance: flatpickr.Instance): void; handleOpen(): void; /** * Returns the selected time as a Date (anchored to today) or null. */ getValue(): Date | null; handleClose(): Promise; private commitManualInputValue; handleTimeChange(selectedDates: Date[], dateStr: string): Promise; private _validate; private _onChange; private _handleFormReset; private setShouldFlatpickrOpen; private closeFlatpickr; private onSuppressLabelInteraction; private handleInputClickEvent; private handleInputFocusEvent; disconnectedCallback(): void; setValue(newValue: Date | null): void; } declare global { interface HTMLElementTagNameMap { 'kyn-time-picker': TimePicker; } } export {}; //# sourceMappingURL=timepicker.d.ts.map