kalendly 0.1.7 → 0.2.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/README.md +317 -681
- package/dist/core/index.js +3 -3
- package/dist/index.d.mts +48 -602
- package/dist/index.d.ts +48 -602
- package/dist/index.js +753 -2359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +727 -2348
- package/dist/index.mjs.map +1 -1
- package/dist/{vanilla/index.umd.js → index.umd.js} +218 -218
- package/dist/index.umd.js.map +1 -0
- package/package.json +41 -91
- package/dist/react/index.d.mts +0 -251
- package/dist/react/index.d.ts +0 -251
- package/dist/react/index.js +0 -969
- package/dist/react/index.js.map +0 -1
- package/dist/react/index.mjs +0 -924
- package/dist/react/index.mjs.map +0 -1
- package/dist/react-native/index.d.mts +0 -642
- package/dist/react-native/index.d.ts +0 -642
- package/dist/react-native/index.js +0 -1649
- package/dist/react-native/index.js.map +0 -1
- package/dist/react-native/index.mjs +0 -1615
- package/dist/react-native/index.mjs.map +0 -1
- package/dist/vanilla/index.d.mts +0 -271
- package/dist/vanilla/index.d.ts +0 -271
- package/dist/vanilla/index.js +0 -1064
- package/dist/vanilla/index.js.map +0 -1
- package/dist/vanilla/index.mjs +0 -1013
- package/dist/vanilla/index.mjs.map +0 -1
- package/dist/vanilla/index.umd.js.map +0 -1
- package/dist/vue/components/Calendar.vue.d.ts +0 -43
- package/dist/vue/components/Calendar.vue.d.ts.map +0 -1
- package/dist/vue/index.d.ts +0 -134
- package/dist/vue/index.d.ts.map +0 -1
- package/dist/vue/index.js +0 -1
- package/dist/vue/index.mjs +0 -717
- package/dist/vue/types.d.ts +0 -21
- package/dist/vue/types.d.ts.map +0 -1
package/dist/vue/index.mjs
DELETED
|
@@ -1,717 +0,0 @@
|
|
|
1
|
-
import { defineComponent as yt, ref as N, computed as O, watch as J, onMounted as vt, onUnmounted as gt, createElementBlock as i, openBlock as c, normalizeStyle as W, normalizeClass as C, createCommentVNode as y, createElementVNode as l, renderSlot as L, toDisplayString as d, createTextVNode as G, unref as $, withKeys as ft, Fragment as x, renderList as S, withModifiers as mt } from "vue";
|
|
2
|
-
const H = [
|
|
3
|
-
"Jan",
|
|
4
|
-
"Feb",
|
|
5
|
-
"Mar",
|
|
6
|
-
"Apr",
|
|
7
|
-
"May",
|
|
8
|
-
"Jun",
|
|
9
|
-
"Jul",
|
|
10
|
-
"Aug",
|
|
11
|
-
"Sep",
|
|
12
|
-
"Oct",
|
|
13
|
-
"Nov",
|
|
14
|
-
"Dec"
|
|
15
|
-
], K = [
|
|
16
|
-
"January",
|
|
17
|
-
"February",
|
|
18
|
-
"March",
|
|
19
|
-
"April",
|
|
20
|
-
"May",
|
|
21
|
-
"June",
|
|
22
|
-
"July",
|
|
23
|
-
"August",
|
|
24
|
-
"September",
|
|
25
|
-
"October",
|
|
26
|
-
"November",
|
|
27
|
-
"December"
|
|
28
|
-
], q = [
|
|
29
|
-
"Sunday",
|
|
30
|
-
"Monday",
|
|
31
|
-
"Tuesday",
|
|
32
|
-
"Wednesday",
|
|
33
|
-
"Thursday",
|
|
34
|
-
"Friday",
|
|
35
|
-
"Saturday"
|
|
36
|
-
];
|
|
37
|
-
function I(t) {
|
|
38
|
-
return new Date(t.getFullYear(), t.getMonth(), t.getDate(), 0, 0, 0);
|
|
39
|
-
}
|
|
40
|
-
function Dt(t, e) {
|
|
41
|
-
return I(t).getTime() === I(e).getTime();
|
|
42
|
-
}
|
|
43
|
-
function F(t) {
|
|
44
|
-
return Dt(t, /* @__PURE__ */ new Date());
|
|
45
|
-
}
|
|
46
|
-
function kt(t, e) {
|
|
47
|
-
const n = (/* @__PURE__ */ new Date()).getFullYear(), u = t ?? n - 30, h = e ?? n + 10;
|
|
48
|
-
return Array.from({ length: h - u + 1 }, (P, o) => u + o);
|
|
49
|
-
}
|
|
50
|
-
function E(t, e) {
|
|
51
|
-
const n = I(e);
|
|
52
|
-
return t.filter((u) => I(new Date(u.date)).getTime() === n.getTime());
|
|
53
|
-
}
|
|
54
|
-
function ve(t, e) {
|
|
55
|
-
return E(t, e).length > 0;
|
|
56
|
-
}
|
|
57
|
-
function bt(t, e, n = [], u = 0) {
|
|
58
|
-
const h = new Date(t, e, 1), o = new Date(t, e + 1, 0).getDate(), w = new Date(t, e, 0).getDate();
|
|
59
|
-
let g = h.getDay();
|
|
60
|
-
u === 1 && (g = g === 0 ? 6 : g - 1);
|
|
61
|
-
const f = [];
|
|
62
|
-
let m = 1, M = 1;
|
|
63
|
-
for (let _ = 0; _ < 6; _++) {
|
|
64
|
-
const Y = [];
|
|
65
|
-
for (let k = 0; k < 7; k++)
|
|
66
|
-
if (_ === 0 && k < g) {
|
|
67
|
-
const p = w - g + k + 1, v = new Date(t, e - 1, p), T = E(n, v);
|
|
68
|
-
Y.push({
|
|
69
|
-
date: v,
|
|
70
|
-
isCurrentMonth: !1,
|
|
71
|
-
isToday: F(v),
|
|
72
|
-
hasEvents: T.length > 0,
|
|
73
|
-
events: T
|
|
74
|
-
});
|
|
75
|
-
} else if (m > o) {
|
|
76
|
-
const p = new Date(t, e + 1, M), v = E(n, p);
|
|
77
|
-
Y.push({
|
|
78
|
-
date: p,
|
|
79
|
-
isCurrentMonth: !1,
|
|
80
|
-
isToday: F(p),
|
|
81
|
-
hasEvents: v.length > 0,
|
|
82
|
-
events: v
|
|
83
|
-
}), M++;
|
|
84
|
-
} else {
|
|
85
|
-
const p = new Date(t, e, m), v = E(n, p);
|
|
86
|
-
Y.push({
|
|
87
|
-
date: p,
|
|
88
|
-
isCurrentMonth: !0,
|
|
89
|
-
isToday: F(p),
|
|
90
|
-
hasEvents: v.length > 0,
|
|
91
|
-
events: v
|
|
92
|
-
}), m++;
|
|
93
|
-
}
|
|
94
|
-
f.push(Y);
|
|
95
|
-
}
|
|
96
|
-
return f;
|
|
97
|
-
}
|
|
98
|
-
function Ct(t) {
|
|
99
|
-
return t === null ? "popup-center-bottom" : t < 3 ? "popup-right" : t > 4 ? "popup-left" : "popup-center-bottom";
|
|
100
|
-
}
|
|
101
|
-
function Mt(t) {
|
|
102
|
-
const e = [];
|
|
103
|
-
return t.isCurrentMonth || e.push("other-month"), t.isToday && e.push("schedule--current--exam"), t.hasEvents && e.push("has--event"), e;
|
|
104
|
-
}
|
|
105
|
-
function _t(t) {
|
|
106
|
-
return `${q[t.getDay()]} ${t.getDate()}`;
|
|
107
|
-
}
|
|
108
|
-
function Yt(t, e) {
|
|
109
|
-
return `${K[e]} ${t}`;
|
|
110
|
-
}
|
|
111
|
-
function Tt(t) {
|
|
112
|
-
return t.allDay || !t.startTime && !t.endTime ? "All day" : t.startTime && t.endTime ? `${t.startTime} - ${t.endTime}` : t.startTime ? `${t.startTime}` : "";
|
|
113
|
-
}
|
|
114
|
-
function Et(t) {
|
|
115
|
-
return !t || t.length === 0 ? "" : t.length === 1 ? t[0] : t.length === 2 ? t.join(" and ") : `${t.slice(0, -1).join(", ")}, and ${t[t.length - 1]}`;
|
|
116
|
-
}
|
|
117
|
-
function ge(t) {
|
|
118
|
-
return [...t].sort((e, n) => {
|
|
119
|
-
const u = e.allDay || !e.startTime && !e.endTime, h = n.allDay || !n.startTime && !n.endTime;
|
|
120
|
-
return u && !h ? -1 : !u && h ? 1 : !e.startTime || !n.startTime ? 0 : e.startTime.localeCompare(n.startTime);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
const Q = {
|
|
124
|
-
work: "#3b82f6",
|
|
125
|
-
personal: "#8b5cf6",
|
|
126
|
-
meeting: "#10b981",
|
|
127
|
-
deadline: "#ef4444",
|
|
128
|
-
appointment: "#f59e0b",
|
|
129
|
-
other: "#6b7280"
|
|
130
|
-
};
|
|
131
|
-
function fe(t, e) {
|
|
132
|
-
const n = e || Q;
|
|
133
|
-
return t && n[t] ? n[t] : "#fc8917";
|
|
134
|
-
}
|
|
135
|
-
function j(t) {
|
|
136
|
-
return {
|
|
137
|
-
...Q,
|
|
138
|
-
...t
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function xt(t) {
|
|
142
|
-
return /^#([0-9A-F]{3}){1,2}$/i.test(t);
|
|
143
|
-
}
|
|
144
|
-
function St(t, e) {
|
|
145
|
-
const n = j(e), u = n[t] || n.other || "#fc8917";
|
|
146
|
-
return xt(u) ? u : "#fc8917";
|
|
147
|
-
}
|
|
148
|
-
class Pt {
|
|
149
|
-
constructor(e) {
|
|
150
|
-
this.listeners = /* @__PURE__ */ new Set(), this.config = e, this.categoryColors = j(e.categoryColors);
|
|
151
|
-
const n = e.initialDate || /* @__PURE__ */ new Date();
|
|
152
|
-
this.state = {
|
|
153
|
-
currentYear: n.getFullYear(),
|
|
154
|
-
currentMonth: n.getMonth(),
|
|
155
|
-
currentDate: n.getDate(),
|
|
156
|
-
selectedDate: null,
|
|
157
|
-
selectedDayIndex: null,
|
|
158
|
-
tasks: []
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Subscribe to state changes
|
|
163
|
-
*/
|
|
164
|
-
subscribe(e) {
|
|
165
|
-
return this.listeners.add(e), () => this.listeners.delete(e);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Notify all listeners of state changes
|
|
169
|
-
*/
|
|
170
|
-
notify() {
|
|
171
|
-
this.listeners.forEach((e) => e());
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Get current state
|
|
175
|
-
*/
|
|
176
|
-
getState() {
|
|
177
|
-
return { ...this.state };
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Get view model with computed properties
|
|
181
|
-
*/
|
|
182
|
-
getViewModel() {
|
|
183
|
-
const e = bt(
|
|
184
|
-
this.state.currentYear,
|
|
185
|
-
this.state.currentMonth,
|
|
186
|
-
this.config.events,
|
|
187
|
-
this.config.weekStartsOn
|
|
188
|
-
);
|
|
189
|
-
return {
|
|
190
|
-
...this.state,
|
|
191
|
-
months: H,
|
|
192
|
-
days: q,
|
|
193
|
-
years: kt(this.config.minYear, this.config.maxYear),
|
|
194
|
-
monthAndYearText: Yt(
|
|
195
|
-
this.state.currentYear,
|
|
196
|
-
this.state.currentMonth
|
|
197
|
-
),
|
|
198
|
-
scheduleDay: this.state.selectedDate ? _t(this.state.selectedDate) : "",
|
|
199
|
-
calendarDates: e,
|
|
200
|
-
popupPositionClass: Ct(this.state.selectedDayIndex)
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Get actions object
|
|
205
|
-
*/
|
|
206
|
-
getActions() {
|
|
207
|
-
return {
|
|
208
|
-
next: this.next.bind(this),
|
|
209
|
-
previous: this.previous.bind(this),
|
|
210
|
-
jump: this.jump.bind(this),
|
|
211
|
-
goToToday: this.goToToday.bind(this),
|
|
212
|
-
isCurrentMonth: this.isCurrentMonth.bind(this),
|
|
213
|
-
selectDate: this.selectDate.bind(this),
|
|
214
|
-
updateTasks: this.updateTasks.bind(this)
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Navigate to next month
|
|
219
|
-
*/
|
|
220
|
-
next() {
|
|
221
|
-
this.state.currentMonth === 11 ? (this.state.currentMonth = 0, this.state.currentYear++) : this.state.currentMonth++, this.state.selectedDate = null, this.state.selectedDayIndex = null, this.updateTasks(), this.notify();
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Navigate to previous month
|
|
225
|
-
*/
|
|
226
|
-
previous() {
|
|
227
|
-
this.state.currentMonth === 0 ? (this.state.currentMonth = 11, this.state.currentYear--) : this.state.currentMonth--, this.state.selectedDate = null, this.state.selectedDayIndex = null, this.updateTasks(), this.notify();
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Jump to specific month and year
|
|
231
|
-
*/
|
|
232
|
-
jump(e, n) {
|
|
233
|
-
this.state.currentYear = e, this.state.currentMonth = n, this.state.selectedDate = null, this.state.selectedDayIndex = null, this.updateTasks(), this.notify();
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Navigate to current month (today)
|
|
237
|
-
*/
|
|
238
|
-
goToToday() {
|
|
239
|
-
const e = /* @__PURE__ */ new Date();
|
|
240
|
-
this.state.currentYear = e.getFullYear(), this.state.currentMonth = e.getMonth(), this.state.selectedDate = null, this.state.selectedDayIndex = null, this.updateTasks(), this.notify();
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Check if currently viewing today's month
|
|
244
|
-
*/
|
|
245
|
-
isCurrentMonth() {
|
|
246
|
-
const e = /* @__PURE__ */ new Date();
|
|
247
|
-
return this.state.currentYear === e.getFullYear() && this.state.currentMonth === e.getMonth();
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Select a specific date
|
|
251
|
-
*/
|
|
252
|
-
selectDate(e, n) {
|
|
253
|
-
this.state.selectedDate = e, this.state.selectedDayIndex = n ?? null, this.state.currentDate = e.getDate(), this.state.currentMonth = e.getMonth(), this.state.currentYear = e.getFullYear(), this.updateTasks(), this.notify();
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Update tasks for the currently selected date
|
|
257
|
-
*/
|
|
258
|
-
updateTasks() {
|
|
259
|
-
if (!this.state.selectedDate) {
|
|
260
|
-
this.state.tasks = [];
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
this.state.tasks = E(
|
|
264
|
-
this.config.events,
|
|
265
|
-
this.state.selectedDate
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Update events configuration
|
|
270
|
-
*/
|
|
271
|
-
updateEvents(e) {
|
|
272
|
-
this.config.events = e, this.updateTasks(), this.notify();
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Handle date cell click
|
|
276
|
-
*/
|
|
277
|
-
handleDateClick(e, n) {
|
|
278
|
-
this.selectDate(e, n);
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Check if date has events
|
|
282
|
-
*/
|
|
283
|
-
hasEventsForDate(e) {
|
|
284
|
-
return E(this.config.events, e).length > 0;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Get events for a specific date
|
|
288
|
-
*/
|
|
289
|
-
getEventsForDate(e) {
|
|
290
|
-
return E(this.config.events, e);
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Clear selected date
|
|
294
|
-
*/
|
|
295
|
-
clearSelection() {
|
|
296
|
-
this.state.selectedDate = null, this.state.selectedDayIndex = null, this.state.tasks = [], this.notify();
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Get category color (with custom colors support)
|
|
300
|
-
*/
|
|
301
|
-
getCategoryColor(e) {
|
|
302
|
-
return e ? St(e, this.categoryColors) : "#fc8917";
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Update category colors dynamically
|
|
306
|
-
*/
|
|
307
|
-
updateCategoryColors(e) {
|
|
308
|
-
this.categoryColors = j(e), this.notify();
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Get all category colors
|
|
312
|
-
*/
|
|
313
|
-
getCategoryColors() {
|
|
314
|
-
return { ...this.categoryColors };
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Register a new category with color
|
|
318
|
-
*/
|
|
319
|
-
registerCategory(e, n) {
|
|
320
|
-
this.categoryColors[e] = n, this.notify();
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Destroy the engine and cleanup listeners
|
|
324
|
-
*/
|
|
325
|
-
destroy() {
|
|
326
|
-
this.listeners.clear();
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
const At = {
|
|
330
|
-
key: 0,
|
|
331
|
-
class: "page--title"
|
|
332
|
-
}, Nt = { class: "calendar--content" }, Ot = { class: "calendar--card" }, $t = { class: "calendar--nav-header" }, It = ["aria-expanded"], wt = {
|
|
333
|
-
key: 0,
|
|
334
|
-
class: "calendar--picker-dropdown"
|
|
335
|
-
}, Lt = { class: "calendar--picker-year-row" }, Ft = ["disabled"], Ht = ["value"], jt = ["disabled"], Rt = { class: "calendar--picker-months" }, Ut = ["onClick"], Vt = ["disabled"], Bt = { class: "calendar--table calendar--table--bordered" }, zt = { class: "popup-header" }, Jt = {
|
|
336
|
-
key: 0,
|
|
337
|
-
class: "scroll-hint"
|
|
338
|
-
}, Wt = { class: "events-container" }, Gt = ["onClick"], Kt = { class: "event-header" }, qt = { class: "event-title" }, Qt = { class: "event-badges" }, Xt = {
|
|
339
|
-
key: 0,
|
|
340
|
-
class: "event-time"
|
|
341
|
-
}, Zt = { class: "event-time-value" }, te = {
|
|
342
|
-
key: 1,
|
|
343
|
-
class: "event-description"
|
|
344
|
-
}, ee = {
|
|
345
|
-
key: 2,
|
|
346
|
-
class: "event-time"
|
|
347
|
-
}, se = { class: "event-time-value" }, ae = {
|
|
348
|
-
key: 3,
|
|
349
|
-
class: "event-time"
|
|
350
|
-
}, ne = { class: "event-time-value" }, re = {
|
|
351
|
-
key: 4,
|
|
352
|
-
class: "event-time"
|
|
353
|
-
}, oe = { class: "event-time-value" }, le = {
|
|
354
|
-
key: 5,
|
|
355
|
-
class: "event-time"
|
|
356
|
-
}, ie = { class: "event-time-value" }, ce = {
|
|
357
|
-
key: 6,
|
|
358
|
-
class: "event-time"
|
|
359
|
-
}, ue = ["href"], de = {
|
|
360
|
-
key: 7,
|
|
361
|
-
class: "event-tags"
|
|
362
|
-
}, he = {
|
|
363
|
-
key: 1,
|
|
364
|
-
class: "no-events-message"
|
|
365
|
-
}, R = /* @__PURE__ */ yt({
|
|
366
|
-
__name: "Calendar",
|
|
367
|
-
props: {
|
|
368
|
-
class: { default: "" },
|
|
369
|
-
style: { default: () => ({}) },
|
|
370
|
-
title: {},
|
|
371
|
-
theme: {},
|
|
372
|
-
events: { default: () => [] },
|
|
373
|
-
initialDate: {},
|
|
374
|
-
minYear: {},
|
|
375
|
-
maxYear: {},
|
|
376
|
-
weekStartsOn: { default: 0 },
|
|
377
|
-
useShortMonthNames: { type: Boolean, default: !1 },
|
|
378
|
-
onDateSelect: {},
|
|
379
|
-
onEventClick: {},
|
|
380
|
-
onMonthChange: {}
|
|
381
|
-
},
|
|
382
|
-
emits: ["date-select", "event-click", "month-change"],
|
|
383
|
-
setup(t, { emit: e }) {
|
|
384
|
-
const n = t, u = e, h = new Pt({
|
|
385
|
-
events: n.events,
|
|
386
|
-
initialDate: n.initialDate,
|
|
387
|
-
minYear: n.minYear,
|
|
388
|
-
maxYear: n.maxYear,
|
|
389
|
-
weekStartsOn: n.weekStartsOn
|
|
390
|
-
}), P = N(0), o = O(() => (P.value, h.getViewModel())), w = O(() => o.value.tasks.length > 3), g = h.getActions(), f = N(!1), m = N(""), M = N(!0), _ = N(null), Y = /* @__PURE__ */ new Date(), k = Y.getMonth(), p = Y.getFullYear(), v = O(() => n.minYear ?? p - 30), T = O(() => n.maxYear ?? p + 10), X = O(() => o.value.currentYear === p && o.value.currentMonth === k), Z = (s) => s ? Mt(s) : "", U = (s) => Tt(s), tt = (s) => Et(s), et = (s) => ({
|
|
391
|
-
work: "WORK",
|
|
392
|
-
personal: "PERSONAL",
|
|
393
|
-
meeting: "MEETING",
|
|
394
|
-
deadline: "DEADLINE",
|
|
395
|
-
appointment: "APPOINTMENT",
|
|
396
|
-
other: "OTHER"
|
|
397
|
-
})[s] || s.toUpperCase(), st = (s) => ({
|
|
398
|
-
high: "HIGH",
|
|
399
|
-
medium: "MEDIUM",
|
|
400
|
-
low: "LOW"
|
|
401
|
-
})[s] || s.toUpperCase(), at = (s) => ({
|
|
402
|
-
completed: "COMPLETED",
|
|
403
|
-
cancelled: "CANCELLED",
|
|
404
|
-
tentative: "TENTATIVE",
|
|
405
|
-
scheduled: "SCHEDULED"
|
|
406
|
-
})[s] || s.toUpperCase(), nt = (s) => {
|
|
407
|
-
const r = s.target.closest("td");
|
|
408
|
-
if (!r) return;
|
|
409
|
-
const a = r.parentElement;
|
|
410
|
-
if (!a) return;
|
|
411
|
-
const D = a.rowIndex - 1, b = Array.from(a.children).indexOf(r), A = o.value.calendarDates[D]?.[b];
|
|
412
|
-
A && (h.handleDateClick(A.date, b), u("date-select", A.date));
|
|
413
|
-
}, rt = () => {
|
|
414
|
-
g.next(), u(
|
|
415
|
-
"month-change",
|
|
416
|
-
o.value.currentYear,
|
|
417
|
-
o.value.currentMonth
|
|
418
|
-
);
|
|
419
|
-
}, ot = () => {
|
|
420
|
-
g.previous(), u(
|
|
421
|
-
"month-change",
|
|
422
|
-
o.value.currentYear,
|
|
423
|
-
o.value.currentMonth
|
|
424
|
-
);
|
|
425
|
-
}, lt = () => {
|
|
426
|
-
h.clearSelection();
|
|
427
|
-
}, it = () => {
|
|
428
|
-
f.value = !f.value, f.value && (m.value = String(o.value.currentYear), M.value = !0);
|
|
429
|
-
}, ct = () => {
|
|
430
|
-
g.goToToday(), f.value = !1, u("month-change", p, k);
|
|
431
|
-
}, ut = (s) => {
|
|
432
|
-
const r = s.target.value;
|
|
433
|
-
if (r === "" || /^\d+$/.test(r)) {
|
|
434
|
-
m.value = r;
|
|
435
|
-
const a = parseInt(r, 10);
|
|
436
|
-
M.value = r === "" || a >= v.value && a <= T.value;
|
|
437
|
-
}
|
|
438
|
-
}, V = () => {
|
|
439
|
-
const s = parseInt(m.value, 10);
|
|
440
|
-
isNaN(s) || s < v.value || s > T.value ? (m.value = String(o.value.currentYear), M.value = !0) : (g.jump(s, o.value.currentMonth), u("month-change", s, o.value.currentMonth));
|
|
441
|
-
}, dt = () => {
|
|
442
|
-
const s = o.value.currentYear - 1;
|
|
443
|
-
s >= v.value && (g.jump(s, o.value.currentMonth), m.value = String(s), u("month-change", s, o.value.currentMonth));
|
|
444
|
-
}, ht = () => {
|
|
445
|
-
const s = o.value.currentYear + 1;
|
|
446
|
-
s <= T.value && (g.jump(s, o.value.currentMonth), m.value = String(s), u("month-change", s, o.value.currentMonth));
|
|
447
|
-
}, pt = (s) => {
|
|
448
|
-
g.jump(o.value.currentYear, s), f.value = !1, u("month-change", o.value.currentYear, s);
|
|
449
|
-
}, B = (s) => {
|
|
450
|
-
_.value && !_.value.contains(s.target) && (f.value = !1);
|
|
451
|
-
};
|
|
452
|
-
J(
|
|
453
|
-
() => n.events,
|
|
454
|
-
(s) => {
|
|
455
|
-
h.updateEvents(s), P.value++;
|
|
456
|
-
},
|
|
457
|
-
{ deep: !0 }
|
|
458
|
-
), J(
|
|
459
|
-
() => n.theme,
|
|
460
|
-
(s) => {
|
|
461
|
-
if (s) {
|
|
462
|
-
const r = document.documentElement;
|
|
463
|
-
s.primary && r.style.setProperty("--calendar-primary-color", s.primary), s.secondary && r.style.setProperty(
|
|
464
|
-
"--calendar-secondary-color",
|
|
465
|
-
s.secondary
|
|
466
|
-
), s.tertiary && r.style.setProperty("--calendar-tertiary-color", s.tertiary), s.textColor && r.style.setProperty("--calendar-text-color", s.textColor), s.textLight && r.style.setProperty("--calendar-text-light", s.textLight), s.background && r.style.setProperty("--calendar-background", s.background), s.cellHover && r.style.setProperty("--calendar-cell-hover", s.cellHover), s.borderColor && r.style.setProperty("--calendar-border-color", s.borderColor), s.todayOutline && r.style.setProperty(
|
|
467
|
-
"--calendar-today-outline",
|
|
468
|
-
s.todayOutline
|
|
469
|
-
), s.selectedBg && r.style.setProperty("--calendar-selected-bg", s.selectedBg), s.eventIndicator && r.style.setProperty(
|
|
470
|
-
"--calendar-event-indicator",
|
|
471
|
-
s.eventIndicator
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
{ immediate: !0, deep: !0 }
|
|
476
|
-
);
|
|
477
|
-
let z = null;
|
|
478
|
-
return vt(() => {
|
|
479
|
-
z = h.subscribe(() => {
|
|
480
|
-
P.value++;
|
|
481
|
-
}), document.addEventListener("mousedown", B);
|
|
482
|
-
}), gt(() => {
|
|
483
|
-
z?.(), h.destroy(), document.removeEventListener("mousedown", B);
|
|
484
|
-
}), (s, r) => (c(), i("div", {
|
|
485
|
-
class: C(["kalendly-calendar", n.class]),
|
|
486
|
-
style: W(n.style)
|
|
487
|
-
}, [
|
|
488
|
-
t.title || s.$slots.title ? (c(), i("div", At, [
|
|
489
|
-
L(s.$slots, "title", {}, () => [
|
|
490
|
-
l("h1", null, d(t.title), 1)
|
|
491
|
-
])
|
|
492
|
-
])) : y("", !0),
|
|
493
|
-
l("div", Nt, [
|
|
494
|
-
l("div", Ot, [
|
|
495
|
-
l("div", $t, [
|
|
496
|
-
l("button", {
|
|
497
|
-
type: "button",
|
|
498
|
-
class: "calendar--nav-arrow",
|
|
499
|
-
"aria-label": "Previous month",
|
|
500
|
-
onClick: ot
|
|
501
|
-
}, " ‹ "),
|
|
502
|
-
l("div", {
|
|
503
|
-
ref_key: "pickerRef",
|
|
504
|
-
ref: _,
|
|
505
|
-
class: "calendar--picker-container"
|
|
506
|
-
}, [
|
|
507
|
-
l("button", {
|
|
508
|
-
type: "button",
|
|
509
|
-
class: "calendar--picker-btn",
|
|
510
|
-
"aria-expanded": f.value ? "true" : "false",
|
|
511
|
-
"aria-haspopup": "true",
|
|
512
|
-
onClick: it
|
|
513
|
-
}, [
|
|
514
|
-
G(d(n.useShortMonthNames ? `${$(H)[o.value.currentMonth]} ${o.value.currentYear}` : o.value.monthAndYearText) + " ", 1),
|
|
515
|
-
r[1] || (r[1] = l("span", { class: "calendar--picker-chevron" }, "▾", -1))
|
|
516
|
-
], 8, It),
|
|
517
|
-
f.value ? (c(), i("div", wt, [
|
|
518
|
-
l("div", Lt, [
|
|
519
|
-
l("button", {
|
|
520
|
-
type: "button",
|
|
521
|
-
class: "calendar--picker-year-arrow",
|
|
522
|
-
disabled: o.value.currentYear <= v.value,
|
|
523
|
-
"aria-label": "Previous year",
|
|
524
|
-
onClick: dt
|
|
525
|
-
}, " ‹ ", 8, Ft),
|
|
526
|
-
l("input", {
|
|
527
|
-
type: "text",
|
|
528
|
-
class: C([
|
|
529
|
-
"calendar--picker-year-input",
|
|
530
|
-
{ invalid: !M.value }
|
|
531
|
-
]),
|
|
532
|
-
value: m.value,
|
|
533
|
-
"aria-label": "Year",
|
|
534
|
-
onInput: ut,
|
|
535
|
-
onBlur: V,
|
|
536
|
-
onKeydown: ft(V, ["enter"])
|
|
537
|
-
}, null, 42, Ht),
|
|
538
|
-
l("button", {
|
|
539
|
-
type: "button",
|
|
540
|
-
class: "calendar--picker-year-arrow",
|
|
541
|
-
disabled: o.value.currentYear >= T.value,
|
|
542
|
-
"aria-label": "Next year",
|
|
543
|
-
onClick: ht
|
|
544
|
-
}, " › ", 8, jt)
|
|
545
|
-
]),
|
|
546
|
-
l("div", Rt, [
|
|
547
|
-
(c(!0), i(x, null, S(n.useShortMonthNames ? $(H) : $(K), (a, D) => (c(), i("button", {
|
|
548
|
-
key: a,
|
|
549
|
-
type: "button",
|
|
550
|
-
class: C([
|
|
551
|
-
"calendar--picker-month",
|
|
552
|
-
{ selected: D === o.value.currentMonth },
|
|
553
|
-
{
|
|
554
|
-
"current-month": D === $(k) && o.value.currentYear === $(p)
|
|
555
|
-
}
|
|
556
|
-
]),
|
|
557
|
-
onClick: (b) => pt(D)
|
|
558
|
-
}, d(a), 11, Ut))), 128))
|
|
559
|
-
])
|
|
560
|
-
])) : y("", !0)
|
|
561
|
-
], 512),
|
|
562
|
-
l("button", {
|
|
563
|
-
type: "button",
|
|
564
|
-
class: "calendar--today-btn",
|
|
565
|
-
disabled: X.value,
|
|
566
|
-
onClick: ct
|
|
567
|
-
}, " Today ", 8, Vt),
|
|
568
|
-
l("button", {
|
|
569
|
-
type: "button",
|
|
570
|
-
class: "calendar--nav-arrow",
|
|
571
|
-
"aria-label": "Next month",
|
|
572
|
-
onClick: rt
|
|
573
|
-
}, " › ")
|
|
574
|
-
]),
|
|
575
|
-
l("table", Bt, [
|
|
576
|
-
l("thead", null, [
|
|
577
|
-
l("tr", null, [
|
|
578
|
-
(c(!0), i(x, null, S(o.value.days, (a) => (c(), i("th", { key: a }, d(a.slice(0, 3)), 1))), 128))
|
|
579
|
-
])
|
|
580
|
-
]),
|
|
581
|
-
l("tbody", { onClick: nt }, [
|
|
582
|
-
(c(!0), i(x, null, S(o.value.calendarDates, (a, D) => (c(), i("tr", { key: D }, [
|
|
583
|
-
(c(!0), i(x, null, S(a, (b, A) => (c(), i("td", {
|
|
584
|
-
key: `${D}-${A}`,
|
|
585
|
-
class: C(Z(b))
|
|
586
|
-
}, d(b.date.getDate()), 3))), 128))
|
|
587
|
-
]))), 128))
|
|
588
|
-
])
|
|
589
|
-
]),
|
|
590
|
-
o.value.selectedDate ? (c(), i("div", {
|
|
591
|
-
key: 0,
|
|
592
|
-
class: C(["date-popup", o.value.popupPositionClass])
|
|
593
|
-
}, [
|
|
594
|
-
l("div", zt, [
|
|
595
|
-
l("h2", null, d(o.value.scheduleDay), 1),
|
|
596
|
-
l("button", {
|
|
597
|
-
type: "button",
|
|
598
|
-
class: "popup-close",
|
|
599
|
-
"aria-label": "Close",
|
|
600
|
-
onClick: lt
|
|
601
|
-
}, " ✕ ")
|
|
602
|
-
]),
|
|
603
|
-
w.value ? (c(), i("div", Jt, " ↓ Scroll to see more events ↓ ")) : y("", !0),
|
|
604
|
-
l("div", Wt, [
|
|
605
|
-
o.value.tasks.length > 0 ? (c(!0), i(x, { key: 0 }, S(o.value.tasks, (a) => (c(), i("div", {
|
|
606
|
-
key: a.id || a.name,
|
|
607
|
-
class: "event-card",
|
|
608
|
-
style: W([{ borderLeftColor: a.color }, { cursor: "pointer" }]),
|
|
609
|
-
onClick: (D) => u("event-click", a)
|
|
610
|
-
}, [
|
|
611
|
-
L(s.$slots, "event", { event: a }, () => [
|
|
612
|
-
l("div", Kt, [
|
|
613
|
-
l("div", qt, d(a.name), 1),
|
|
614
|
-
l("div", Qt, [
|
|
615
|
-
a.category ? (c(), i("span", {
|
|
616
|
-
key: 0,
|
|
617
|
-
class: C(`badge category-${a.category}`)
|
|
618
|
-
}, d(et(a.category)), 3)) : y("", !0),
|
|
619
|
-
a.priority ? (c(), i("span", {
|
|
620
|
-
key: 1,
|
|
621
|
-
class: C(`badge priority-${a.priority}`)
|
|
622
|
-
}, d(st(a.priority)), 3)) : y("", !0),
|
|
623
|
-
a.status && a.status !== "scheduled" ? (c(), i("span", {
|
|
624
|
-
key: 2,
|
|
625
|
-
class: C(`badge status-${a.status}`)
|
|
626
|
-
}, d(at(a.status)), 3)) : y("", !0)
|
|
627
|
-
])
|
|
628
|
-
]),
|
|
629
|
-
U(a) ? (c(), i("div", Xt, [
|
|
630
|
-
r[2] || (r[2] = l("span", { class: "event-time-label" }, "Time:", -1)),
|
|
631
|
-
l("span", Zt, d(U(a)), 1)
|
|
632
|
-
])) : y("", !0),
|
|
633
|
-
a.description ? (c(), i("div", te, d(a.description), 1)) : y("", !0),
|
|
634
|
-
a.location ? (c(), i("div", ee, [
|
|
635
|
-
r[3] || (r[3] = l("span", { class: "event-time-label" }, "Location:", -1)),
|
|
636
|
-
l("span", se, d(a.location), 1)
|
|
637
|
-
])) : y("", !0),
|
|
638
|
-
a.attendees && a.attendees.length > 0 ? (c(), i("div", ae, [
|
|
639
|
-
r[4] || (r[4] = l("span", { class: "event-time-label" }, "Attendees:", -1)),
|
|
640
|
-
l("span", ne, d(tt(a.attendees)), 1)
|
|
641
|
-
])) : y("", !0),
|
|
642
|
-
a.organizer ? (c(), i("div", re, [
|
|
643
|
-
r[5] || (r[5] = l("span", { class: "event-time-label" }, "Organizer:", -1)),
|
|
644
|
-
l("span", oe, d(a.organizer), 1)
|
|
645
|
-
])) : y("", !0),
|
|
646
|
-
a.notes ? (c(), i("div", le, [
|
|
647
|
-
r[6] || (r[6] = l("span", { class: "event-time-label" }, "Notes:", -1)),
|
|
648
|
-
l("span", ie, d(a.notes), 1)
|
|
649
|
-
])) : y("", !0),
|
|
650
|
-
a.url ? (c(), i("div", ce, [
|
|
651
|
-
l("a", {
|
|
652
|
-
href: a.url,
|
|
653
|
-
target: "_blank",
|
|
654
|
-
rel: "noopener noreferrer",
|
|
655
|
-
class: "event-link",
|
|
656
|
-
onClick: r[0] || (r[0] = mt(() => {
|
|
657
|
-
}, ["stop"]))
|
|
658
|
-
}, " View Details → ", 8, ue)
|
|
659
|
-
])) : y("", !0),
|
|
660
|
-
a.tags && a.tags.length > 0 ? (c(), i("div", de, [
|
|
661
|
-
(c(!0), i(x, null, S(a.tags, (D, b) => (c(), i("span", {
|
|
662
|
-
key: b,
|
|
663
|
-
class: "event-tag"
|
|
664
|
-
}, d(D), 1))), 128))
|
|
665
|
-
])) : y("", !0)
|
|
666
|
-
])
|
|
667
|
-
], 12, Gt))), 128)) : (c(), i("div", he, [
|
|
668
|
-
L(s.$slots, "no-events", {}, () => [
|
|
669
|
-
r[7] || (r[7] = G(" No events scheduled for this day. ", -1))
|
|
670
|
-
])
|
|
671
|
-
]))
|
|
672
|
-
])
|
|
673
|
-
], 2)) : y("", !0)
|
|
674
|
-
])
|
|
675
|
-
])
|
|
676
|
-
], 6));
|
|
677
|
-
}
|
|
678
|
-
});
|
|
679
|
-
function pe(t) {
|
|
680
|
-
t.component("Kalendly", R);
|
|
681
|
-
}
|
|
682
|
-
const me = {
|
|
683
|
-
install: pe,
|
|
684
|
-
Calendar: R
|
|
685
|
-
};
|
|
686
|
-
function De(t) {
|
|
687
|
-
return R;
|
|
688
|
-
}
|
|
689
|
-
export {
|
|
690
|
-
R as Calendar,
|
|
691
|
-
Pt as CalendarEngine,
|
|
692
|
-
q as DAYS,
|
|
693
|
-
Q as DEFAULT_CATEGORY_COLORS,
|
|
694
|
-
H as MONTHS,
|
|
695
|
-
K as MONTHS_FULL,
|
|
696
|
-
De as createCalendar,
|
|
697
|
-
me as default,
|
|
698
|
-
Et as formatAttendees,
|
|
699
|
-
_t as formatDateForDisplay,
|
|
700
|
-
Tt as formatTimeRange,
|
|
701
|
-
bt as generateCalendarDates,
|
|
702
|
-
kt as generateYears,
|
|
703
|
-
St as getCategoryColor,
|
|
704
|
-
Mt as getCellClasses,
|
|
705
|
-
fe as getDefaultEventColor,
|
|
706
|
-
E as getEventsForDate,
|
|
707
|
-
Yt as getMonthYearText,
|
|
708
|
-
Ct as getPopupPositionClass,
|
|
709
|
-
ve as hasEvents,
|
|
710
|
-
pe as install,
|
|
711
|
-
Dt as isSameDay,
|
|
712
|
-
F as isToday,
|
|
713
|
-
xt as isValidHexColor,
|
|
714
|
-
j as mergeCategoryColors,
|
|
715
|
-
I as normalizeDate,
|
|
716
|
-
ge as sortEventsByTime
|
|
717
|
-
};
|