v-calendar-3 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +142 -0
  3. package/dist/cjs/index.css +1133 -0
  4. package/dist/cjs/index.js +10699 -0
  5. package/dist/cjs/index.js.map +1 -0
  6. package/dist/cjs/package.json +1 -0
  7. package/dist/es/index.js +10678 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/style.css +1134 -0
  10. package/dist/iife/index.js +2 -0
  11. package/dist/iife/index.js.map +1 -0
  12. package/dist/mjs/index.mjs +10678 -0
  13. package/dist/mjs/index.mjs.map +1 -0
  14. package/dist/mjs/style.css +1134 -0
  15. package/dist/style.css +1134 -0
  16. package/dist/types/components/BaseIcon/BaseIcon.vue.d.ts +41 -0
  17. package/dist/types/components/BaseIcon/icons/IconChevronDown.vue.d.ts +3 -0
  18. package/dist/types/components/BaseIcon/icons/IconChevronLeft.vue.d.ts +3 -0
  19. package/dist/types/components/BaseIcon/icons/IconChevronRight.vue.d.ts +3 -0
  20. package/dist/types/components/BaseIcon/icons/IconClock.vue.d.ts +3 -0
  21. package/dist/types/components/BaseIcon/icons/index.d.ts +4 -0
  22. package/dist/types/components/BaseSelect/BaseSelect.vue.d.ts +26 -0
  23. package/dist/types/components/Calendar/Calendar.vue.d.ts +2526 -0
  24. package/dist/types/components/Calendar/CalendarDay.vue.d.ts +83 -0
  25. package/dist/types/components/Calendar/CalendarDayPopover.vue.d.ts +3 -0
  26. package/dist/types/components/Calendar/CalendarHeader.vue.d.ts +13 -0
  27. package/dist/types/components/Calendar/CalendarNav.vue.d.ts +4 -0
  28. package/dist/types/components/Calendar/CalendarNavPopover.vue.d.ts +3 -0
  29. package/dist/types/components/Calendar/CalendarPage.vue.d.ts +3 -0
  30. package/dist/types/components/Calendar/CalendarPageProvider.vue.d.ts +17 -0
  31. package/dist/types/components/Calendar/CalendarSlot.vue.d.ts +15 -0
  32. package/dist/types/components/Calendar/CalendarTitleSelect.vue.d.ts +15 -0
  33. package/dist/types/components/CalendarGrid/CalendarCell.vue.d.ts +9 -0
  34. package/dist/types/components/CalendarGrid/CalendarCellPopover.vue.d.ts +209 -0
  35. package/dist/types/components/CalendarGrid/CalendarDayCell.vue.d.ts +8 -0
  36. package/dist/types/components/CalendarGrid/CalendarEventDetails.vue.d.ts +15 -0
  37. package/dist/types/components/CalendarGrid/CalendarEventEdit.vue.d.ts +26 -0
  38. package/dist/types/components/CalendarGrid/CalendarGrid.vue.d.ts +134 -0
  39. package/dist/types/components/CalendarGrid/CalendarGridWeek.vue.d.ts +8 -0
  40. package/dist/types/components/CalendarGrid/CalendarViewSelect.vue.d.ts +3 -0
  41. package/dist/types/components/CalendarGrid/CalendarWeekCell.vue.d.ts +10 -0
  42. package/dist/types/components/CalendarGrid/Constraints.d.ts +16 -0
  43. package/dist/types/components/DatePicker/DatePicker.vue.d.ts +15251 -0
  44. package/dist/types/components/DatePicker/DatePickerBase.vue.d.ts +3 -0
  45. package/dist/types/components/DatePicker/DatePickerPopover.vue.d.ts +3 -0
  46. package/dist/types/components/DatePicker/TimePicker.vue.d.ts +10089 -0
  47. package/dist/types/components/Popover/Popover.vue.d.ts +72 -0
  48. package/dist/types/components/Popover/PopoverRow.vue.d.ts +17 -0
  49. package/dist/types/components/index.d.ts +4 -0
  50. package/dist/types/index.d.cts +40981 -0
  51. package/dist/types/index.d.mts +40981 -0
  52. package/dist/types/index.d.ts +40981 -0
  53. package/dist/types/use/base.d.ts +67 -0
  54. package/dist/types/use/calendar.d.ts +2422 -0
  55. package/dist/types/use/calendarGrid.d.ts +9370 -0
  56. package/dist/types/use/datePicker.d.ts +20210 -0
  57. package/dist/types/use/page.d.ts +20 -0
  58. package/dist/types/use/slots.d.ts +5 -0
  59. package/dist/types/use/timePicker.d.ts +10089 -0
  60. package/dist/types/utils/attribute.d.ts +49 -0
  61. package/dist/types/utils/cache.d.ts +10 -0
  62. package/dist/types/utils/calendar/event.d.ts +111 -0
  63. package/dist/types/utils/config/index.d.ts +5 -0
  64. package/dist/types/utils/date/helpers.d.ts +161 -0
  65. package/dist/types/utils/date/range.d.ts +74 -0
  66. package/dist/types/utils/date/repeat.d.ts +34 -0
  67. package/dist/types/utils/date/rules.d.ts +82 -0
  68. package/dist/types/utils/defaults/index.d.ts +30 -0
  69. package/dist/types/utils/defaults/locales.d.ts +9 -0
  70. package/dist/types/utils/glyph.d.ts +58 -0
  71. package/dist/types/utils/helpers.d.ts +49 -0
  72. package/dist/types/utils/locale.d.ts +48 -0
  73. package/dist/types/utils/page.d.ts +95 -0
  74. package/dist/types/utils/plugins/index.d.ts +4 -0
  75. package/dist/types/utils/popovers.d.ts +47 -0
  76. package/dist/types/utils/theme.d.ts +17 -0
  77. package/dist/types/utils/touch.d.ts +8 -0
  78. package/dist/types/utils/useDisplayMode.d.ts +12 -0
  79. package/dist/types/utils/watchers.d.ts +6 -0
  80. package/package.json +115 -0
  81. package/src/components/BaseIcon/BaseIcon.vue +29 -0
  82. package/src/components/BaseIcon/icons/IconChevronDown.vue +5 -0
  83. package/src/components/BaseIcon/icons/IconChevronLeft.vue +5 -0
  84. package/src/components/BaseIcon/icons/IconChevronRight.vue +5 -0
  85. package/src/components/BaseIcon/icons/IconClock.vue +11 -0
  86. package/src/components/BaseIcon/icons/index.ts +4 -0
  87. package/src/components/BaseSelect/BaseSelect.vue +136 -0
  88. package/src/components/Calendar/Calendar.vue +116 -0
  89. package/src/components/Calendar/CalendarDay.vue +422 -0
  90. package/src/components/Calendar/CalendarDayPopover.vue +44 -0
  91. package/src/components/Calendar/CalendarHeader.vue +203 -0
  92. package/src/components/Calendar/CalendarNav.vue +325 -0
  93. package/src/components/Calendar/CalendarNavPopover.vue +24 -0
  94. package/src/components/Calendar/CalendarPage.vue +140 -0
  95. package/src/components/Calendar/CalendarPageProvider.vue +15 -0
  96. package/src/components/Calendar/CalendarSlot.vue +36 -0
  97. package/src/components/Calendar/CalendarTitleSelect.vue +72 -0
  98. package/src/components/CalendarGrid/CalendarCell.vue +112 -0
  99. package/src/components/CalendarGrid/CalendarCellPopover.vue +93 -0
  100. package/src/components/CalendarGrid/CalendarDayCell.vue +57 -0
  101. package/src/components/CalendarGrid/CalendarEventDetails.vue +71 -0
  102. package/src/components/CalendarGrid/CalendarEventEdit.vue +195 -0
  103. package/src/components/CalendarGrid/CalendarGrid.vue +715 -0
  104. package/src/components/CalendarGrid/CalendarGridWeek.vue +60 -0
  105. package/src/components/CalendarGrid/CalendarViewSelect.vue +34 -0
  106. package/src/components/CalendarGrid/CalendarWeekCell.vue +52 -0
  107. package/src/components/CalendarGrid/Constraints.ts +40 -0
  108. package/src/components/DatePicker/DatePicker.vue +27 -0
  109. package/src/components/DatePicker/DatePickerBase.vue +53 -0
  110. package/src/components/DatePicker/DatePickerPopover.vue +37 -0
  111. package/src/components/DatePicker/TimePicker.vue +167 -0
  112. package/src/components/Popover/Popover.vue +572 -0
  113. package/src/components/Popover/PopoverRow.vue +94 -0
  114. package/src/components/index.ts +4 -0
  115. package/src/index.ts +24 -0
  116. package/src/styles/index.css +48 -0
  117. package/src/styles/theme.css +322 -0
  118. package/src/styles/transitions.css +77 -0
  119. package/src/use/base.ts +144 -0
  120. package/src/use/calendar.ts +796 -0
  121. package/src/use/calendarGrid.ts +954 -0
  122. package/src/use/datePicker.ts +909 -0
  123. package/src/use/page.ts +78 -0
  124. package/src/use/slots.ts +17 -0
  125. package/src/use/timePicker.ts +194 -0
  126. package/src/utils/attribute.ts +107 -0
  127. package/src/utils/cache.ts +30 -0
  128. package/src/utils/calendar/event.ts +335 -0
  129. package/src/utils/config/index.ts +11 -0
  130. package/src/utils/date/helpers.ts +1039 -0
  131. package/src/utils/date/range.ts +274 -0
  132. package/src/utils/date/repeat.ts +135 -0
  133. package/src/utils/date/rules.ts +290 -0
  134. package/src/utils/defaults/index.ts +77 -0
  135. package/src/utils/defaults/locales.ts +123 -0
  136. package/src/utils/defaults/masks.json +15 -0
  137. package/src/utils/defaults/touch.json +5 -0
  138. package/src/utils/glyph.ts +305 -0
  139. package/src/utils/helpers.ts +181 -0
  140. package/src/utils/locale.ts +275 -0
  141. package/src/utils/page.ts +608 -0
  142. package/src/utils/plugins/index.ts +24 -0
  143. package/src/utils/popovers.ts +216 -0
  144. package/src/utils/theme.ts +58 -0
  145. package/src/utils/touch.ts +72 -0
  146. package/src/utils/useDisplayMode.ts +198 -0
  147. package/src/utils/watchers.ts +26 -0
@@ -0,0 +1,49 @@
1
+ import type { Placement } from '@popperjs/core';
2
+ import { DateRange, type DateRangeSource } from './date/range';
3
+ import { Bar, BarConfig, Content, ContentConfig, Dot, DotConfig, Highlight, HighlightConfig, Profile } from './glyph';
4
+ import Locale from './locale';
5
+ import type { PopoverVisibility } from './popovers';
6
+ import { Theme } from './theme';
7
+ export type PopoverConfig = Partial<{
8
+ label: string;
9
+ visibility: PopoverVisibility;
10
+ placement: Placement;
11
+ hideIndicator: boolean;
12
+ isInteractive: boolean;
13
+ }>;
14
+ export type EventConfig = Partial<{
15
+ label: string;
16
+ }>;
17
+ export type AttributeConfig = Partial<{
18
+ key: string | number;
19
+ hashcode: string;
20
+ content: ContentConfig;
21
+ highlight: HighlightConfig;
22
+ dot: DotConfig;
23
+ bar: BarConfig;
24
+ popover: PopoverConfig;
25
+ event: EventConfig;
26
+ dates: DateRangeSource[];
27
+ customData: any;
28
+ order: number;
29
+ pinPage: boolean;
30
+ }>;
31
+ export declare class Attribute {
32
+ key: string | number;
33
+ hashcode: string;
34
+ highlight: Profile<Highlight> | null;
35
+ content: Profile<Content> | null;
36
+ dot: Profile<Dot> | null;
37
+ bar: Profile<Bar> | null;
38
+ event: EventConfig | null;
39
+ popover: PopoverConfig | null;
40
+ customData: any;
41
+ ranges: DateRange[];
42
+ hasRanges: boolean;
43
+ order: number;
44
+ pinPage: boolean;
45
+ maxRepeatSpan: number;
46
+ locale: Locale;
47
+ constructor(config: Partial<AttributeConfig>, theme: Theme, locale: Locale);
48
+ intersectsRange({ start, end }: DateRange): boolean;
49
+ }
@@ -0,0 +1,10 @@
1
+ export default class Cache<T> {
2
+ size: number;
3
+ createKey: (...args: any[]) => string;
4
+ createItem: (...args: any[]) => T;
5
+ keys: string[];
6
+ store: Record<string, T>;
7
+ constructor(size: number, createKey: (...args: any[]) => string, createItem: (...args: any[]) => T);
8
+ get(...args: any[]): T;
9
+ getOrSet(...args: any[]): T;
10
+ }
@@ -0,0 +1,111 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import type { DragOffset, ResizeOffset } from '../../use/calendarGrid';
3
+ import { DateRange } from '../date/range';
4
+ import Locale from '../locale';
5
+ import type { CalendarDay } from '../page';
6
+ import type { PopoverOptions } from '../popovers';
7
+ export interface ResizeOrigin {
8
+ start: Date;
9
+ end: Date;
10
+ isStart: boolean;
11
+ }
12
+ export interface DragOrigin {
13
+ day: CalendarDay;
14
+ start: Date;
15
+ end: Date;
16
+ minOffsetWeeks: number;
17
+ maxOffsetWeeks: number;
18
+ minOffsetWeekdays: number;
19
+ maxOffsetWeekdays: number;
20
+ minOffsetMs: number;
21
+ maxOffsetMs: number;
22
+ durationMs: number;
23
+ }
24
+ export interface EventConfig {
25
+ key: PropertyKey;
26
+ summary: string;
27
+ description: string;
28
+ start: Date;
29
+ end: Date;
30
+ range: DateRange;
31
+ allDay: boolean;
32
+ color: string;
33
+ selected: boolean;
34
+ }
35
+ export interface EventState {
36
+ key: any;
37
+ summary: string;
38
+ description: string;
39
+ range: DateRange;
40
+ allDay: boolean;
41
+ color: string;
42
+ fill: string;
43
+ selected: boolean;
44
+ draggable: boolean;
45
+ dragging: boolean;
46
+ resizable: boolean;
47
+ resizing: boolean;
48
+ editing: boolean;
49
+ order: number;
50
+ snapMinutes: number;
51
+ minDurationMinutes: number;
52
+ maxDurationMinutes: number;
53
+ popover: Partial<PopoverOptions> | null;
54
+ resizeOrigin: ResizeOrigin | null;
55
+ dragOrigin: DragOrigin | null;
56
+ }
57
+ export interface EventContext {
58
+ days: ComputedRef<CalendarDay[]>;
59
+ dayRows: ComputedRef<number>;
60
+ dayColumns: ComputedRef<number>;
61
+ isDaily: ComputedRef<boolean>;
62
+ isMonthly: ComputedRef<boolean>;
63
+ locale: ComputedRef<Locale>;
64
+ }
65
+ export type Event = ReturnType<typeof createEvent>;
66
+ export declare function createEvent(config: Partial<EventConfig>, ctx: EventContext): {
67
+ refSelector: string;
68
+ isMultiDay: boolean;
69
+ isWeekly: boolean;
70
+ durationMs: number;
71
+ durationMinutes: number;
72
+ startDate: Date;
73
+ startDateTime: number;
74
+ startTimeLabel: string;
75
+ endDate: Date;
76
+ endDateTime: number;
77
+ endTimeLabel: string;
78
+ timeLabel: string;
79
+ isSolid: boolean;
80
+ dragIsDirty: boolean;
81
+ formatDate: (date: Date, mask: string) => string;
82
+ formatTime: (date: Date) => string;
83
+ resizeToConstraints: () => void;
84
+ startResize: (day: CalendarDay, isStart: boolean) => void;
85
+ updateResize: (offset: ResizeOffset) => void;
86
+ stopResize: () => void;
87
+ startDrag: (day: CalendarDay) => void;
88
+ updateDrag: (offset: DragOffset) => void;
89
+ stopDrag: () => false | undefined;
90
+ compareTo: (b: Event) => number;
91
+ key: any;
92
+ summary: string;
93
+ description: string;
94
+ range: DateRange;
95
+ allDay: boolean;
96
+ color: string;
97
+ fill: string;
98
+ selected: boolean;
99
+ draggable: boolean;
100
+ dragging: boolean;
101
+ resizable: boolean;
102
+ resizing: boolean;
103
+ editing: boolean;
104
+ order: number;
105
+ snapMinutes: number;
106
+ minDurationMinutes: number;
107
+ maxDurationMinutes: number;
108
+ popover: Partial<PopoverOptions> | null;
109
+ resizeOrigin: ResizeOrigin | null;
110
+ dragOrigin: DragOrigin | null;
111
+ };
@@ -0,0 +1,5 @@
1
+ import type { App as Application } from 'vue';
2
+ declare const config: {};
3
+ export { config as default };
4
+ export declare let VueInstance: Application;
5
+ export declare const setVueInstance: (instance: Application) => void;
@@ -0,0 +1,161 @@
1
+ import { addDays, addMonths, addYears } from 'date-fns';
2
+ import { type LocaleConfig, default as Locale } from '../locale';
3
+ export { addDays, addMonths, addYears };
4
+ export { DateRepeat } from './repeat';
5
+ type DayNameLength = 'narrow' | 'short' | 'long';
6
+ type MonthNameLength = 'short' | 'long';
7
+ export type DayInMonth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9 | -10 | -11 | -12 | -13 | -14 | -15 | -16 | -17 | -18 | -19 | -20 | -21 | -22 | -23 | -24 | -25 | -26 | -27 | -28 | -29 | -30 | -31;
8
+ export type DayOfWeek = 1 | 2 | 3 | 4 | 5 | 6 | 7;
9
+ export type WeekInMonth = 1 | 2 | 3 | 4 | 5 | 6;
10
+ export type WeekInMonthFromEnd = -6 | -5 | -4 | -3 | -2 | -1;
11
+ export type OrdinalWeekInMonth = -5 | -4 | -3 | -2 | -1 | 1 | 2 | 3 | 4 | 5;
12
+ export type MonthInYear = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
13
+ export type StartOfWeek = 1 | 2 | 3 | 4 | 5 | 6 | 7;
14
+ export type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;
15
+ export type DateSource = Date | string | number;
16
+ export type TimeNames = Partial<Record<Intl.RelativeTimeFormatUnit, string>>;
17
+ export declare function isDayInMonth(dayInMonth: unknown): dayInMonth is DayInMonth;
18
+ export declare function isDayOfWeek(dayOfWeek: unknown): dayOfWeek is DayOfWeek;
19
+ export declare function isWeekInMonth(weekInMonth: unknown): weekInMonth is WeekInMonth;
20
+ export declare function isMonthInYear(monthInYear: unknown): monthInYear is MonthInYear;
21
+ export declare function isOrdinalWeekInMonth(weekInMonth: unknown): weekInMonth is OrdinalWeekInMonth;
22
+ interface NumberRuleConfig {
23
+ min?: number;
24
+ max?: number;
25
+ interval?: number;
26
+ }
27
+ type DatePartsRuleFunction = (part: number, parts: TimeParts) => boolean;
28
+ type DatePartsRule = number | Array<number> | NumberRuleConfig | DatePartsRuleFunction;
29
+ export interface DatePartsRules {
30
+ hours?: DatePartsRule;
31
+ minutes?: DatePartsRule;
32
+ seconds?: DatePartsRule;
33
+ milliseconds?: DatePartsRule;
34
+ }
35
+ export interface DatePartOption {
36
+ value: number;
37
+ label: string;
38
+ disabled?: boolean;
39
+ }
40
+ export interface FormatParseOptions {
41
+ locale?: Locale | LocaleConfig | string;
42
+ timezone?: string;
43
+ }
44
+ export interface DateOptions {
45
+ type: string;
46
+ fillDate: DateSource;
47
+ mask: string;
48
+ patch: DatePatch;
49
+ rules: DatePartsRules;
50
+ }
51
+ export interface PageAddress {
52
+ day?: number;
53
+ week?: number;
54
+ month: number;
55
+ year: number;
56
+ }
57
+ export interface TimeParts {
58
+ hours: number;
59
+ minutes: number;
60
+ seconds: number;
61
+ milliseconds: number;
62
+ }
63
+ export interface SimpleDateParts {
64
+ year: number;
65
+ month: number;
66
+ day: number;
67
+ hours: number;
68
+ minutes: number;
69
+ seconds: number;
70
+ milliseconds: number;
71
+ }
72
+ export interface DayParts {
73
+ dayIndex: number;
74
+ day: number;
75
+ dayFromEnd: number;
76
+ weekday: number;
77
+ weekdayOrdinal: number;
78
+ weekdayOrdinalFromEnd: number;
79
+ week: number;
80
+ weekFromEnd: number;
81
+ weeknumber: number;
82
+ month: number;
83
+ year: number;
84
+ date: Date;
85
+ }
86
+ export interface DateParts extends DayParts {
87
+ milliseconds: number;
88
+ seconds: number;
89
+ minutes: number;
90
+ hours: number;
91
+ time: number;
92
+ dateTime: number;
93
+ isValid: boolean;
94
+ timezoneOffset: number;
95
+ isPm?: boolean;
96
+ }
97
+ export interface MonthParts {
98
+ firstDayOfWeek: DayOfWeek;
99
+ firstDayOfMonth: Date;
100
+ inLeapYear: boolean;
101
+ firstWeekday: number;
102
+ numDays: number;
103
+ numWeeks: number;
104
+ month: number;
105
+ year: number;
106
+ weeknumbers: number[];
107
+ isoWeeknumbers: number[];
108
+ }
109
+ export type DatePatch = 'dateTime' | 'date' | 'time';
110
+ export declare const DatePatchKeys: Record<DatePatch, (keyof SimpleDateParts)[]>;
111
+ export declare const daysInWeek = 7;
112
+ export declare const weeksInMonth = 6;
113
+ export declare const MS_PER_SECOND = 1000;
114
+ export declare const MS_PER_MINUTE: number;
115
+ export declare const MS_PER_HOUR: number;
116
+ export declare const MS_PER_DAY: number;
117
+ type DatePartsRange = Readonly<[number, number, number]>;
118
+ export declare function isDateParts(parts: unknown): parts is Partial<DateParts>;
119
+ export declare function isDateSource(date: unknown): date is DateSource;
120
+ export declare function roundDate(dateMs: number, snapMs?: number): Date;
121
+ export declare function startOfWeek(date: Date, firstDayOfWeek?: DayOfWeek): Date;
122
+ export declare function getStartOfWeek(date: Date, firstDayOfWeek?: DayOfWeek): Date;
123
+ export declare function getDayIndex(year: number, month: number, day: number): number;
124
+ export declare function diffInDays(d1: Date, d2: Date): number;
125
+ export declare function diffInWeeks(d1: Date, d2: Date): number;
126
+ export declare function diffInYears(d1: Date, d2: Date): number;
127
+ export declare function diffInMonths(d1: Date, d2: Date): number;
128
+ export declare function getDateFromParts(parts: Partial<SimpleDateParts>, timezone?: string): Date;
129
+ export declare function getTimezoneOffset(parts: Partial<SimpleDateParts>, timezone?: string): number;
130
+ export declare function getDateParts(date: Date, locale: Locale, timezone?: string | undefined): DateParts;
131
+ export declare function getMonthPartsKey(month: number, year: number, firstDayOfWeek: DayOfWeek): string;
132
+ export declare function getMonthParts(month: number, year: number, firstDayOfWeek: DayOfWeek): {
133
+ firstDayOfWeek: DayOfWeek;
134
+ firstDayOfMonth: Date;
135
+ inLeapYear: boolean;
136
+ firstWeekday: number;
137
+ numDays: number;
138
+ numWeeks: number;
139
+ month: number;
140
+ year: number;
141
+ weeknumbers: number[];
142
+ isoWeeknumbers: number[];
143
+ };
144
+ export declare function getWeekdayDates(): Date[];
145
+ export declare function getDayNames(length: DayNameLength, localeId?: string | undefined): string[];
146
+ export declare function getHourDates(): Date[];
147
+ export declare function getRelativeTimeNames(localeId?: undefined): TimeNames;
148
+ export declare function getMonthDates(): Date[];
149
+ export declare function getMonthNames(length: MonthNameLength, localeId?: undefined): string[];
150
+ export declare function datePartIsValid(part: number, rule: DatePartsRule, parts: DateParts): boolean;
151
+ export declare function getDatePartOptions(parts: DateParts, range: DatePartsRange, rule: DatePartsRule | undefined): DatePartOption[];
152
+ export declare function getDatePartsOptions(parts: DateParts, rules: DatePartsRules): {
153
+ milliseconds: DatePartOption[];
154
+ seconds: DatePartOption[];
155
+ minutes: DatePartOption[];
156
+ hours: DatePartOption[];
157
+ };
158
+ export declare function getNearestDatePart(parts: DateParts, range: DatePartsRange, value: number, rule: DatePartsRule): number;
159
+ export declare function applyRulesForDateParts(dateParts: DateParts, rules: DatePartsRules): DateParts;
160
+ export declare function parseDate(dateString: string, mask: string | string[], locale: Locale): Date;
161
+ export declare function formatDate(date: Date, masks: string | string[], locale: Locale): string;
@@ -0,0 +1,74 @@
1
+ import Locale from '../locale';
2
+ import type { CalendarDay } from '../page';
3
+ import { type DateParts, type DayParts } from './helpers';
4
+ import { DateRepeat, type DateRepeatConfig } from './repeat';
5
+ type DateRangeDate = Date | string | number | null;
6
+ interface DateRangeConfig {
7
+ start: DateRangeDate;
8
+ end: DateRangeDate;
9
+ span: number;
10
+ order: number;
11
+ repeat: Partial<DateRepeatConfig>;
12
+ }
13
+ export type DateRangeSource = DateRange | DateRangeDate | [DateRangeDate, DateRangeDate] | Partial<DateRangeConfig>;
14
+ export interface SimpleDateRange {
15
+ start: Date;
16
+ end: Date;
17
+ }
18
+ export declare class DateRange {
19
+ order: number;
20
+ locale: Locale;
21
+ start: DateParts | null;
22
+ end: DateParts | null;
23
+ repeat: DateRepeat | null;
24
+ static fromMany(ranges: DateRangeSource | DateRangeSource[], locale: Locale): DateRange[];
25
+ static from(source: DateRangeSource, locale: Locale): DateRange;
26
+ private constructor();
27
+ get opts(): {
28
+ order: number;
29
+ locale: Locale;
30
+ };
31
+ get hasRepeat(): boolean;
32
+ get isSingleDay(): boolean | null;
33
+ get isMultiDay(): boolean;
34
+ get daySpan(): number;
35
+ startsOnDay(dayParts: DayParts): boolean;
36
+ intersectsDay(dayIndex: number): boolean;
37
+ intersectsRange(range: DateRange): boolean;
38
+ intersectsDayRange(startDayIndex: number, endDayIndex: number): boolean;
39
+ }
40
+ interface DataRange {
41
+ startDay: number;
42
+ startTime: number;
43
+ endDay: number;
44
+ endTime: number;
45
+ }
46
+ export interface RangeData {
47
+ key: string | number;
48
+ order?: number;
49
+ }
50
+ export interface DateRangeCell<T extends RangeData> extends DataRange {
51
+ data: T;
52
+ onStart: boolean;
53
+ onEnd: boolean;
54
+ startTime: number;
55
+ startDate: Date;
56
+ endTime: number;
57
+ endDate: Date;
58
+ allDay: boolean;
59
+ order: number;
60
+ }
61
+ export declare class DateRangeContext {
62
+ private records;
63
+ render(data: RangeData, range: DateRange, days: DayParts[]): {
64
+ startDay: number;
65
+ startTime: number;
66
+ endDay: number;
67
+ endTime: number;
68
+ } | null;
69
+ private getRangeRecords;
70
+ getCell(key: string | number, day: CalendarDay): DateRangeCell<any> | undefined;
71
+ cellExists(key: string | number, dayIndex: number): boolean;
72
+ getCells(day: CalendarDay): DateRangeCell<any>[];
73
+ }
74
+ export {};
@@ -0,0 +1,34 @@
1
+ import Locale from '../locale';
2
+ import type { DateParts, DayInMonth, DayOfWeek, DayParts, MonthInYear, WeekInMonth } from './helpers';
3
+ import { GroupRuleType, type Rule, type RuleType, type SingleOrArray } from './rules';
4
+ export type RepeatIntervalShort = 'day' | 'week' | 'month' | 'year';
5
+ export type RepeatInterval = 'days' | 'weeks' | 'months' | 'years';
6
+ export interface DateRepeatConfig {
7
+ every: RepeatIntervalShort | [number, RepeatInterval];
8
+ from: Date;
9
+ until: Date;
10
+ weekdays: SingleOrArray<DayOfWeek>;
11
+ days: SingleOrArray<DayInMonth>;
12
+ weeks: SingleOrArray<WeekInMonth>;
13
+ months: SingleOrArray<MonthInYear>;
14
+ years: SingleOrArray<number>;
15
+ ordinalWeekdays: SingleOrArray<number[]>;
16
+ on: SingleOrArray<DateRepeatFn | Partial<DateRepeatConfig>>;
17
+ }
18
+ export type DateRepeatFn = (dayParts: DayParts) => boolean;
19
+ export interface DateRepeatOptions {
20
+ locale: Locale;
21
+ }
22
+ export declare class DateRepeat implements Rule<GroupRuleType> {
23
+ private parent?;
24
+ validated: boolean;
25
+ config: Partial<DateRepeatConfig> | DateRepeatFn;
26
+ type: GroupRuleType;
27
+ from: DateParts | undefined;
28
+ until: DateParts | undefined;
29
+ rules: Rule<RuleType>[];
30
+ locale: Locale;
31
+ constructor(config: Partial<DateRepeatConfig> | DateRepeatFn, options?: Partial<DateRepeatOptions>, parent?: DateRepeat | undefined);
32
+ getObjectRules(config: any): Rule<RuleType>[];
33
+ passes(dayParts: DayParts): boolean;
34
+ }
@@ -0,0 +1,82 @@
1
+ import { type DayOfWeek, type DayParts, type OrdinalWeekInMonth } from './helpers';
2
+ export type SingleOrArray<T> = T | T[];
3
+ export declare enum GroupRuleType {
4
+ Any = "any",
5
+ All = "all"
6
+ }
7
+ export declare enum IntervalRuleType {
8
+ Days = "days",
9
+ Weeks = "weeks",
10
+ Months = "months",
11
+ Years = "years"
12
+ }
13
+ export declare enum ComponentRuleType {
14
+ Days = "days",
15
+ Weekdays = "weekdays",
16
+ Weeks = "weeks",
17
+ Months = "months",
18
+ Years = "years"
19
+ }
20
+ export declare enum OrdinalComponentRuleType {
21
+ OrdinalWeekdays = "ordinalWeekdays"
22
+ }
23
+ export declare enum FunctionRuleType {
24
+ Function = "function"
25
+ }
26
+ export type RuleType = GroupRuleType | IntervalRuleType | ComponentRuleType | OrdinalComponentRuleType | FunctionRuleType;
27
+ export type OrdinalArrayConfig = SingleOrArray<[
28
+ OrdinalWeekInMonth,
29
+ ...DayOfWeek[]
30
+ ]>;
31
+ export interface Rule<T> {
32
+ type: T;
33
+ passes(dayParts: DayParts): boolean;
34
+ }
35
+ export declare class IntervalRule implements Rule<IntervalRuleType> {
36
+ type: IntervalRuleType;
37
+ interval: number;
38
+ from: DayParts;
39
+ private validated;
40
+ constructor(type: IntervalRuleType, interval: number, from: DayParts);
41
+ passes(dateParts: DayParts): boolean;
42
+ }
43
+ export declare class ComponentRule implements Rule<ComponentRuleType> {
44
+ type: ComponentRuleType;
45
+ validator: (component: unknown) => component is number;
46
+ getter: (dayParts: DayParts) => number[];
47
+ components: number[];
48
+ static create(type: ComponentRuleType, config: unknown): DaysRule | WeekdaysRule | WeeksRule | MonthsRule | YearsRule;
49
+ constructor(type: ComponentRuleType, components: unknown, validator: (component: unknown) => component is number, getter: (dayParts: DayParts) => number[]);
50
+ normalizeComponents(components: unknown): number[];
51
+ passes(dayParts: DayParts): boolean;
52
+ }
53
+ export declare class DaysRule extends ComponentRule {
54
+ constructor(components: unknown);
55
+ }
56
+ export declare class WeekdaysRule extends ComponentRule {
57
+ constructor(components: unknown);
58
+ }
59
+ export declare class WeeksRule extends ComponentRule {
60
+ constructor(components: unknown);
61
+ }
62
+ export declare class MonthsRule extends ComponentRule {
63
+ constructor(components: unknown);
64
+ }
65
+ export declare class YearsRule extends ComponentRule {
66
+ constructor(components: unknown);
67
+ }
68
+ export declare class OrdinalComponentRule implements Rule<OrdinalComponentRuleType> {
69
+ type: OrdinalComponentRuleType;
70
+ components: [OrdinalWeekInMonth, DayOfWeek][];
71
+ constructor(type: OrdinalComponentRuleType, components: OrdinalArrayConfig);
72
+ normalizeArrayConfig(config: OrdinalArrayConfig): [OrdinalWeekInMonth, DayOfWeek][];
73
+ normalizeComponents(config: OrdinalArrayConfig): [OrdinalWeekInMonth, DayOfWeek][];
74
+ passes(dayParts: DayParts): boolean;
75
+ }
76
+ export declare class FunctionRule implements Rule<FunctionRuleType> {
77
+ fn: Function;
78
+ type: FunctionRuleType;
79
+ private validated;
80
+ constructor(fn: Function);
81
+ passes(dayParts: DayParts): any;
82
+ }
@@ -0,0 +1,30 @@
1
+ import { type App } from 'vue';
2
+ import type { DarkModeConfig } from '../useDisplayMode';
3
+ interface DatePickerPopoverDefaults {
4
+ visibility?: string;
5
+ placement?: string;
6
+ isInteractive?: boolean;
7
+ }
8
+ interface DatePickerDefaults {
9
+ updateOnInput?: boolean;
10
+ inputDebounce?: number;
11
+ popover?: DatePickerPopoverDefaults;
12
+ }
13
+ export interface Defaults {
14
+ componentPrefix?: string;
15
+ color?: string;
16
+ isDark?: DarkModeConfig;
17
+ navVisibility?: string;
18
+ titlePosition?: string;
19
+ transition?: string;
20
+ touch?: object;
21
+ masks?: object;
22
+ locales?: any;
23
+ datePicker?: DatePickerDefaults;
24
+ }
25
+ declare const defaultLocales: import("vue").ComputedRef<{
26
+ [x: string]: any;
27
+ }>;
28
+ export { defaultLocales };
29
+ export declare const getDefault: (path: string) => any;
30
+ export declare const setupDefaults: (app: App, userDefaults: Defaults | undefined) => any;
@@ -0,0 +1,9 @@
1
+ interface LocaleSetting {
2
+ id: string;
3
+ firstDayOfWeek: number;
4
+ masks: {
5
+ L: string;
6
+ };
7
+ }
8
+ declare const localeSettings: Record<string, LocaleSetting>;
9
+ export default localeSettings;
@@ -0,0 +1,58 @@
1
+ import { Attribute } from './attribute';
2
+ import type { DateRangeCell } from './date/range';
3
+ export interface Glyph {
4
+ key: string | number;
5
+ color: string;
6
+ class: string | any[];
7
+ style: Record<string, any>;
8
+ }
9
+ export interface Profile<T> {
10
+ start: T;
11
+ base: T;
12
+ end: T;
13
+ startEnd?: T;
14
+ }
15
+ export type HighlightFillMode = 'solid' | 'light' | 'outline';
16
+ export interface Highlight extends Glyph {
17
+ fillMode: HighlightFillMode;
18
+ wrapperClass: string | any[];
19
+ contentClass: string | any[];
20
+ contentStyle: Record<string, any>;
21
+ }
22
+ export type HighlightConfig = boolean | string | Partial<Highlight | Profile<Partial<Highlight>>>;
23
+ export type Dot = Glyph;
24
+ export type DotConfig = boolean | string | Partial<Dot | Profile<Partial<Dot>>>;
25
+ export type Bar = Glyph;
26
+ export type BarConfig = boolean | string | Partial<Bar | Profile<Partial<Bar>>>;
27
+ export type Content = Glyph;
28
+ export type ContentConfig = string | Partial<Content | Profile<Partial<Content>>>;
29
+ export interface GlyphRenderer<P extends Partial<Glyph>> {
30
+ type: string;
31
+ normalizeConfig(color: string, config: any): Profile<P>;
32
+ prepareRender(glyphs: Record<string, P[]>): void;
33
+ render(attr: DateRangeCell<Attribute>, glyphs: Record<string, P[]>): void;
34
+ }
35
+ export declare class HighlightRenderer implements GlyphRenderer<Highlight> {
36
+ type: string;
37
+ normalizeConfig(color: string, config: any): Profile<Highlight>;
38
+ prepareRender(glyphs: Record<string, Glyph[]>): void;
39
+ render({ data, onStart, onEnd }: DateRangeCell<Attribute>, glyphs: Record<string, Highlight[]>): void;
40
+ }
41
+ export declare class BaseRenderer<T extends Partial<Glyph>> implements GlyphRenderer<T> {
42
+ type: string;
43
+ collectionType: string;
44
+ constructor(type: string, collectionType: string);
45
+ normalizeConfig(color: string, config: any): Profile<T>;
46
+ prepareRender(glyphs: Record<string, T[]>): void;
47
+ render({ data, onStart, onEnd }: DateRangeCell<Attribute>, glyphs: Record<string, T[]>): void;
48
+ }
49
+ export declare class ContentRenderer extends BaseRenderer<Content> {
50
+ constructor();
51
+ normalizeConfig(_: string, config: any): Profile<Content>;
52
+ }
53
+ export declare class DotRenderer extends BaseRenderer<Dot> {
54
+ constructor();
55
+ }
56
+ export declare class BarRenderer extends BaseRenderer<Dot> {
57
+ constructor();
58
+ }
@@ -0,0 +1,49 @@
1
+ import isFunction from 'lodash/isFunction';
2
+ import isString from 'lodash/isString';
3
+ export { isFunction, isString };
4
+ export { default as isBoolean } from 'lodash/isBoolean';
5
+ export { default as isNumber } from 'lodash/isNumber';
6
+ export { default as isUndefined } from 'lodash/isUndefined';
7
+ export { default as get } from 'lodash/get';
8
+ export { default as set } from 'lodash/set';
9
+ export { default as mapValues } from 'lodash/mapValues';
10
+ export { default as defaults } from 'lodash/defaults';
11
+ export { default as defaultsDeep } from 'lodash/defaultsDeep';
12
+ export { default as map } from 'lodash/map';
13
+ export { default as head } from 'lodash/head';
14
+ export { default as last } from 'lodash/last';
15
+ export declare const getType: (value: any) => string;
16
+ export declare const isDate: (value: unknown) => value is Date;
17
+ export declare const isObject: (value: unknown) => value is object;
18
+ declare const hasObj: any;
19
+ export { hasObj as has };
20
+ export declare const hasAny: (obj: object, props: string[]) => boolean;
21
+ export declare const some: {
22
+ <T>(collection: import("lodash").List<T> | null | undefined, predicate?: import("lodash").ListIterateeCustom<T, boolean>): boolean;
23
+ <T extends object>(collection: T | null | undefined, predicate?: import("lodash").ObjectIterateeCustom<T, boolean>): boolean;
24
+ };
25
+ export declare const pad: (val: string | number, len: number, char?: string) => string;
26
+ export declare const roundTenth: (n: number) => number;
27
+ export declare const isArray: (val: any) => val is any[];
28
+ export declare const arrayHasItems: (array: any) => boolean;
29
+ export declare const resolveEl: (target: unknown) => Node | null;
30
+ export declare const resolveDocument: (target?: unknown) => Document | null;
31
+ export interface ElementPosition {
32
+ top: number;
33
+ left: number;
34
+ }
35
+ export interface CustomElement {
36
+ addEventListener: Function;
37
+ removeEventListener: Function;
38
+ dispatchEvent: Function;
39
+ }
40
+ export declare const off: (element: CustomElement, event: string, handler: (e: any) => void, opts?: boolean | EventListenerOptions | undefined) => void;
41
+ export declare const on: (element: CustomElement, event: string, handler: (e: any) => void, opts?: boolean | AddEventListenerOptions | undefined) => () => void;
42
+ export declare const elementContains: (element: Node, child: Node) => boolean;
43
+ export declare const onSpaceOrEnter: (event: KeyboardEvent, handler: (e: KeyboardEvent) => void) => void;
44
+ export declare const capitalize: (str: string) => string;
45
+ export declare const omit: <T extends object, K extends [...(keyof T)[]]>(obj: T, ...keys: K) => { [K_1 in keyof T]: T[K_1]; };
46
+ export declare const pick: <T extends object, K extends keyof T>(obj: T, keys: K[]) => Pick<T, K>;
47
+ export declare function extend<T extends object, E extends object>(value: T, ext: E): T & E;
48
+ export declare function clamp(num: number, min: number, max: number): number;
49
+ export declare function hash(str: string): number;