/** * Copyright Aquera Inc 2023 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ import { CSSResultArray, TemplateResult } from 'lit'; import NileElement from '../internal/nile-element'; import { ClearMode } from './nile-calendar.enum'; import type { PropertyValueMap } from 'lit'; type NileCalendarDateRange = { startDate: string; endDate: string; }; type TimeUnits = 'minutes' | 'hours' | 'days' | 'weeks' | 'months'; /** * Nile icon component. * * @tag nile-calendar * */ export declare class NileCalendar extends NileElement { /** * The styles for NileCalendar * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]` */ static get styles(): CSSResultArray; valueAttribute: string | null; allowedDates: string; range: boolean; hideTypes: boolean; doubleClickUnselect: boolean; allowClear: boolean; type: 'absolute' | 'relative'; selectedUnit: TimeUnits; selectedValue: number; hideDurationFields: String[]; showManualInputs: boolean; startYear: number; endYear: number; showMonthDropdown: boolean; showYearDropdown: boolean; dateFormat: string; startDate: Date | null; endDate: Date | null; isSelectingStart: boolean; hideInput: Boolean; value: Date | null; currentMonth: number; currentYear: number; allowedDatesLocal: NileCalendarDateRange | any; disabled: boolean; connectedCallback(): void; disconnectedCallback(): void; protected updated(changedProperties: PropertyValueMap | Map): void; private get monthNames(); private get yearOptions(); private onMonthSelected; private onYearSelected; checkValidAllowedDate(): void; private isPrevDisabled; private isNextDisabled; private formatDate; private parseDate; private handleStartDateInput; private handleEndDateInput; /** * Render method */ render(): TemplateResult; /** * @returns HTML content for absolute calendar */ renderAbsoluteCalendar(): TemplateResult<1>; /** * @returns HTML content for relative calendar */ renderRelativeCalendar(): TemplateResult<1>; /** * * @param unit * @param values * @returns html for the option */ renderTimeValues(unit: TimeUnits, values: any[]): TemplateResult<1>[]; /** * * @param year * @param month * @param daysArray * @returns HTML for rendered month */ private renderMonth; /** * Function to validate if date is not in allowedDates range * @param day * @param month * @param year * @returns */ isAllowedDate(day: number, month: number, year: number): boolean; clearDate(mode?: ClearMode): void; /** * @function handle_date-click/select * @param day * @param month * @param year */ selectDate(day: number, month: number, year: number): void; /** * Function to be called on initialization to set all other properties */ initializeValue(): void; /** * Function to handle relative date selection */ handleDurationChange(event: CustomEvent): void; handleUnitChange(event: CustomEvent): void; handleTimeValueClick(unit: TimeUnits, value: number, event: any): void; createRelativePeriod(unit: String, value: number): { startDate: Date; endDate: Date; }; /** * Function to handle start time selecion */ private handleStartTimeInput; /** * Function to handle end time selecion */ private handleEndTimeInput; private parseTime; private isValidTimeInput; private formatTime; private nextMonth; private prevMonth; private confimRange; onTypeChange(event: CustomEvent): void; getUTCDate(dateStr: any): Date; emitChangedData(data: { startDate: Date; endDate: Date; } | { value: any; } | null): void; private getDaysArray; } export default NileCalendar; declare global { interface HTMLElementTagNameMap { 'nile-calendar': NileCalendar; } }