jb-calendar
Version:
jalali calendar interface web component
59 lines (56 loc) • 1.64 kB
text/typescript
import type {EventTypeWithTarget} from 'jb-core';
import type { JBCalendarWebComponent } from './jb-calendar';
export type JBCalendarSections = "DAY" | "MONTH" | "YEAR";
export type JBCalendarValue = {
day: number | null;
month: number | null;
year: number | null;
}
export type JBCalendarElements = {
selectionSections: {
day: HTMLDivElement;
month: HTMLDivElement;
year: HTMLDivElement;
},
monthDayWrapper: {
current: HTMLDivElement;
prev: HTMLDivElement;
next: HTMLDivElement;
},
yearsWrapper: {
current: HTMLDivElement;
prev: HTMLDivElement;
next: HTMLDivElement;
},
dayOfWeekWrapper: HTMLDivElement;
navigatorTitle: {
wrapper: HTMLDivElement;
month: HTMLSpanElement;
year: HTMLSpanElement;
yearRange: HTMLSpanElement;
nextButton: HTMLDivElement;
prevButton: HTMLDivElement;
},
swipeupSymbol:HTMLDivElement;
}
export type JBCalendarDateRestrictions = {
min: Date | null;
max: Date | null;
};
export type JBCalendarData = {
selectedYear: number;
selectedMonth: number;
yearSelectionRange: [number, number];
};
export type JBCalendarSwipeGestureData = {
daysWrapper: {
startX: number | null,
startY: number | null,
},
yearsWrapper: {
startX: number | null,
}
}
export type Direction = "rtl" | "ltr" ;
export type InputType = 'JALALI' | 'GREGORIAN';
export type JBCalendarEventType<TEvent> = EventTypeWithTarget<TEvent,JBCalendarWebComponent>;