kalendly 0.1.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.
- package/LICENSE +21 -0
- package/README.md +492 -0
- package/dist/core/index.d.mts +181 -0
- package/dist/core/index.d.ts +181 -0
- package/dist/core/index.js +349 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +309 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/index.d.mts +623 -0
- package/dist/index.d.ts +623 -0
- package/dist/index.js +1445 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1403 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react/index.d.mts +208 -0
- package/dist/react/index.d.ts +208 -0
- package/dist/react/index.js +558 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +516 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/react-native/index.d.mts +465 -0
- package/dist/react-native/index.d.ts +465 -0
- package/dist/react-native/index.js +894 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/index.mjs +851 -0
- package/dist/react-native/index.mjs.map +1 -0
- package/dist/styles/calendar.css +500 -0
- package/dist/vanilla/index.d.mts +214 -0
- package/dist/vanilla/index.d.ts +214 -0
- package/dist/vanilla/index.js +621 -0
- package/dist/vanilla/index.js.map +1 -0
- package/dist/vanilla/index.mjs +579 -0
- package/dist/vanilla/index.mjs.map +1 -0
- package/dist/vanilla/index.umd.js +604 -0
- package/dist/vanilla/index.umd.js.map +1 -0
- package/dist/vue/index.js +1 -0
- package/dist/vue/index.mjs +439 -0
- package/package.json +161 -0
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/vanilla/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
CalendarEngine: () => CalendarEngine,
|
|
24
|
+
DAYS: () => DAYS,
|
|
25
|
+
MONTHS: () => MONTHS,
|
|
26
|
+
VanillaCalendar: () => VanillaCalendar,
|
|
27
|
+
createCalendar: () => createCalendar,
|
|
28
|
+
formatDateForDisplay: () => formatDateForDisplay,
|
|
29
|
+
generateCalendarDates: () => generateCalendarDates,
|
|
30
|
+
generateYears: () => generateYears,
|
|
31
|
+
getCellClasses: () => getCellClasses,
|
|
32
|
+
getEventsForDate: () => getEventsForDate,
|
|
33
|
+
getMonthYearText: () => getMonthYearText,
|
|
34
|
+
getPopupPositionClass: () => getPopupPositionClass,
|
|
35
|
+
hasEvents: () => hasEvents,
|
|
36
|
+
isSameDay: () => isSameDay,
|
|
37
|
+
isToday: () => isToday,
|
|
38
|
+
normalizeDate: () => normalizeDate
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(index_exports);
|
|
41
|
+
|
|
42
|
+
// src/core/utils.ts
|
|
43
|
+
var MONTHS = [
|
|
44
|
+
"Jan",
|
|
45
|
+
"Feb",
|
|
46
|
+
"Mar",
|
|
47
|
+
"Apr",
|
|
48
|
+
"May",
|
|
49
|
+
"Jun",
|
|
50
|
+
"Jul",
|
|
51
|
+
"Aug",
|
|
52
|
+
"Sep",
|
|
53
|
+
"Oct",
|
|
54
|
+
"Nov",
|
|
55
|
+
"Dec"
|
|
56
|
+
];
|
|
57
|
+
var DAYS = [
|
|
58
|
+
"Sunday",
|
|
59
|
+
"Monday",
|
|
60
|
+
"Tuesday",
|
|
61
|
+
"Wednesday",
|
|
62
|
+
"Thursday",
|
|
63
|
+
"Friday",
|
|
64
|
+
"Saturday"
|
|
65
|
+
];
|
|
66
|
+
function normalizeDate(date) {
|
|
67
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
|
68
|
+
}
|
|
69
|
+
function isSameDay(date1, date2) {
|
|
70
|
+
return normalizeDate(date1).getTime() === normalizeDate(date2).getTime();
|
|
71
|
+
}
|
|
72
|
+
function isToday(date) {
|
|
73
|
+
return isSameDay(date, /* @__PURE__ */ new Date());
|
|
74
|
+
}
|
|
75
|
+
function generateYears(minYear, maxYear) {
|
|
76
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
77
|
+
const min = minYear ?? currentYear - 30;
|
|
78
|
+
const max = maxYear ?? currentYear + 10;
|
|
79
|
+
return Array.from({ length: max - min + 1 }, (_, i) => min + i);
|
|
80
|
+
}
|
|
81
|
+
function getEventsForDate(events, date) {
|
|
82
|
+
const normalizedTargetDate = normalizeDate(date);
|
|
83
|
+
return events.filter((event) => {
|
|
84
|
+
const eventDate = normalizeDate(new Date(event.date));
|
|
85
|
+
return eventDate.getTime() === normalizedTargetDate.getTime();
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function hasEvents(events, date) {
|
|
89
|
+
return getEventsForDate(events, date).length > 0;
|
|
90
|
+
}
|
|
91
|
+
function generateCalendarDates(year, month, events = [], weekStartsOn = 0) {
|
|
92
|
+
const firstDay = new Date(year, month, 1);
|
|
93
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
94
|
+
const daysInMonth = lastDay.getDate();
|
|
95
|
+
let firstDayOfWeek = firstDay.getDay();
|
|
96
|
+
if (weekStartsOn === 1) {
|
|
97
|
+
firstDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;
|
|
98
|
+
}
|
|
99
|
+
const dates = [];
|
|
100
|
+
let day = 1;
|
|
101
|
+
for (let week = 0; week < 6; week++) {
|
|
102
|
+
const weekDates = [];
|
|
103
|
+
for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {
|
|
104
|
+
if (week === 0 && dayOfWeek < firstDayOfWeek) {
|
|
105
|
+
weekDates.push(null);
|
|
106
|
+
} else if (day > daysInMonth) {
|
|
107
|
+
weekDates.push(null);
|
|
108
|
+
} else {
|
|
109
|
+
const currentDate = new Date(year, month, day);
|
|
110
|
+
const dateEvents = getEventsForDate(events, currentDate);
|
|
111
|
+
weekDates.push({
|
|
112
|
+
date: currentDate,
|
|
113
|
+
isCurrentMonth: true,
|
|
114
|
+
isToday: isToday(currentDate),
|
|
115
|
+
hasEvents: dateEvents.length > 0,
|
|
116
|
+
events: dateEvents
|
|
117
|
+
});
|
|
118
|
+
day++;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
dates.push(weekDates);
|
|
122
|
+
if (day > daysInMonth && weekDates.every((date) => date === null)) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return dates;
|
|
127
|
+
}
|
|
128
|
+
function getPopupPositionClass(selectedDayIndex) {
|
|
129
|
+
if (selectedDayIndex === null) return "popup-center-bottom";
|
|
130
|
+
if (selectedDayIndex < 3) {
|
|
131
|
+
return "popup-right";
|
|
132
|
+
} else if (selectedDayIndex > 4) {
|
|
133
|
+
return "popup-left";
|
|
134
|
+
} else {
|
|
135
|
+
return "popup-center-bottom";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function getCellClasses(calendarDate) {
|
|
139
|
+
if (!calendarDate) return [];
|
|
140
|
+
const classes = [];
|
|
141
|
+
if (calendarDate.isToday) {
|
|
142
|
+
classes.push("schedule--current--exam");
|
|
143
|
+
}
|
|
144
|
+
if (calendarDate.hasEvents) {
|
|
145
|
+
classes.push("has--event");
|
|
146
|
+
}
|
|
147
|
+
return classes;
|
|
148
|
+
}
|
|
149
|
+
function formatDateForDisplay(date) {
|
|
150
|
+
return `${DAYS[date.getDay()]} ${date.getDate()}`;
|
|
151
|
+
}
|
|
152
|
+
function getMonthYearText(year, month) {
|
|
153
|
+
return `${MONTHS[month]} ${year}`;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// src/core/calendar-engine.ts
|
|
157
|
+
var CalendarEngine = class {
|
|
158
|
+
constructor(config) {
|
|
159
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
160
|
+
this.config = config;
|
|
161
|
+
const initialDate = config.initialDate || /* @__PURE__ */ new Date();
|
|
162
|
+
this.state = {
|
|
163
|
+
currentYear: initialDate.getFullYear(),
|
|
164
|
+
currentMonth: initialDate.getMonth(),
|
|
165
|
+
currentDate: initialDate.getDate(),
|
|
166
|
+
selectedDate: null,
|
|
167
|
+
selectedDayIndex: null,
|
|
168
|
+
tasks: []
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Subscribe to state changes
|
|
173
|
+
*/
|
|
174
|
+
subscribe(listener) {
|
|
175
|
+
this.listeners.add(listener);
|
|
176
|
+
return () => this.listeners.delete(listener);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Notify all listeners of state changes
|
|
180
|
+
*/
|
|
181
|
+
notify() {
|
|
182
|
+
this.listeners.forEach((listener) => listener());
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get current state
|
|
186
|
+
*/
|
|
187
|
+
getState() {
|
|
188
|
+
return { ...this.state };
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get view model with computed properties
|
|
192
|
+
*/
|
|
193
|
+
getViewModel() {
|
|
194
|
+
const calendarDates = generateCalendarDates(
|
|
195
|
+
this.state.currentYear,
|
|
196
|
+
this.state.currentMonth,
|
|
197
|
+
this.config.events,
|
|
198
|
+
this.config.weekStartsOn
|
|
199
|
+
);
|
|
200
|
+
return {
|
|
201
|
+
...this.state,
|
|
202
|
+
months: MONTHS,
|
|
203
|
+
days: DAYS,
|
|
204
|
+
years: generateYears(this.config.minYear, this.config.maxYear),
|
|
205
|
+
monthAndYearText: getMonthYearText(
|
|
206
|
+
this.state.currentYear,
|
|
207
|
+
this.state.currentMonth
|
|
208
|
+
),
|
|
209
|
+
scheduleDay: this.state.selectedDate ? formatDateForDisplay(this.state.selectedDate) : "",
|
|
210
|
+
calendarDates,
|
|
211
|
+
popupPositionClass: getPopupPositionClass(this.state.selectedDayIndex)
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Get actions object
|
|
216
|
+
*/
|
|
217
|
+
getActions() {
|
|
218
|
+
return {
|
|
219
|
+
next: this.next.bind(this),
|
|
220
|
+
previous: this.previous.bind(this),
|
|
221
|
+
jump: this.jump.bind(this),
|
|
222
|
+
selectDate: this.selectDate.bind(this),
|
|
223
|
+
updateTasks: this.updateTasks.bind(this)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Navigate to next month
|
|
228
|
+
*/
|
|
229
|
+
next() {
|
|
230
|
+
if (this.state.currentMonth === 11) {
|
|
231
|
+
this.state.currentMonth = 0;
|
|
232
|
+
this.state.currentYear++;
|
|
233
|
+
} else {
|
|
234
|
+
this.state.currentMonth++;
|
|
235
|
+
}
|
|
236
|
+
this.state.selectedDate = null;
|
|
237
|
+
this.state.selectedDayIndex = null;
|
|
238
|
+
this.updateTasks();
|
|
239
|
+
this.notify();
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Navigate to previous month
|
|
243
|
+
*/
|
|
244
|
+
previous() {
|
|
245
|
+
if (this.state.currentMonth === 0) {
|
|
246
|
+
this.state.currentMonth = 11;
|
|
247
|
+
this.state.currentYear--;
|
|
248
|
+
} else {
|
|
249
|
+
this.state.currentMonth--;
|
|
250
|
+
}
|
|
251
|
+
this.state.selectedDate = null;
|
|
252
|
+
this.state.selectedDayIndex = null;
|
|
253
|
+
this.updateTasks();
|
|
254
|
+
this.notify();
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Jump to specific month and year
|
|
258
|
+
*/
|
|
259
|
+
jump(year, month) {
|
|
260
|
+
this.state.currentYear = year;
|
|
261
|
+
this.state.currentMonth = month;
|
|
262
|
+
this.state.selectedDate = null;
|
|
263
|
+
this.state.selectedDayIndex = null;
|
|
264
|
+
this.updateTasks();
|
|
265
|
+
this.notify();
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Select a specific date
|
|
269
|
+
*/
|
|
270
|
+
selectDate(date, dayIndex) {
|
|
271
|
+
this.state.selectedDate = date;
|
|
272
|
+
this.state.selectedDayIndex = dayIndex ?? null;
|
|
273
|
+
this.state.currentDate = date.getDate();
|
|
274
|
+
this.state.currentMonth = date.getMonth();
|
|
275
|
+
this.state.currentYear = date.getFullYear();
|
|
276
|
+
this.updateTasks();
|
|
277
|
+
this.notify();
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Update tasks for the currently selected date
|
|
281
|
+
*/
|
|
282
|
+
updateTasks() {
|
|
283
|
+
if (!this.state.selectedDate) {
|
|
284
|
+
this.state.tasks = [];
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.state.tasks = getEventsForDate(
|
|
288
|
+
this.config.events,
|
|
289
|
+
this.state.selectedDate
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Update events configuration
|
|
294
|
+
*/
|
|
295
|
+
updateEvents(events) {
|
|
296
|
+
this.config.events = events;
|
|
297
|
+
this.updateTasks();
|
|
298
|
+
this.notify();
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Handle date cell click
|
|
302
|
+
*/
|
|
303
|
+
handleDateClick(date, dayIndex) {
|
|
304
|
+
this.selectDate(date, dayIndex);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Check if date has events
|
|
308
|
+
*/
|
|
309
|
+
hasEventsForDate(date) {
|
|
310
|
+
return getEventsForDate(this.config.events, date).length > 0;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Get events for a specific date
|
|
314
|
+
*/
|
|
315
|
+
getEventsForDate(date) {
|
|
316
|
+
return getEventsForDate(this.config.events, date);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Clear selected date
|
|
320
|
+
*/
|
|
321
|
+
clearSelection() {
|
|
322
|
+
this.state.selectedDate = null;
|
|
323
|
+
this.state.selectedDayIndex = null;
|
|
324
|
+
this.state.tasks = [];
|
|
325
|
+
this.notify();
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Destroy the engine and cleanup listeners
|
|
329
|
+
*/
|
|
330
|
+
destroy() {
|
|
331
|
+
this.listeners.clear();
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// src/vanilla/Calendar.ts
|
|
336
|
+
var VanillaCalendar = class {
|
|
337
|
+
constructor(props) {
|
|
338
|
+
this.unsubscribe = null;
|
|
339
|
+
this.props = props;
|
|
340
|
+
if (typeof props.container === "string") {
|
|
341
|
+
const element = document.querySelector(props.container);
|
|
342
|
+
if (!element) {
|
|
343
|
+
throw new Error(`Container element "${props.container}" not found`);
|
|
344
|
+
}
|
|
345
|
+
this.container = element;
|
|
346
|
+
} else {
|
|
347
|
+
this.container = props.container;
|
|
348
|
+
}
|
|
349
|
+
this.engine = new CalendarEngine({
|
|
350
|
+
events: props.events,
|
|
351
|
+
initialDate: props.initialDate,
|
|
352
|
+
minYear: props.minYear,
|
|
353
|
+
maxYear: props.maxYear,
|
|
354
|
+
weekStartsOn: props.weekStartsOn
|
|
355
|
+
});
|
|
356
|
+
this.actions = this.engine.getActions();
|
|
357
|
+
this.init();
|
|
358
|
+
}
|
|
359
|
+
init() {
|
|
360
|
+
this.container.classList.add("kalendly-calendar");
|
|
361
|
+
if (this.props.className) {
|
|
362
|
+
this.container.classList.add(this.props.className);
|
|
363
|
+
}
|
|
364
|
+
this.unsubscribe = this.engine.subscribe(() => {
|
|
365
|
+
this.render();
|
|
366
|
+
});
|
|
367
|
+
this.render();
|
|
368
|
+
}
|
|
369
|
+
render() {
|
|
370
|
+
const viewModel = this.engine.getViewModel();
|
|
371
|
+
const defaultRenderEvent = (event) => `<li class="event--item">${event.name}</li>`;
|
|
372
|
+
const defaultRenderNoEvents = () => '<div class="no-events-message">No events scheduled for this day.</div>';
|
|
373
|
+
const renderEvent = this.props.renderEvent || defaultRenderEvent;
|
|
374
|
+
const renderNoEvents = this.props.renderNoEvents || defaultRenderNoEvents;
|
|
375
|
+
const html = `
|
|
376
|
+
${this.props.title ? `
|
|
377
|
+
<div class="page--title">
|
|
378
|
+
<h1>${this.props.title}</h1>
|
|
379
|
+
</div>
|
|
380
|
+
` : ""}
|
|
381
|
+
|
|
382
|
+
<div class="calendar--content">
|
|
383
|
+
<div class="calendar--card">
|
|
384
|
+
<h3 class="calendar--card--header">${viewModel.monthAndYearText}</h3>
|
|
385
|
+
|
|
386
|
+
<table class="calendar--table calendar--table--bordered">
|
|
387
|
+
<thead>
|
|
388
|
+
<tr>
|
|
389
|
+
${viewModel.days.map((day) => `<th>${day.slice(0, 3)}</th>`).join("")}
|
|
390
|
+
</tr>
|
|
391
|
+
</thead>
|
|
392
|
+
<tbody data-calendar-body>
|
|
393
|
+
${viewModel.calendarDates.map(
|
|
394
|
+
(week, weekIndex) => `
|
|
395
|
+
<tr>
|
|
396
|
+
${week.map((calendarDate, dayIndex) => {
|
|
397
|
+
const classes = getCellClasses(calendarDate);
|
|
398
|
+
const dateString = calendarDate ? calendarDate.date.toISOString() : "";
|
|
399
|
+
return `
|
|
400
|
+
<td
|
|
401
|
+
class="${classes.join(" ")}"
|
|
402
|
+
data-date="${dateString}"
|
|
403
|
+
data-day-index="${dayIndex}"
|
|
404
|
+
${calendarDate ? 'data-clickable="true"' : ""}
|
|
405
|
+
>
|
|
406
|
+
${calendarDate?.date.getDate() || ""}
|
|
407
|
+
</td>
|
|
408
|
+
`;
|
|
409
|
+
}).join("")}
|
|
410
|
+
</tr>
|
|
411
|
+
`
|
|
412
|
+
).join("")}
|
|
413
|
+
</tbody>
|
|
414
|
+
</table>
|
|
415
|
+
|
|
416
|
+
${viewModel.selectedDate ? `
|
|
417
|
+
<div class="date-popup ${viewModel.popupPositionClass}">
|
|
418
|
+
<button type="button" class="popup-close" data-action="close-popup" aria-label="Close">\u2715</button>
|
|
419
|
+
<div class="schedule--wrapper">
|
|
420
|
+
<div class="schedule--block">
|
|
421
|
+
<h2 class="schedule--day">${viewModel.scheduleDay}</h2>
|
|
422
|
+
</div>
|
|
423
|
+
${viewModel.tasks.length > 0 ? `
|
|
424
|
+
<div class="event--wrapper">
|
|
425
|
+
<ul>
|
|
426
|
+
${viewModel.tasks.map((event) => renderEvent(event)).join("")}
|
|
427
|
+
</ul>
|
|
428
|
+
</div>
|
|
429
|
+
` : renderNoEvents()}
|
|
430
|
+
</div>
|
|
431
|
+
</div>
|
|
432
|
+
` : ""}
|
|
433
|
+
|
|
434
|
+
<div class="calendar--navigation--buttons">
|
|
435
|
+
<button class="calendar--navigation--btn" data-action="previous">
|
|
436
|
+
Previous
|
|
437
|
+
</button>
|
|
438
|
+
<button class="calendar--navigation--btn" data-action="next">
|
|
439
|
+
Next
|
|
440
|
+
</button>
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
<form class="calendar--form--jump">
|
|
444
|
+
<div class="calendar--lead">Jump To:</div>
|
|
445
|
+
<div>
|
|
446
|
+
<label class="calendar--form--jump--item">
|
|
447
|
+
<select data-month-select>
|
|
448
|
+
${viewModel.months.map(
|
|
449
|
+
(month, index) => `
|
|
450
|
+
<option value="${index}" ${index === viewModel.currentMonth ? "selected" : ""}>
|
|
451
|
+
${month}
|
|
452
|
+
</option>
|
|
453
|
+
`
|
|
454
|
+
).join("")}
|
|
455
|
+
</select>
|
|
456
|
+
</label>
|
|
457
|
+
</div>
|
|
458
|
+
<div>
|
|
459
|
+
<label class="calendar--form--jump--item">
|
|
460
|
+
<select data-year-select>
|
|
461
|
+
${viewModel.years.map(
|
|
462
|
+
(year) => `
|
|
463
|
+
<option value="${year}" ${year === viewModel.currentYear ? "selected" : ""}>
|
|
464
|
+
${year}
|
|
465
|
+
</option>
|
|
466
|
+
`
|
|
467
|
+
).join("")}
|
|
468
|
+
</select>
|
|
469
|
+
</label>
|
|
470
|
+
</div>
|
|
471
|
+
</form>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
`;
|
|
475
|
+
this.container.innerHTML = html;
|
|
476
|
+
this.attachEventListeners();
|
|
477
|
+
}
|
|
478
|
+
attachEventListeners() {
|
|
479
|
+
const tableBody = this.container.querySelector("[data-calendar-body]");
|
|
480
|
+
if (tableBody) {
|
|
481
|
+
tableBody.addEventListener("click", (e) => {
|
|
482
|
+
const target = e.target;
|
|
483
|
+
const cell = target.closest('td[data-clickable="true"]');
|
|
484
|
+
if (cell && cell.dataset.date) {
|
|
485
|
+
const date = new Date(cell.dataset.date);
|
|
486
|
+
const dayIndex = parseInt(cell.dataset.dayIndex || "0");
|
|
487
|
+
this.engine.handleDateClick(date, dayIndex);
|
|
488
|
+
this.container.dispatchEvent(
|
|
489
|
+
new CustomEvent("dateSelect", {
|
|
490
|
+
detail: { date, dayIndex }
|
|
491
|
+
})
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
const prevBtn = this.container.querySelector('[data-action="previous"]');
|
|
497
|
+
const nextBtn = this.container.querySelector('[data-action="next"]');
|
|
498
|
+
if (prevBtn) {
|
|
499
|
+
prevBtn.addEventListener("click", () => {
|
|
500
|
+
this.actions.previous();
|
|
501
|
+
this.container.dispatchEvent(
|
|
502
|
+
new CustomEvent("monthChange", {
|
|
503
|
+
detail: {
|
|
504
|
+
year: this.engine.getViewModel().currentYear,
|
|
505
|
+
month: this.engine.getViewModel().currentMonth
|
|
506
|
+
}
|
|
507
|
+
})
|
|
508
|
+
);
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
if (nextBtn) {
|
|
512
|
+
nextBtn.addEventListener("click", () => {
|
|
513
|
+
this.actions.next();
|
|
514
|
+
this.container.dispatchEvent(
|
|
515
|
+
new CustomEvent("monthChange", {
|
|
516
|
+
detail: {
|
|
517
|
+
year: this.engine.getViewModel().currentYear,
|
|
518
|
+
month: this.engine.getViewModel().currentMonth
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
);
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
const monthSelect = this.container.querySelector(
|
|
525
|
+
"[data-month-select]"
|
|
526
|
+
);
|
|
527
|
+
const yearSelect = this.container.querySelector(
|
|
528
|
+
"[data-year-select]"
|
|
529
|
+
);
|
|
530
|
+
if (monthSelect) {
|
|
531
|
+
monthSelect.addEventListener("change", (e) => {
|
|
532
|
+
const target = e.target;
|
|
533
|
+
const month = parseInt(target.value);
|
|
534
|
+
const year = this.engine.getViewModel().currentYear;
|
|
535
|
+
this.actions.jump(year, month);
|
|
536
|
+
this.container.dispatchEvent(
|
|
537
|
+
new CustomEvent("monthChange", {
|
|
538
|
+
detail: { year, month }
|
|
539
|
+
})
|
|
540
|
+
);
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
if (yearSelect) {
|
|
544
|
+
yearSelect.addEventListener("change", (e) => {
|
|
545
|
+
const target = e.target;
|
|
546
|
+
const year = parseInt(target.value);
|
|
547
|
+
const month = this.engine.getViewModel().currentMonth;
|
|
548
|
+
this.actions.jump(year, month);
|
|
549
|
+
this.container.dispatchEvent(
|
|
550
|
+
new CustomEvent("monthChange", {
|
|
551
|
+
detail: { year, month }
|
|
552
|
+
})
|
|
553
|
+
);
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
const closeBtn = this.container.querySelector(
|
|
557
|
+
'[data-action="close-popup"]'
|
|
558
|
+
);
|
|
559
|
+
if (closeBtn) {
|
|
560
|
+
closeBtn.addEventListener("click", (e) => {
|
|
561
|
+
e.stopPropagation();
|
|
562
|
+
this.engine.clearSelection();
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
document.addEventListener("click", (e) => {
|
|
566
|
+
const target = e.target;
|
|
567
|
+
const popup = this.container.querySelector(".date-popup");
|
|
568
|
+
if (popup && !popup.contains(target) && !target.closest("[data-calendar-body]")) {
|
|
569
|
+
this.engine.clearSelection();
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
// Public API methods
|
|
574
|
+
updateEvents(events) {
|
|
575
|
+
this.engine.updateEvents(events);
|
|
576
|
+
}
|
|
577
|
+
getCurrentDate() {
|
|
578
|
+
return this.engine.getViewModel().selectedDate;
|
|
579
|
+
}
|
|
580
|
+
goToDate(date) {
|
|
581
|
+
this.actions.jump(date.getFullYear(), date.getMonth());
|
|
582
|
+
}
|
|
583
|
+
getEngine() {
|
|
584
|
+
return this.engine;
|
|
585
|
+
}
|
|
586
|
+
destroy() {
|
|
587
|
+
if (this.unsubscribe) {
|
|
588
|
+
this.unsubscribe();
|
|
589
|
+
this.unsubscribe = null;
|
|
590
|
+
}
|
|
591
|
+
this.engine.destroy();
|
|
592
|
+
this.container.innerHTML = "";
|
|
593
|
+
this.container.classList.remove("kalendly-calendar");
|
|
594
|
+
if (this.props.className) {
|
|
595
|
+
this.container.classList.remove(this.props.className);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
function createCalendar(props) {
|
|
600
|
+
return new VanillaCalendar(props);
|
|
601
|
+
}
|
|
602
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
603
|
+
0 && (module.exports = {
|
|
604
|
+
CalendarEngine,
|
|
605
|
+
DAYS,
|
|
606
|
+
MONTHS,
|
|
607
|
+
VanillaCalendar,
|
|
608
|
+
createCalendar,
|
|
609
|
+
formatDateForDisplay,
|
|
610
|
+
generateCalendarDates,
|
|
611
|
+
generateYears,
|
|
612
|
+
getCellClasses,
|
|
613
|
+
getEventsForDate,
|
|
614
|
+
getMonthYearText,
|
|
615
|
+
getPopupPositionClass,
|
|
616
|
+
hasEvents,
|
|
617
|
+
isSameDay,
|
|
618
|
+
isToday,
|
|
619
|
+
normalizeDate
|
|
620
|
+
});
|
|
621
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/vanilla/index.ts","../../src/core/utils.ts","../../src/core/calendar-engine.ts","../../src/vanilla/Calendar.ts"],"sourcesContent":["export { VanillaCalendar, createCalendar } from './Calendar';\nexport * from './types';\n\n// Re-export core types and utilities for convenience\nexport * from '../core';\n","import { CalendarEvent, CalendarDate } from './types';\n\nexport const MONTHS = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\n\nexport const DAYS = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n];\n\n/**\n * Normalizes a date to midnight (00:00:00) for comparison purposes\n */\nexport function normalizeDate(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);\n}\n\n/**\n * Checks if two dates are the same day\n */\nexport function isSameDay(date1: Date, date2: Date): boolean {\n return normalizeDate(date1).getTime() === normalizeDate(date2).getTime();\n}\n\n/**\n * Checks if a date is today\n */\nexport function isToday(date: Date): boolean {\n return isSameDay(date, new Date());\n}\n\n/**\n * Generates an array of years for the year selector\n */\nexport function generateYears(minYear?: number, maxYear?: number): number[] {\n const currentYear = new Date().getFullYear();\n const min = minYear ?? currentYear - 30;\n const max = maxYear ?? currentYear + 10;\n\n return Array.from({ length: max - min + 1 }, (_, i) => min + i);\n}\n\n/**\n * Gets events for a specific date\n */\nexport function getEventsForDate(\n events: CalendarEvent[],\n date: Date\n): CalendarEvent[] {\n const normalizedTargetDate = normalizeDate(date);\n\n return events.filter(event => {\n const eventDate = normalizeDate(new Date(event.date));\n return eventDate.getTime() === normalizedTargetDate.getTime();\n });\n}\n\n/**\n * Checks if a date has any events\n */\nexport function hasEvents(events: CalendarEvent[], date: Date): boolean {\n return getEventsForDate(events, date).length > 0;\n}\n\n/**\n * Generates calendar dates for a given month and year\n */\nexport function generateCalendarDates(\n year: number,\n month: number,\n events: CalendarEvent[] = [],\n weekStartsOn: 0 | 1 = 0\n): (CalendarDate | null)[][] {\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const daysInMonth = lastDay.getDate();\n\n // Adjust first day based on week start preference\n let firstDayOfWeek = firstDay.getDay();\n if (weekStartsOn === 1) {\n firstDayOfWeek = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;\n }\n\n const dates: (CalendarDate | null)[][] = [];\n let day = 1;\n\n for (let week = 0; week < 6; week++) {\n const weekDates: (CalendarDate | null)[] = [];\n\n for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {\n if (week === 0 && dayOfWeek < firstDayOfWeek) {\n weekDates.push(null);\n } else if (day > daysInMonth) {\n weekDates.push(null);\n } else {\n const currentDate = new Date(year, month, day);\n const dateEvents = getEventsForDate(events, currentDate);\n\n weekDates.push({\n date: currentDate,\n isCurrentMonth: true,\n isToday: isToday(currentDate),\n hasEvents: dateEvents.length > 0,\n events: dateEvents,\n });\n day++;\n }\n }\n\n dates.push(weekDates);\n\n // Break early if we've filled all days and the rest of the row is empty\n if (day > daysInMonth && weekDates.every(date => date === null)) {\n break;\n }\n }\n\n return dates;\n}\n\n/**\n * Gets the popup position class based on the selected day index\n */\nexport function getPopupPositionClass(selectedDayIndex: number | null): string {\n if (selectedDayIndex === null) return 'popup-center-bottom';\n\n if (selectedDayIndex < 3) {\n return 'popup-right';\n } else if (selectedDayIndex > 4) {\n return 'popup-left';\n } else {\n return 'popup-center-bottom';\n }\n}\n\n/**\n * Gets CSS classes for a calendar cell\n */\nexport function getCellClasses(calendarDate: CalendarDate | null): string[] {\n if (!calendarDate) return [];\n\n const classes: string[] = [];\n\n if (calendarDate.isToday) {\n classes.push('schedule--current--exam');\n }\n\n if (calendarDate.hasEvents) {\n classes.push('has--event');\n }\n\n return classes;\n}\n\n/**\n * Formats a date for display\n */\nexport function formatDateForDisplay(date: Date): string {\n return `${DAYS[date.getDay()]} ${date.getDate()}`;\n}\n\n/**\n * Gets month and year text for display\n */\nexport function getMonthYearText(year: number, month: number): string {\n return `${MONTHS[month]} ${year}`;\n}\n","import {\n CalendarEvent,\n CalendarState,\n CalendarConfig,\n CalendarActions,\n CalendarViewModel,\n} from './types';\nimport {\n generateCalendarDates,\n getEventsForDate,\n generateYears,\n getPopupPositionClass,\n getMonthYearText,\n formatDateForDisplay,\n MONTHS,\n DAYS,\n} from './utils';\n\nexport class CalendarEngine {\n private state: CalendarState;\n private config: CalendarConfig;\n private listeners: Set<() => void> = new Set();\n\n constructor(config: CalendarConfig) {\n this.config = config;\n\n const initialDate = config.initialDate || new Date();\n this.state = {\n currentYear: initialDate.getFullYear(),\n currentMonth: initialDate.getMonth(),\n currentDate: initialDate.getDate(),\n selectedDate: null,\n selectedDayIndex: null,\n tasks: [],\n };\n }\n\n /**\n * Subscribe to state changes\n */\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /**\n * Notify all listeners of state changes\n */\n private notify(): void {\n this.listeners.forEach(listener => listener());\n }\n\n /**\n * Get current state\n */\n getState(): CalendarState {\n return { ...this.state };\n }\n\n /**\n * Get view model with computed properties\n */\n getViewModel(): CalendarViewModel {\n const calendarDates = generateCalendarDates(\n this.state.currentYear,\n this.state.currentMonth,\n this.config.events,\n this.config.weekStartsOn\n );\n\n return {\n ...this.state,\n months: MONTHS,\n days: DAYS,\n years: generateYears(this.config.minYear, this.config.maxYear),\n monthAndYearText: getMonthYearText(\n this.state.currentYear,\n this.state.currentMonth\n ),\n scheduleDay: this.state.selectedDate\n ? formatDateForDisplay(this.state.selectedDate)\n : '',\n calendarDates,\n popupPositionClass: getPopupPositionClass(this.state.selectedDayIndex),\n };\n }\n\n /**\n * Get actions object\n */\n getActions(): CalendarActions {\n return {\n next: this.next.bind(this),\n previous: this.previous.bind(this),\n jump: this.jump.bind(this),\n selectDate: this.selectDate.bind(this),\n updateTasks: this.updateTasks.bind(this),\n };\n }\n\n /**\n * Navigate to next month\n */\n private next(): void {\n if (this.state.currentMonth === 11) {\n this.state.currentMonth = 0;\n this.state.currentYear++;\n } else {\n this.state.currentMonth++;\n }\n\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Navigate to previous month\n */\n private previous(): void {\n if (this.state.currentMonth === 0) {\n this.state.currentMonth = 11;\n this.state.currentYear--;\n } else {\n this.state.currentMonth--;\n }\n\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Jump to specific month and year\n */\n private jump(year: number, month: number): void {\n this.state.currentYear = year;\n this.state.currentMonth = month;\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Select a specific date\n */\n private selectDate(date: Date, dayIndex?: number): void {\n this.state.selectedDate = date;\n this.state.selectedDayIndex = dayIndex ?? null;\n this.state.currentDate = date.getDate();\n this.state.currentMonth = date.getMonth();\n this.state.currentYear = date.getFullYear();\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Update tasks for the currently selected date\n */\n private updateTasks(): void {\n if (!this.state.selectedDate) {\n this.state.tasks = [];\n return;\n }\n\n this.state.tasks = getEventsForDate(\n this.config.events,\n this.state.selectedDate\n );\n }\n\n /**\n * Update events configuration\n */\n updateEvents(events: CalendarEvent[]): void {\n this.config.events = events;\n this.updateTasks();\n this.notify();\n }\n\n /**\n * Handle date cell click\n */\n handleDateClick(date: Date, dayIndex?: number): void {\n this.selectDate(date, dayIndex);\n }\n\n /**\n * Check if date has events\n */\n hasEventsForDate(date: Date): boolean {\n return getEventsForDate(this.config.events, date).length > 0;\n }\n\n /**\n * Get events for a specific date\n */\n getEventsForDate(date: Date): CalendarEvent[] {\n return getEventsForDate(this.config.events, date);\n }\n\n /**\n * Clear selected date\n */\n clearSelection(): void {\n this.state.selectedDate = null;\n this.state.selectedDayIndex = null;\n this.state.tasks = [];\n this.notify();\n }\n\n /**\n * Destroy the engine and cleanup listeners\n */\n destroy(): void {\n this.listeners.clear();\n }\n}\n","import { CalendarEngine, getCellClasses } from '../core';\nimport { VanillaCalendarProps, VanillaCalendarInstance } from './types';\n\nexport class VanillaCalendar implements VanillaCalendarInstance {\n private engine: CalendarEngine;\n private container: HTMLElement;\n private unsubscribe: (() => void) | null = null;\n private props: VanillaCalendarProps;\n private actions: ReturnType<CalendarEngine['getActions']>;\n\n constructor(props: VanillaCalendarProps) {\n this.props = props;\n\n // Get container element\n if (typeof props.container === 'string') {\n const element = document.querySelector(props.container);\n if (!element) {\n throw new Error(`Container element \"${props.container}\" not found`);\n }\n this.container = element as HTMLElement;\n } else {\n this.container = props.container;\n }\n\n // Initialize engine\n this.engine = new CalendarEngine({\n events: props.events,\n initialDate: props.initialDate,\n minYear: props.minYear,\n maxYear: props.maxYear,\n weekStartsOn: props.weekStartsOn,\n });\n\n // Cache actions for event handlers\n this.actions = this.engine.getActions();\n\n this.init();\n }\n\n private init(): void {\n // Add CSS class to container\n this.container.classList.add('kalendly-calendar');\n if (this.props.className) {\n this.container.classList.add(this.props.className);\n }\n\n // Subscribe to engine changes\n this.unsubscribe = this.engine.subscribe(() => {\n this.render();\n });\n\n // Initial render\n this.render();\n }\n\n private render(): void {\n const viewModel = this.engine.getViewModel();\n\n const defaultRenderEvent = (event: any) =>\n `<li class=\"event--item\">${event.name}</li>`;\n const defaultRenderNoEvents = () =>\n '<div class=\"no-events-message\">No events scheduled for this day.</div>';\n\n const renderEvent = this.props.renderEvent || defaultRenderEvent;\n const renderNoEvents = this.props.renderNoEvents || defaultRenderNoEvents;\n\n const html = `\n ${\n this.props.title\n ? `\n <div class=\"page--title\">\n <h1>${this.props.title}</h1>\n </div>\n `\n : ''\n }\n \n <div class=\"calendar--content\">\n <div class=\"calendar--card\">\n <h3 class=\"calendar--card--header\">${viewModel.monthAndYearText}</h3>\n \n <table class=\"calendar--table calendar--table--bordered\">\n <thead>\n <tr>\n ${viewModel.days.map(day => `<th>${day.slice(0, 3)}</th>`).join('')}\n </tr>\n </thead>\n <tbody data-calendar-body>\n ${viewModel.calendarDates\n .map(\n (week, weekIndex) => `\n <tr>\n ${week\n .map((calendarDate, dayIndex) => {\n const classes = getCellClasses(calendarDate);\n const dateString = calendarDate\n ? calendarDate.date.toISOString()\n : '';\n return `\n <td \n class=\"${classes.join(' ')}\" \n data-date=\"${dateString}\"\n data-day-index=\"${dayIndex}\"\n ${calendarDate ? 'data-clickable=\"true\"' : ''}\n >\n ${calendarDate?.date.getDate() || ''}\n </td>\n `;\n })\n .join('')}\n </tr>\n `\n )\n .join('')}\n </tbody>\n </table>\n\n ${\n viewModel.selectedDate\n ? `\n <div class=\"date-popup ${viewModel.popupPositionClass}\">\n <button type=\"button\" class=\"popup-close\" data-action=\"close-popup\" aria-label=\"Close\">✕</button>\n <div class=\"schedule--wrapper\">\n <div class=\"schedule--block\">\n <h2 class=\"schedule--day\">${viewModel.scheduleDay}</h2>\n </div>\n ${\n viewModel.tasks.length > 0\n ? `\n <div class=\"event--wrapper\">\n <ul>\n ${viewModel.tasks.map(event => renderEvent(event)).join('')}\n </ul>\n </div>\n `\n : renderNoEvents()\n }\n </div>\n </div>\n `\n : ''\n }\n\n <div class=\"calendar--navigation--buttons\">\n <button class=\"calendar--navigation--btn\" data-action=\"previous\">\n Previous\n </button>\n <button class=\"calendar--navigation--btn\" data-action=\"next\">\n Next\n </button>\n </div>\n\n <form class=\"calendar--form--jump\">\n <div class=\"calendar--lead\">Jump To:</div>\n <div>\n <label class=\"calendar--form--jump--item\">\n <select data-month-select>\n ${viewModel.months\n .map(\n (month, index) => `\n <option value=\"${index}\" ${index === viewModel.currentMonth ? 'selected' : ''}>\n ${month}\n </option>\n `\n )\n .join('')}\n </select>\n </label>\n </div>\n <div>\n <label class=\"calendar--form--jump--item\">\n <select data-year-select>\n ${viewModel.years\n .map(\n year => `\n <option value=\"${year}\" ${year === viewModel.currentYear ? 'selected' : ''}>\n ${year}\n </option>\n `\n )\n .join('')}\n </select>\n </label>\n </div>\n </form>\n </div>\n </div>\n `;\n\n this.container.innerHTML = html;\n this.attachEventListeners();\n }\n\n private attachEventListeners(): void {\n // Date cell clicks\n const tableBody = this.container.querySelector('[data-calendar-body]');\n if (tableBody) {\n tableBody.addEventListener('click', e => {\n const target = e.target as HTMLElement;\n const cell = target.closest('td[data-clickable=\"true\"]') as HTMLElement;\n\n if (cell && cell.dataset.date) {\n const date = new Date(cell.dataset.date);\n const dayIndex = parseInt(cell.dataset.dayIndex || '0');\n this.engine.handleDateClick(date, dayIndex);\n\n // Trigger custom event\n this.container.dispatchEvent(\n new CustomEvent('dateSelect', {\n detail: { date, dayIndex },\n })\n );\n }\n });\n }\n\n // Navigation buttons\n const prevBtn = this.container.querySelector('[data-action=\"previous\"]');\n const nextBtn = this.container.querySelector('[data-action=\"next\"]');\n\n if (prevBtn) {\n prevBtn.addEventListener('click', () => {\n this.actions.previous();\n this.container.dispatchEvent(\n new CustomEvent('monthChange', {\n detail: {\n year: this.engine.getViewModel().currentYear,\n month: this.engine.getViewModel().currentMonth,\n },\n })\n );\n });\n }\n\n if (nextBtn) {\n nextBtn.addEventListener('click', () => {\n this.actions.next();\n this.container.dispatchEvent(\n new CustomEvent('monthChange', {\n detail: {\n year: this.engine.getViewModel().currentYear,\n month: this.engine.getViewModel().currentMonth,\n },\n })\n );\n });\n }\n\n // Month/Year selects\n const monthSelect = this.container.querySelector(\n '[data-month-select]'\n ) as HTMLSelectElement;\n const yearSelect = this.container.querySelector(\n '[data-year-select]'\n ) as HTMLSelectElement;\n\n if (monthSelect) {\n monthSelect.addEventListener('change', e => {\n const target = e.target as HTMLSelectElement;\n const month = parseInt(target.value);\n const year = this.engine.getViewModel().currentYear;\n this.actions.jump(year, month);\n\n this.container.dispatchEvent(\n new CustomEvent('monthChange', {\n detail: { year, month },\n })\n );\n });\n }\n\n if (yearSelect) {\n yearSelect.addEventListener('change', e => {\n const target = e.target as HTMLSelectElement;\n const year = parseInt(target.value);\n const month = this.engine.getViewModel().currentMonth;\n this.actions.jump(year, month);\n\n this.container.dispatchEvent(\n new CustomEvent('monthChange', {\n detail: { year, month },\n })\n );\n });\n }\n\n // Close popup button\n const closeBtn = this.container.querySelector(\n '[data-action=\"close-popup\"]'\n );\n if (closeBtn) {\n closeBtn.addEventListener('click', e => {\n e.stopPropagation();\n this.engine.clearSelection();\n });\n }\n\n // Close popup on outside click\n document.addEventListener('click', e => {\n const target = e.target as HTMLElement;\n const popup = this.container.querySelector('.date-popup');\n\n if (\n popup &&\n !popup.contains(target) &&\n !target.closest('[data-calendar-body]')\n ) {\n this.engine.clearSelection();\n }\n });\n }\n\n // Public API methods\n public updateEvents(events: import('../core').CalendarEvent[]): void {\n this.engine.updateEvents(events);\n }\n\n public getCurrentDate(): Date | null {\n return this.engine.getViewModel().selectedDate;\n }\n\n public goToDate(date: Date): void {\n this.actions.jump(date.getFullYear(), date.getMonth());\n }\n\n public getEngine(): CalendarEngine {\n return this.engine;\n }\n\n public destroy(): void {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n }\n\n this.engine.destroy();\n this.container.innerHTML = '';\n this.container.classList.remove('kalendly-calendar');\n\n if (this.props.className) {\n this.container.classList.remove(this.props.className);\n }\n }\n}\n\n// Factory function for easier usage\nexport function createCalendar(\n props: VanillaCalendarProps\n): VanillaCalendarInstance {\n return new Van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