import { LitElement, PropertyValues } from 'lit'; import { langsArray } from '../../../common/helpers/flatpickr/index'; import '../../reusable/button'; import { BaseOptions } from 'flatpickr/dist/types/options'; type SupportedLocale = (typeof langsArray)[number]; declare const DatePicker_base: (new (...args: any[]) => import("../../../common/mixins/form-input").FormMixinInterface) & typeof LitElement; /** * Datepicker: uses Flatpickr's datetime picker library -- `https://flatpickr.js.org` * @fires on-change - Emitted when the selected date(s) change. Event.detail has the shape: * { dates: string | string[] | null | [], dateString?: string, source?: string } * - dates: ISO string for single selection, or array of ISO strings for multiple selections. * An empty array or null indicates the value was cleared. * - dateString: the display string from the input (may be empty when cleared) * - source: 'clear' when the value was cleared; otherwise may be 'date-selection' or undefined. * @slot tooltip - Slot for tooltip. * @attr {string} [name=''] - The name of the input, used for form submission. * @attr {string} [invalidText=''] - The custom validation message when the input is invalid. * @attr {Date | Date[] | string | string[] } [value=''] - The value of the input. */ export declare class DatePicker extends DatePicker_base { static styles: import("lit").CSSResult[]; /** Label text. */ accessor label: string; /** Visually hide the label. */ accessor hideLabel: boolean; accessor locale: SupportedLocale | string; /** Sets flatpickr value to define how the date will be displayed in the input box (ex: `Y-m-d H:i`). */ accessor dateFormat: string; /** * Sets the initial selected date(s). * * @deprecated Soft-deprecated. Prefer setting `value`. * * Backward compatibility notes: * - still supports property assignment (`defaultDate = '2025-01-01'` or string[]). * - empty attribute values are treated as `null`. */ accessor defaultDate: string | string[] | null; /** Sets default error message. */ accessor defaultErrorMessage: string; /** Sets datepicker form input value to required/required. */ accessor required: boolean; /** Input size. "xs", "sm", "md", or "lg". */ accessor size: string; /** * Current date value for the component. * * - Controlled: set from the host (recommended). * - Uncontrolled: populated from `defaultDate` and user selections. * * Note: for backward compatibility, `value` may arrive as strings from some * host frameworks; this component will attempt to parse/normalize those. */ value: Date | Date[] | string | string[] | null; /** Sets validation warning messaging. */ accessor warnText: string; /** Sets flatpickr options setting to disable specific dates. Accepts array of dates in Y-m-d format, timestamps, or Date objects. */ accessor disable: (string | number | Date)[]; /** Internal storage for processed disable dates. * @internal */ private accessor _processedDisableDates; /** Sets flatpickr options setting to enable specific dates. */ accessor enable: (string | number | Date)[]; /** Sets flatpickr mode to select single (default), multiple dates. */ accessor mode: 'single' | 'multiple'; /** Sets caption to be displayed under primary date picker elements. */ accessor caption: string; /** Sets entire datepicker form element to enabled/disabled. */ accessor datePickerDisabled: boolean; /** Sets entire datepicker form element to readonly. */ accessor readonly: boolean; /** Sets 24 hour formatting true/false. * Defaults to 12H for all `en-*` locales and 24H for all other locales. */ accessor twentyFourHourFormat: boolean | null; /** Sets lower boundary of datepicker date selection. */ accessor minDate: string | number | Date; /** Sets upper boundary of datepicker date selection. */ accessor maxDate: string | number | Date; /** Allows manual input of date/time string that matches dateFormat when true. */ accessor allowManualInput: boolean; /** 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 flatpickr enableTime value based on detected dateFormat. * @internal */ private accessor _enableTime; /** * Sets whether user has interacted with datepicker for error handling. * @internal */ private accessor _hasInteracted; /** Flatpickr instantiation. * @internal */ private accessor flatpickrInstance; /** * Queries the anchor DOM element. * @internal */ private accessor _inputEl; /** Tracks if we're in a clear operation to prevent duplicate events * @internal */ private accessor _isClearing; /** Internal ID used to associate the input with its calendar container. * @internal */ private _anchorId; /** Customizable text strings. */ accessor textStrings: { requiredText: string; clearAll: string; pleaseSelectDate: string; noDateSelected: string; pleaseSelectValidDate: string; invalidDateFormat: string; errorProcessing: string; lockedStartDate: string; lockedEndDate: string; dateLocked: string; dateNotAvailable: string; dateInSelectedRange: string; }; /** Internal text strings. * @internal */ accessor _textStrings: { requiredText: string; clearAll: string; pleaseSelectDate: string; noDateSelected: string; pleaseSelectValidDate: string; invalidDateFormat: string; errorProcessing: string; lockedStartDate: string; lockedEndDate: string; dateLocked: string; dateNotAvailable: string; dateInSelectedRange: string; }; /** Control flag to prevent Flatpickr from opening when clicking caption, error, label, or warning elements. * @internal */ private accessor _shouldFlatpickrOpen; /** Track if we initially had a defaultDate when the component was first connected. * @internal */ private accessor _hasInitialDefaultDate; /** Track initialization state * @internal */ private _initialized; /** Track destroyed state * @internal */ private _isDestroyed; /** Store submit event listener reference for cleanup * @internal */ private _submitListener; /** Debounced re-initialization helper used when configuration changes. * @internal */ private debouncedUpdate; private applyLegacyDefaultDate; connectedCallback(): void; disconnectedCallback(): void; private hasValue; private updateFormValue; render(): import("lit-html").TemplateResult<1>; private renderValidationMessage; getDatepickerClasses(): { 'date-picker': boolean; 'date-picker__enable-time': boolean; 'date-picker__multiple-select': boolean; 'date-picker__disabled': boolean; }; firstUpdated(changedProperties: PropertyValues): Promise; private processDefaultDates; updated(changedProperties: PropertyValues): void; private syncAllowInput; private setupAnchor; private _handleClear; initializeFlatpickr(): Promise; updateFlatpickrOptions(): Promise; private parseDateString; private normalizeToDate; private isDateInRange; private resolveYearFromConfig; setInitialDates(): void; private normalizeValueInput; /** * Validate pre-filled `value`. */ private validateAndNormalizeHostValue; getComponentFlatpickrOptions(): Promise>; handleOpen(): Promise; handleClose(): Promise; handleDateChange(selectedDates: Date[], dateStr: string): Promise; private setShouldFlatpickrOpen; private closeFlatpickr; private onSuppressLabelInteraction; private handleInputClickEvent; private handleInputFocusEvent; private _validate; private _onChange; private _handleFormReset; getValue(): Date | Date[] | null; setValue(newValue: Date | Date[] | null): void; } declare global { interface HTMLElementTagNameMap { 'kyn-date-picker': DatePicker; } } export {}; //# sourceMappingURL=datepicker.d.ts.map