import { LitElement, PropertyValues } from 'lit'; import { langsArray, DateRangeEditableMode } from '../../../common/helpers/flatpickr/index'; import '../../reusable/button'; import { BaseOptions } from 'flatpickr/dist/types/options'; type SupportedLocale = (typeof langsArray)[number]; declare const DateRangePicker_base: (new (...args: any[]) => import("../../../common/mixins/form-input").FormMixinInterface) & typeof LitElement; /** * Date Range Picker: uses Flatpickr library, range picker implementation -- `https://flatpickr.js.org/examples/#range-calendar` * @fires on-change - Emitted when the selected date range changes. Event.detail has the shape: * { dates: string[] | (Date | null)[] | null, dateString?: string, source?: string } * - dates: array of ISO strings for selected dates (length 1 or 2), or an array containing Date/null values, * or null/empty when 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 {[Date | null, Date | null]} [value=''] - The value of the input. * @attr {string} [invalidText=''] - The custom validation message when the input is invalid. */ export declare class DateRangePicker extends DateRangePicker_base { static styles: import("lit").CSSResult[]; /** Label text. */ accessor label: string; /** Visually hide the label. */ accessor hideLabel: boolean; /** Sets and dynamically imports specific l10n calendar localization. */ 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) for the range. * * @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; /** Controls which parts of the date range are editable. */ accessor rangeEditMode: DateRangeEditableMode; /** Sets default error message. */ accessor defaultErrorMessage: string; /** * Current date range value for the component. * * - Uncontrolled: populated from `defaultDate` and user selections. * - Controlled: can be set from the host (e.g. Vue `:value`). */ value: [Date | null, Date | 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 caption to be displayed under primary date picker elements. */ accessor caption: string; /** Sets date range picker form input value to required. */ accessor required: boolean; /** Input size. "xs", "sm", "md", or "lg". */ accessor size: string; /** Sets entire date range picker form element to enabled/disabled. */ accessor dateRangePickerDisabled: boolean; /** Sets entire date range picker 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 date range picker date selection. */ accessor minDate: string | number | Date; /** Allows manual input of date/time string that matches dateFormat when true. */ accessor allowManualInput: boolean; /** Sets upper boundary of date range picker date selection. */ accessor maxDate: 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 flatpickr enableTime value based on detected dateFormat. * @internal */ private accessor _enableTime; /** Flatpickr instantiation. * @internal */ private accessor flatpickrInstance; /** * Queries the input DOM element. * @internal */ private accessor _inputEl; /** * Sets whether user has interacted with datepicker for error handling. * @internal */ private accessor _hasInteracted; /** Customizable text strings. */ accessor textStrings: { requiredText: string; clearAll: string; pleaseSelectDate: string; pleaseSelectValidDate: string; pleaseSelectBothDates: string; dateRange: string; noDateSelected: string; startDateSelected: string; invalidDateRange: string; dateRangeSelected: string; lockedStartDate: string; lockedEndDate: string; dateLocked: string; dateNotAvailable: string; dateInSelectedRange: string; }; /** Internal text strings. * @internal */ accessor _textStrings: { requiredText: string; clearAll: string; pleaseSelectDate: string; pleaseSelectValidDate: string; pleaseSelectBothDates: string; dateRange: string; noDateSelected: string; startDateSelected: string; invalidDateRange: string; dateRangeSelected: string; lockedStartDate: string; lockedEndDate: string; dateLocked: string; dateNotAvailable: string; dateInSelectedRange: string; }; /** Tracks if we're in a clear operation to prevent duplicate events * @internal */ private accessor _isClearing; /** 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; /** Stable anchor id for accessibility (generate once per instance) * @internal */ private _anchorId; /** Store submit event listener reference for cleanup * @internal */ private _submitListener; /** Track if we're currently syncing from the host (e.g. Vue `:value`). * @internal */ private accessor _isSyncingFromHost; /** For handling DatePicker change to prevent circular updates * @internal */ private accessor _isDatePickerChange; /** Debounced re-initialization helper used when configuration changes. * @internal */ private debouncedUpdate; /** Debounced resize handler to keep the calendar positioned correctly. * @internal */ private handleResize; connectedCallback(): void; disconnectedCallback(): void; private hasValue; private updateFormValue; render(): import("lit-html").TemplateResult<1>; private renderValidationMessage; private getDateRangePickerClasses; private parseDateString; firstUpdated(changedProperties: PropertyValues): Promise; updated(changedProperties: PropertyValues): void; private syncAllowInput; private setupAnchor; private normalizeToDate; private processDefaultDates; private _clearInput; private _handleClear; handleClose(): Promise; initializeFlatpickr(): Promise; updateFlatpickrOptions(): Promise; getComponentFlatpickrOptions(): Promise>; setInitialDates(): void; handleOpen(): void; private syncFlatpickrFromValue; handleDateChange(selectedDates: Date[], dateStr: string): Promise; private updateSelectedDateRangeAria; private setShouldFlatpickrOpen; private closeFlatpickr; private onSuppressLabelInteraction; private handleInputClickEvent; private handleInputFocusEvent; private _validate; private _onChange; private _handleFormReset; getValue(): [Date | null, Date | null]; setValue(newValue: [Date | null, Date | null]): void; } declare global { interface HTMLElementTagNameMap { 'kyn-date-range-picker': DateRangePicker; } } export {}; //# sourceMappingURL=daterangepicker.d.ts.map