import * as i0 from '@angular/core';
import { InputSignal, InputSignalWithTransform, EventEmitter, TemplateRef, OnInit, OnDestroy, OnChanges, AfterViewInit, ElementRef, ChangeDetectorRef, SimpleChanges } from '@angular/core';
import { MobileMode, MobileModeBase, MobileModeConfig } from '@fundamental-ngx/core/mobile-mode';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import { DateRange, CalendarType, DaysOfWeek, FdCalendarView, NavigationButtonDisableFunction, CalendarYearGrid, CalendarComponent } from '@fundamental-ngx/core/calendar';
import { SpecialDayRule, Placement } from '@fundamental-ngx/core/shared';
import { ControlValueAccessor, Validator } from '@angular/forms';
import { FormStates } from '@fundamental-ngx/cdk/forms';
import { DatetimeAdapter, DateTimeFormats } from '@fundamental-ngx/core/datetime';
import { FormItemControl, PopoverFormMessageService } from '@fundamental-ngx/core/form';
import { FdLanguageKeyIdentifier } from '@fundamental-ngx/i18n';

interface DatePicker<D> extends MobileMode {
    selectedDate: Nullable<D>;
    specialDaysRules?: SpecialDayRule<D>[];
    showCalendarLegend?: boolean | InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
    legendCol?: boolean | InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
    isOpenChange: EventEmitter<boolean>;
    dialogApprove(): void;
    dialogDismiss(value: D | Array<D> | DateRange<D> | Array<DateRange<D>>): void;
    getSelectedDate(): D | Array<D> | DateRange<D> | Array<DateRange<D>>;
}

declare class DatePickerMobileComponent<D> extends MobileModeBase<DatePicker<D>> {
    datePickerConfig: {
        calendarTemplate: TemplateRef<any>;
        controlTemplate: TemplateRef<any>;
    };
    /** @hidden */
    dialogTemplate: TemplateRef<any>;
    /** @hidden */
    private _selectedBackup;
    /** @hidden */
    constructor(datePickerConfig: {
        calendarTemplate: TemplateRef<any>;
        controlTemplate: TemplateRef<any>;
    }, datePickerComponent: DatePicker<D>);
    /** @hidden */
    _getShowCalendarLegend(): boolean;
    /** @hidden */
    _getLegendCol(): boolean;
    /** @hidden */
    handleApprove(): void;
    /** @hidden */
    handleDismiss(): void;
    /** @hidden */
    private _toggleDialog;
    /** @hidden */
    private _open;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerMobileComponent<any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerMobileComponent<any>, "fd-date-picker-mobile", never, {}, {}, never, never, true, never>;
}

/**
 * The datetime picker component is an opinionated composition of the fd-popover and
 * fd-calendar components to accomplish the UI pattern for picking a date.
 *
 * Supports Angular Forms.
 * ```html
 * <fd-date-picker [(ngModel)]="date"></fd-date-picker>
 * ```
 *
 */
declare class DatePickerComponent<D> implements DatePicker<D>, OnInit, OnDestroy, OnChanges, AfterViewInit, ControlValueAccessor, Validator, FormItemControl {
    private _changeDetectionRef;
    private _dateTimeAdapter;
    private _dateTimeFormats;
    private _popoverFormMessage;
    /** The type of calendar, 'single' for single date selection or 'range' for a range of dates. */
    type: CalendarType;
    /** Date picker input placeholder string */
    placeholder: string;
    /** ID attribute for input element inside DatePicker component */
    inputId: string;
    /** If it is mandatory field */
    required: boolean;
    /** Define a custom datetime format. Can be a string for DayjsDatetimeAdapter or object for FdDatetimeAdapter */
    customDateTimeFormat: unknown;
    /** Text displayed in message */
    set message(message: string);
    /** The trigger events that will open/close the message box.
     *  Accepts any [HTML DOM Events](https://www.w3schools.com/jsref/dom_obj_event.asp). */
    set messageTriggers(triggers: string[]);
    /** The currently selected date model in single mode. */
    selectedDate: Nullable<D>;
    /** The currently selected date model in multiple mode. */
    selectedMultipleDates: Array<D>;
    /** The currently selected date model with start and end in range mode. */
    selectedRangeDate: DateRange<D>;
    /** The currently selected date model with multiple ranges. */
    selectedMultipleDateRanges: Array<DateRange<D>>;
    /** The day of the week the calendar should start on. 1 represents Sunday, 2 is Monday, 3 is Tuesday, and so on. */
    startingDayOfWeek: DaysOfWeek;
    /**
     * Whether user wants to mark day cells on hover.
     * Works only on range mode, when start date is selected on Day View.
     */
    rangeHoverEffect: boolean;
    /** Whether to validate the date picker input. */
    useValidation: boolean;
    /** Whether a null input is considered valid. */
    allowNull: boolean;
    /** Actually shown active view one of 'day' | 'month' | 'year' in calendar component*/
    activeView: FdCalendarView;
    /**
     *  The placement of the popover. It can be one of: top, top-start, top-end, bottom,
     *  bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end.
     */
    placement: Placement;
    /** The element to which the popover should be appended. */
    appendTo: ElementRef;
    /** Whether the date picker is disabled. */
    disabled: boolean;
    /** Defines if date picker should be closed after date choose */
    closeOnDateChoose: boolean;
    /** Enables Today-Selection-Button if true */
    showTodayButton: boolean;
    /** Label for Today-Selection-Button */
    todayButtonLabel: string;
    /**
     * Function used to disable previous button in the calendar header.
     */
    previousButtonDisableFunction: NavigationButtonDisableFunction<D>;
    /**
     * Function used to disable next button in the calendar header.
     */
    nextButtonDisableFunction: NavigationButtonDisableFunction<D>;
    /**
     * @deprecated Popover is toggled with f4 key
     */
    buttonFocusable: boolean;
    /**
     * Special days mark, it can be used by passing array of object with
     * Special day number, list 1-20 [class:`fd-calendar__item--legend-{{number}}`] is available there:
     * https://sap.github.io/fundamental-styles/components/calendar.html calendar special days section
     * Rule accepts method with FdDate object as a parameter. ex:
     * `rule: (fdDate: FdDate) => fdDate.getDay() === 1`, which will mark all sundays as special day.
     */
    specialDaysRules: SpecialDayRule<D>[];
    /**
     * Object to customize year grid,
     * Row, Columns and method to display year can be modified
     */
    yearGrid: CalendarYearGrid;
    /**
     * Object to customize aggregated year grid,
     * Row, Columns and method to display year can be modified
     */
    aggregatedYearGrid: CalendarYearGrid;
    /**
     * Whether user wants to mark sunday/saturday with `fd-calendar__item--weekend` class
     */
    markWeekends: boolean;
    /**
     * Whether user wants to show week numbers next to days
     */
    showWeekNumbers: boolean;
    /**
     * Whether the user wants to select multiple days or multiple range dates.
     * If `displayWeekNumbers` is true, the user can click on the week number to mark the related row.
     * The user can click on week days to mark the related column.
     * Note: Clickable selection for week row or column does not work for range selections.
     */
    allowMultipleSelection: boolean;
    /** Should date picker be inlined. */
    inline: boolean;
    /** aria-labelledby for element describing date-picker. */
    ariaLabelledBy: Nullable<string>;
    /**
     * Whether to recalculate value from the input as user types or on blur.
     * By default, updates the value as user types.
     * @default false
     */
    processInputOnBlur: boolean;
    /**
     * Whether to prevent page scrolling when focusing date picker input field after calendar has been closed.
     */
    preventScrollOnFocus: boolean;
    /** Whether date picker should rendered in mobile mode. */
    mobile: boolean;
    /** Mobile mode configuration. */
    mobileConfig: MobileModeConfig;
    /** Whether calendar is used inside mobile in landscape mode, it also adds close button on right side */
    mobileLandscape: boolean;
    /** Whether calendar is used inside mobile in portrait mode */
    mobilePortrait: boolean;
    /** Whether to select and display the date range in MM/YYYY or YYYY format
     * For month and year format value is 'month'
     * For year format value is 'year'
     */
    dateRangeFormat: string;
    /** Event emitted when the state of the isOpen property changes. */
    readonly isOpenChange: EventEmitter<boolean>;
    /** Event thrown every time selected date in single mode is changed */
    readonly selectedDateChange: EventEmitter<Nullable<D>>;
    /** Event thrown every time the selected dates in multiple mode are changed. */
    readonly selectedMultipleDatesChange: EventEmitter<Array<D>>;
    /** Event thrown every time selected first or last date in range mode is changed */
    readonly selectedRangeDateChange: EventEmitter<DateRange<D>>;
    /** Event thrown every time the first or last date in multiple range mode is changed. */
    readonly selectedMultipleDateRangesChange: EventEmitter<Array<DateRange<D>>>;
    /** Event thrown every time calendar active view is changed */
    readonly activeViewChange: EventEmitter<FdCalendarView>;
    /** @hidden */
    _inputGroupElement: ElementRef;
    /** @hidden */
    _inputElement: ElementRef<HTMLInputElement>;
    /** @hidden */
    private readonly _controlTemplate;
    /** @hidden */
    private readonly _calendarTemplate;
    /** @hidden */
    private readonly _messagePopoverTemplate;
    /** @hideen */
    private readonly _calendars;
    /** Whether to display the calendar legend below the calendar. Default is false. */
    showCalendarLegend: i0.InputSignalWithTransform<boolean, unknown>;
    /** Whether the legend should display in column layout instead of row layout. Default is false. */
    legendCol: i0.InputSignalWithTransform<boolean, unknown>;
    /**
     *  The state of the form control - applies css classes.
     *  Also, this is applied to message.
     *  Can be `success`, `error`, `warning`, `information` or blank for default.
     */
    set state(state: Nullable<FormStates>);
    /** @hidden */
    get state(): FormStates;
    /** Whether the date picker is open. Can be used through two-way binding. */
    set isOpen(value: boolean);
    get isOpen(): boolean;
    /** @hidden */
    _calendarComponent: CalendarComponent<D>;
    /** @hidden */
    _message: string | null;
    /** @hidden */
    _messageTriggers: string[];
    /** @hidden The value of the input */
    _inputFieldDate: string | null;
    /** @hidden Whether the date input is invalid */
    _isInvalidDateInput: boolean;
    /** @hidden */
    _showPopoverContents: boolean;
    /** @hidden */
    readonly _formValueStateMessageId: string;
    /** @hidden */
    private _isOpen;
    /** @hidden */
    private _calendarPendingDate;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    private _state;
    /** @hidden */
    private readonly _injector;
    /** @hidden */
    private readonly _dynamicComponentService;
    /** @hidden */
    private readonly _focusTrapService;
    /** @hidden */
    private _mobileComponentRef;
    /** @hidden */
    get _rangeDelimiter(): string;
    /**
     * Date input aria label key based on type
     * @hidden
     */
    get _dateInputArialLabelKey(): FdLanguageKeyIdentifier;
    /** @hidden */
    constructor(_changeDetectionRef: ChangeDetectorRef, _dateTimeAdapter: DatetimeAdapter<D>, _dateTimeFormats: DateTimeFormats, _popoverFormMessage: PopoverFormMessageService);
    /**
     * Function used to disable certain dates in the calendar.
     */
    disableFunction: (value: D) => boolean;
    /**
     * Function used to disable certain dates in the calendar for the range start selection.
     */
    disableRangeStartFunction: (value: D) => boolean;
    /**
     * Function used to disable certain dates in the calendar for the range end selection.
     */
    disableRangeEndFunction: (value: D) => boolean;
    /** @hidden */
    onChange: (value: any) => void;
    /** @hidden */
    onTouched: any;
    /** @hidden */
    dialogApprove(): void;
    /** @hidden */
    dialogDismiss(prevValue: D | Array<D> | DateRange<D> | Array<DateRange<D>>): void;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(changes: SimpleChanges): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /**
     * Method that handle calendar active view change and throws event.
     */
    handleCalendarActiveViewChange(activeView: FdCalendarView): void;
    /** @hidden */
    closeFromCalendar(): void;
    /** Opens the calendar */
    openCalendar(): void;
    /** Toggles the calendar open or closed */
    toggleCalendar(): void;
    /** Closes the calendar if it is open */
    closeCalendar(): void;
    /**
     * @hidden
     * Method that is triggered by events from calendar component, when there is selected single date changed
     */
    handleSingleDateChange(date: D): void;
    /**
     * @hidden
     * Method that is triggered by events from the calendar component when the selected multiple dates change.
     */
    handleMultipleDatesChange(dates: Array<D>): void;
    /**
     * @hidden
     * Method that is triggered by events from calendar component, when there is selected range date changed
     */
    handleRangeDateChange(dates: DateRange<D>): void;
    /**
     * @hidden
     * Method that is triggered by events from the calendar component when the selected multiple range dates change.
     */
    handleMultipleDateRangesChange(dates: Array<DateRange<D>>): void;
    /**
     * @hidden
     * Method that is triggered date formatting in the date control
     */
    formatInputDate(date: Nullable<D>): void;
    /**
     * @hidden
     * Method that is triggered when Today-Selection-Button clicked, it changes selected date or date range to today's date
     */
    onTodayButtonClick(): void;
    /**
     * @hidden
     * Method that is triggered when the text input is confirmed to ba changed, by clicking enter, or blur
     */
    handleInputChange(strDate: string, isTypeEvent: boolean): void;
    /**
     * @hidden
     * Function that implements Validator Interface, adds validation support for forms
     */
    validate(): {
        [key: string]: any;
    } | null;
    /** @hidden */
    registerOnChange(fn: (selected: any) => {
        void: any;
    }): void;
    /** @hidden */
    registerOnTouched(fn: any): void;
    /** @hidden */
    setDisabledState(isDisabled: boolean): void;
    /**
     * @hidden
     * Function that provides support for ControlValueAccessor that allows to use [(ngModel)] or forms
     */
    writeValue(selected: D | Array<D> | DateRange<D> | Array<DateRange<D>> | null): void;
    /**
     * @hidden
     * Method, which is responsible for transforming string to date, depending on type or
     * validation the results are different. It also changes the state of _isInvalidDateInput
     */
    dateStringUpdate(dateStr: string): void;
    /** Method that provides information if model selected date/dates have properly types and are valid */
    isModelValid(): boolean;
    /** Returns current selected date. */
    getSelectedDate(): D | Array<D> | DateRange<D> | Array<DateRange<D>>;
    /** @hidden */
    _changeMessageVisibility(): void;
    /** @hidden */
    _onOpenStateChanged(isOpen: boolean): void;
    /**
     * Renders the calendar right before the popover is opened.
     * Used for correct calculations of overlay position and size.
     */
    _beforePopoverOpen(): void;
    /** @hidden */
    _onBlur(event: FocusEvent): void;
    /** Method that returns info if single model given is valid */
    private _isSingleModelValid;
    /** Method that returns info if multiple date model given is valid */
    private _isMultipleModelValid;
    /** Method that returns info if range date model given is valid */
    private _isRangeModelValid;
    /** Method that returns info if multiple range date model given is valid */
    private _isMultipleRangesModelValid;
    /** Method that returns info if end date model given is valid */
    private _isEndDateValid;
    /** Method that returns info if start date model given is valid */
    private _isStartDateValid;
    /** Method that returns info if given date model is valid */
    private _isDateValid;
    /** @hidden */
    private _refreshCurrentlyDisplayedCalendarDate;
    /** @hidden */
    private _formatDate;
    /** @hidden */
    private formatDateArray;
    /** @hidden */
    private _parseDate;
    /**
     * Helper method to parse a date string into an array of dates.
     * @param dateStr The date string to parse.
     * @returns An array of dates.
     */
    private parseDateString;
    /** @hidden */
    private _formatDateRange;
    /** @hidden */
    private _formatMultipleDateRanges;
    /** @hidden */
    private _InitialiseVariablesInMessageService;
    /** @hidden */
    private _setOpenState;
    /** @hidden */
    private _setUpMobileMode;
    /** @hidden */
    private _isDateRange;
    /** @hidden */
    private _isMultipleDateRanges;
    /**
     * @hidden
     * Updates the selected single date from a date string.
     * @param dateStr The date string to parse and update the selected date.
     */
    private _updateSingleDate;
    /**
     * @hidden
     * Updates the selected range date from a date string.
     * @param dateStr The date string to parse and update the selected range date.
     */
    private _updateRangeDate;
    /**
     * @hidden
     * Updates the selected multiple dates from a date string.
     * @param dateStr The date string to parse and update the selected multiple dates.
     */
    private updateMultipleDates;
    /** Helper method to compare two arrays of dates */
    private _areDatesEqual;
    /**
     * @hidden
     * Updates the selected multiple date ranges from a date string.
     * @param dateStr The date string to parse and update the selected multiple date ranges.
     */
    private _updateMultipleDateRanges;
    /** Helper method to compare two arrays of date ranges */
    private _areDateRangesEqual;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent<any>, [null, { optional: true; }, { optional: true; }, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent<any>, "fd-date-picker", never, { "type": { "alias": "type"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "required": { "alias": "required"; "required": false; }; "customDateTimeFormat": { "alias": "customDateTimeFormat"; "required": false; }; "message": { "alias": "message"; "required": false; }; "messageTriggers": { "alias": "messageTriggers"; "required": false; }; "selectedDate": { "alias": "selectedDate"; "required": false; }; "selectedMultipleDates": { "alias": "selectedMultipleDates"; "required": false; }; "selectedRangeDate": { "alias": "selectedRangeDate"; "required": false; }; "selectedMultipleDateRanges": { "alias": "selectedMultipleDateRanges"; "required": false; }; "startingDayOfWeek": { "alias": "startingDayOfWeek"; "required": false; }; "rangeHoverEffect": { "alias": "rangeHoverEffect"; "required": false; }; "useValidation": { "alias": "useValidation"; "required": false; }; "allowNull": { "alias": "allowNull"; "required": false; }; "activeView": { "alias": "activeView"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "closeOnDateChoose": { "alias": "closeOnDateChoose"; "required": false; }; "showTodayButton": { "alias": "showTodayButton"; "required": false; }; "todayButtonLabel": { "alias": "todayButtonLabel"; "required": false; }; "previousButtonDisableFunction": { "alias": "previousButtonDisableFunction"; "required": false; }; "nextButtonDisableFunction": { "alias": "nextButtonDisableFunction"; "required": false; }; "buttonFocusable": { "alias": "buttonFocusable"; "required": false; }; "specialDaysRules": { "alias": "specialDaysRules"; "required": false; }; "yearGrid": { "alias": "yearGrid"; "required": false; }; "aggregatedYearGrid": { "alias": "aggregatedYearGrid"; "required": false; }; "markWeekends": { "alias": "markWeekends"; "required": false; }; "showWeekNumbers": { "alias": "showWeekNumbers"; "required": false; }; "allowMultipleSelection": { "alias": "allowMultipleSelection"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "processInputOnBlur": { "alias": "processInputOnBlur"; "required": false; }; "preventScrollOnFocus": { "alias": "preventScrollOnFocus"; "required": false; }; "mobile": { "alias": "mobile"; "required": false; }; "mobileConfig": { "alias": "mobileConfig"; "required": false; }; "mobileLandscape": { "alias": "mobileLandscape"; "required": false; }; "mobilePortrait": { "alias": "mobilePortrait"; "required": false; }; "dateRangeFormat": { "alias": "dateRangeFormat"; "required": false; }; "showCalendarLegend": { "alias": "showCalendarLegend"; "required": false; "isSignal": true; }; "legendCol": { "alias": "legendCol"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "disableFunction": { "alias": "disableFunction"; "required": false; }; "disableRangeStartFunction": { "alias": "disableRangeStartFunction"; "required": false; }; "disableRangeEndFunction": { "alias": "disableRangeEndFunction"; "required": false; }; }, { "isOpenChange": "isOpenChange"; "selectedDateChange": "selectedDateChange"; "selectedMultipleDatesChange": "selectedMultipleDatesChange"; "selectedRangeDateChange": "selectedRangeDateChange"; "selectedMultipleDateRangesChange": "selectedMultipleDateRangesChange"; "activeViewChange": "activeViewChange"; }, never, ["*"], true, never>;
    static ngAcceptInputType_processInputOnBlur: unknown;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class DatePickerModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<DatePickerModule, never, [typeof DatePickerComponent, typeof DatePickerMobileComponent], [typeof DatePickerComponent, typeof DatePickerMobileComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<DatePickerModule>;
}

export { DatePickerComponent, DatePickerMobileComponent, DatePickerModule };
export type { DatePicker };
