import { IkasThemeDatePicker } from "../../../storefront-models/src"; /** * Initializes a theme date picker with a value, min/max bounds, and optional time display. * * @ai-category DatePicker, UI * @ai-related themeDatePickerOnChange, themeDatePickerOnDayChange, themeDatePickerGetDate * * @param dataPicker - The date picker instance to initialize. * @param options - Configuration options for initialization. * @param options.value - The initial date value. Defaults to the current date. * @param options.minValue - The minimum selectable date. Defaults to 1900-01-01. * @param options.maxValue - The maximum selectable date. Defaults to 9999-12-31. * @param options.showTime - Whether to display time selection controls. * @returns void * * @example * ```typescript * import { initThemeDatePicker } from "@ikas/bp-storefront"; * initThemeDatePicker(datePicker, { * value: new Date(), * minValue: new Date(2020, 0, 1), * maxValue: new Date(2030, 11, 31), * showTime: true, * }); * ``` */ export declare function initThemeDatePicker(dataPicker: IkasThemeDatePicker, options: { value?: Date; minValue?: Date; maxValue?: Date; showTime?: boolean; }): void; /** * Handles a date change on the date picker, clamping the value within the configured min/max bounds. * * @ai-category DatePicker, Calendar * @ai-related initThemeDatePicker, themeDatePickerOnDayChange, themeDatePickerOnHoursChange, themeDatePickerOnMinutesChange * * @param dataPicker - The date picker instance to update. * @param value - The new date value to set. * @returns The clamped date value that was actually applied. * * @example * ```typescript * import { themeDatePickerOnChange } from "@ikas/bp-storefront"; * const appliedDate = themeDatePickerOnChange(datePicker, new Date(2024, 5, 15)); * ``` */ export declare function themeDatePickerOnChange(dataPicker: IkasThemeDatePicker, value: Date): Date; /** * Updates the view year of the date picker, validating the year is between 1900 and 9999. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerOnViewMonthChange, themeDatePickerGetViewFullYear, themeDatePickerSetViewPrevMonth, themeDatePickerSetViewNextMonth * * @param dataPicker - The date picker instance to update. * @param value - The new year as a string. Must parse to a number between 1900 and 9999. * @returns The updated view date with the new year applied. * * @example * ```typescript * import { themeDatePickerOnViewFullYearChange } from "@ikas/bp-storefront"; * const updatedView = themeDatePickerOnViewFullYearChange(datePicker, "2025"); * ``` */ export declare function themeDatePickerOnViewFullYearChange(dataPicker: IkasThemeDatePicker, value?: string): Date; /** * Updates the view month of the date picker, validating the month index is between 0 and 11. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerOnViewFullYearChange, themeDatePickerGetViewMonth, themeDatePickerSetViewPrevMonth, themeDatePickerSetViewNextMonth * * @param dataPicker - The date picker instance to update. * @param value - The new month index as a string (0 = January, 11 = December). * @returns The updated view date with the new month applied. * * @example * ```typescript * import { themeDatePickerOnViewMonthChange } from "@ikas/bp-storefront"; * const updatedView = themeDatePickerOnViewMonthChange(datePicker, "3"); // April * ``` */ export declare function themeDatePickerOnViewMonthChange(dataPicker: IkasThemeDatePicker, value?: string): Date; /** * Handles a day selection change on the date picker, preserving the current time and enforcing min/max bounds when time mode is enabled. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerOnChange, themeDatePickerOnHoursChange, themeDatePickerOnMinutesChange, themeDatePickerGetDaysOfMonth * * @param dataPicker - The date picker instance to update. * @param date - The day of the month (1-31). * @param month - The month index (0-11). * @param fullYear - The full year (e.g., 2024). * @returns The updated date value after applying the day change. * * @example * ```typescript * import { themeDatePickerOnDayChange } from "@ikas/bp-storefront"; * const newDate = themeDatePickerOnDayChange(datePicker, 15, 5, 2024); // June 15, 2024 * ``` */ export declare function themeDatePickerOnDayChange(dataPicker: IkasThemeDatePicker, date: number, month: number, fullYear: number): Date; /** * Updates the hours component of the date picker value, validating against the 0-23 range and min/max bounds. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerOnMinutesChange, themeDatePickerOnChange, themeDatePickerGetHours * * @param dataPicker - The date picker instance to update. * @param value - The new hours value as a string (0-23). * @returns The updated date value with the new hours applied. * * @example * ```typescript * import { themeDatePickerOnHoursChange } from "@ikas/bp-storefront"; * const updatedDate = themeDatePickerOnHoursChange(datePicker, "14"); // 2 PM * ``` */ export declare function themeDatePickerOnHoursChange(dataPicker: IkasThemeDatePicker, value?: string): Date; /** * Updates the minutes component of the date picker value, validating against the 0-59 range and min/max bounds. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerOnHoursChange, themeDatePickerOnChange, themeDatePickerGetMinutes * * @param dataPicker - The date picker instance to update. * @param value - The new minutes value as a string (0-59). * @returns The updated date value with the new minutes applied. * * @example * ```typescript * import { themeDatePickerOnMinutesChange } from "@ikas/bp-storefront"; * const updatedDate = themeDatePickerOnMinutesChange(datePicker, "30"); * ``` */ export declare function themeDatePickerOnMinutesChange(dataPicker: IkasThemeDatePicker, value?: string): Date; /** * Navigates the date picker view to the previous month. * * @ai-category DatePicker, Calendar, UI * @ai-related themeDatePickerSetViewNextMonth, themeDatePickerOnViewMonthChange, themeDatePickerOnViewFullYearChange * * @param dataPicker - The date picker instance to update. * @returns The updated view date set to the previous month. * * @example * ```typescript * import { themeDatePickerSetViewPrevMonth } from "@ikas/bp-storefront"; * const prevMonthView = themeDatePickerSetViewPrevMonth(datePicker); * ``` */ export declare function themeDatePickerSetViewPrevMonth(dataPicker: IkasThemeDatePicker): Date; /** * Navigates the date picker view to the next month. * * @ai-category DatePicker, Calendar, UI * @ai-related themeDatePickerSetViewPrevMonth, themeDatePickerOnViewMonthChange, themeDatePickerOnViewFullYearChange * * @param dataPicker - The date picker instance to update. * @returns The updated view date set to the next month. * * @example * ```typescript * import { themeDatePickerSetViewNextMonth } from "@ikas/bp-storefront"; * const nextMonthView = themeDatePickerSetViewNextMonth(datePicker); * ``` */ export declare function themeDatePickerSetViewNextMonth(dataPicker: IkasThemeDatePicker): Date; /** * Returns the day of the month from the date picker's current value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetMonth, themeDatePickerGetFullYear, themeDatePickerOnDayChange * * @param dataPicker - The date picker instance to read from. * @returns The day of the month (1-31), or 0 if no value is set. * * @example * ```typescript * import { themeDatePickerGetDate } from "@ikas/bp-storefront"; * const dayOfMonth = themeDatePickerGetDate(datePicker); // e.g., 15 * ``` */ export declare function themeDatePickerGetDate(dataPicker: IkasThemeDatePicker): number; /** * Returns the month index from the date picker's current value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetDate, themeDatePickerGetFullYear, themeDatePickerGetMonthName, themeDatePickerGetViewMonth * * @param dataPicker - The date picker instance to read from. * @returns The month index (0 = January, 11 = December), or 0 if no value is set. * * @example * ```typescript * import { themeDatePickerGetMonth } from "@ikas/bp-storefront"; * const monthIndex = themeDatePickerGetMonth(datePicker); // e.g., 5 for June * ``` */ export declare function themeDatePickerGetMonth(dataPicker: IkasThemeDatePicker): number; /** * Returns the month index from the date picker's current view (navigation) value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetMonth, themeDatePickerGetViewFullYear, themeDatePickerOnViewMonthChange * * @param dataPicker - The date picker instance to read from. * @returns The view month index (0 = January, 11 = December), or 0 if no view value is set. * * @example * ```typescript * import { themeDatePickerGetViewMonth } from "@ikas/bp-storefront"; * const viewMonthIndex = themeDatePickerGetViewMonth(datePicker); * ``` */ export declare function themeDatePickerGetViewMonth(dataPicker: IkasThemeDatePicker): number; /** * Returns the localized full month name for the date picker's current value. * * @ai-category DatePicker, Calendar, UI * @ai-related themeDatePickerGetMonth, themeDatePickerGetMonthList, themeDatePickerGetViewMonth * * @param dataPicker - The date picker instance to read from. * @returns The localized month name (e.g., "January", "Ocak") based on the storefront locale. * * @example * ```typescript * import { themeDatePickerGetMonthName } from "@ikas/bp-storefront"; * const monthName = themeDatePickerGetMonthName(datePicker); // e.g., "June" * ``` */ export declare function themeDatePickerGetMonthName(dataPicker: IkasThemeDatePicker): string; /** * Returns a list of all 12 months with localized labels, values, and selection state for populating a month selector dropdown. * * @ai-category DatePicker, Calendar, UI * @ai-related themeDatePickerGetMonthName, themeDatePickerOnViewMonthChange, themeDatePickerGetViewMonth * * @param dataPicker - The date picker instance to read from. * @returns An array of 12 month items, each with a localized label, string value (index), selected flag, and disabled flag. * * @example * ```typescript * import { themeDatePickerGetMonthList } from "@ikas/bp-storefront"; * const months = themeDatePickerGetMonthList(datePicker); * // [{ label: "January", value: "0", selected: false, disabled: false }, ...] * ``` */ export declare function themeDatePickerGetMonthList(dataPicker: IkasThemeDatePicker): IkasThemeDatePickerMonthListItem[]; /** * Returns the localized short names of the days of the week, ordered by the locale's first day of the week. * * @ai-category DatePicker, Calendar, UI * @ai-related themeDatePickerGetDaysOfMonth, themeDatePickerGetWeekFirstDay * * @returns An array of 7 short weekday names (e.g., ["Mon", "Tue", ...]) ordered starting from the locale's first day. * * @example * ```typescript * import { themeDatePickerGetDaysOfWeekShort } from "@ikas/bp-storefront"; * const weekdays = themeDatePickerGetDaysOfWeekShort(); // ["Mon", "Tue", "Wed", ...] * ``` */ export declare function themeDatePickerGetDaysOfWeekShort(): string[]; /** * Returns the full year from the date picker's current value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetDate, themeDatePickerGetMonth, themeDatePickerGetViewFullYear * * @param dataPicker - The date picker instance to read from. * @returns The full year (e.g., 2024), or 0 if no value is set. * * @example * ```typescript * import { themeDatePickerGetFullYear } from "@ikas/bp-storefront"; * const year = themeDatePickerGetFullYear(datePicker); // e.g., 2024 * ``` */ export declare function themeDatePickerGetFullYear(dataPicker: IkasThemeDatePicker): number; /** * Returns the full year from the date picker's current view (navigation) value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetFullYear, themeDatePickerGetViewMonth, themeDatePickerOnViewFullYearChange * * @param dataPicker - The date picker instance to read from. * @returns The view full year (e.g., 2024), or 0 if no view value is set. * * @example * ```typescript * import { themeDatePickerGetViewFullYear } from "@ikas/bp-storefront"; * const viewYear = themeDatePickerGetViewFullYear(datePicker); * ``` */ export declare function themeDatePickerGetViewFullYear(dataPicker: IkasThemeDatePicker): number; /** * Returns the hours component from the date picker's current value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetMinutes, themeDatePickerOnHoursChange * * @param dataPicker - The date picker instance to read from. * @returns The hours (0-23), or 0 if no value is set. * * @example * ```typescript * import { themeDatePickerGetHours } from "@ikas/bp-storefront"; * const hours = themeDatePickerGetHours(datePicker); // e.g., 14 * ``` */ export declare function themeDatePickerGetHours(dataPicker: IkasThemeDatePicker): number; /** * Returns the minutes component from the date picker's current value. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetHours, themeDatePickerOnMinutesChange * * @param dataPicker - The date picker instance to read from. * @returns The minutes (0-59), or 0 if no value is set. * * @example * ```typescript * import { themeDatePickerGetMinutes } from "@ikas/bp-storefront"; * const minutes = themeDatePickerGetMinutes(datePicker); // e.g., 30 * ``` */ export declare function themeDatePickerGetMinutes(dataPicker: IkasThemeDatePicker): number; /** * Generates a 42-cell calendar grid (6 weeks) for the current view month, including overflow days from adjacent months, with selection and disabled states. * * @ai-category DatePicker, Calendar, UI * @ai-related themeDatePickerOnDayChange, themeDatePickerGetDaysOfWeekShort, themeDatePickerGetWeekFirstDay, themeDatePickerGetViewMonth, themeDatePickerGetViewFullYear * * @param dataPicker - The date picker instance to read from. * @returns An array of 42 day objects, each containing date, month, fullYear, selected state, inCurrentMonth flag, and disabled state. Returns an empty array if no view value is set. * * @example * ```typescript * import { themeDatePickerGetDaysOfMonth } from "@ikas/bp-storefront"; * const days = themeDatePickerGetDaysOfMonth(datePicker); * days.forEach((day) => { * if (day.inCurrentMonth && !day.disabled) { * console.log(`Day ${day.date} - selected: ${day.selected}`); * } * }); * ``` */ export declare function themeDatePickerGetDaysOfMonth(dataPicker: IkasThemeDatePicker): IkasThemeDatePickerDayOfMonth[]; /** * Determines the first day of the week based on the current storefront locale using Intl.Locale weekInfo. * * @ai-category DatePicker, Calendar * @ai-related themeDatePickerGetDaysOfWeekShort, themeDatePickerGetDaysOfMonth * * @returns The first day of the week as a number (e.g., 1 for Monday, 7 for Sunday). Defaults to 1 (Monday) if locale data is unavailable. * * @example * ```typescript * import { themeDatePickerGetWeekFirstDay } from "@ikas/bp-storefront"; * const firstDay = themeDatePickerGetWeekFirstDay(); // 1 for Monday-first locales * ``` */ export declare function themeDatePickerGetWeekFirstDay(): number; type IkasThemeDatePickerMonthListItem = { label: string; value: string; selected: boolean; disabled: boolean; }; type IkasThemeDatePickerDayOfMonth = { date: number; month: number; fullYear: number; selected: boolean; inCurrentMonth: boolean; disabled: boolean; }; export {};