@forcecalendar/interface 1.0.23 → 1.0.24
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/dist/force-calendar-interface.esm.js +44 -30
- package/dist/force-calendar-interface.esm.js.map +1 -1
- package/dist/force-calendar-interface.umd.js +3 -3
- package/dist/force-calendar-interface.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ForceCalendar.js +25 -3
- package/src/core/StateManager.js +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var W = Object.defineProperty;
|
|
2
|
-
var j = (
|
|
3
|
-
var I = (
|
|
2
|
+
var j = (g, e, t) => e in g ? W(g, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[e] = t;
|
|
3
|
+
var I = (g, e, t) => j(g, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
class O extends HTMLElement {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(), this.attachShadow({ mode: "open" }), this._listeners = [], this._state = null, this._props = /* @__PURE__ */ new Map(), this._initialized = !1;
|
|
@@ -1061,7 +1061,7 @@ class w {
|
|
|
1061
1061
|
...V
|
|
1062
1062
|
// Capture any extra properties
|
|
1063
1063
|
}) {
|
|
1064
|
-
const
|
|
1064
|
+
const m = w.normalize({
|
|
1065
1065
|
id: e,
|
|
1066
1066
|
title: t,
|
|
1067
1067
|
start: s,
|
|
@@ -1093,7 +1093,7 @@ class w {
|
|
|
1093
1093
|
...V
|
|
1094
1094
|
// Pass any extra properties
|
|
1095
1095
|
});
|
|
1096
|
-
w.validate(
|
|
1096
|
+
w.validate(m), this.id = m.id, this.title = m.title, this._timezoneManager = C.getInstance(), this.timeZone = m.timeZone || this._timezoneManager.getSystemTimezone(), this.endTimeZone = m.endTimeZone || this.timeZone, this.start = m.start, this.end = m.end, this.startUTC = this._timezoneManager.toUTC(this.start, this.timeZone), this.endUTC = this._timezoneManager.toUTC(this.end, this.endTimeZone), this.allDay = m.allDay, this.description = m.description, this.location = m.location, this.color = m.color, this.backgroundColor = m.backgroundColor, this.borderColor = m.borderColor, this.textColor = m.textColor, this.recurring = m.recurring, this.recurrenceRule = m.recurrenceRule, this._originalTimeZone = m.timeZone || null, this.status = m.status, this.visibility = m.visibility, this.organizer = m.organizer, this.attendees = [...m.attendees], this.reminders = [...m.reminders], this.categories = m.categories ? [...m.categories] : [], this.attachments = [...m.attachments], this.conferenceData = m.conferenceData, this.metadata = { ...m.metadata }, this._cache = {}, this._validateAttendees(), this._validateReminders();
|
|
1097
1097
|
}
|
|
1098
1098
|
/**
|
|
1099
1099
|
* Get event duration in milliseconds
|
|
@@ -5093,7 +5093,7 @@ class se {
|
|
|
5093
5093
|
return e;
|
|
5094
5094
|
}
|
|
5095
5095
|
}
|
|
5096
|
-
const
|
|
5096
|
+
const u = new se();
|
|
5097
5097
|
class ie {
|
|
5098
5098
|
constructor(e = {}) {
|
|
5099
5099
|
this.calendar = new te({
|
|
@@ -5173,51 +5173,51 @@ class ie {
|
|
|
5173
5173
|
(i) => e[i] !== t[i]
|
|
5174
5174
|
);
|
|
5175
5175
|
s.forEach((i) => {
|
|
5176
|
-
|
|
5176
|
+
u.emit(`state:${i}:changed`, {
|
|
5177
5177
|
oldValue: e[i],
|
|
5178
5178
|
newValue: t[i],
|
|
5179
5179
|
state: t
|
|
5180
5180
|
});
|
|
5181
|
-
}), s.length > 0 &&
|
|
5181
|
+
}), s.length > 0 && u.emit("state:changed", { oldState: e, newState: t, changedKeys: s });
|
|
5182
5182
|
}
|
|
5183
5183
|
// Calendar operations
|
|
5184
5184
|
setView(e) {
|
|
5185
|
-
this.calendar.setView(e), this.setState({ view: e }),
|
|
5185
|
+
this.calendar.setView(e), this.setState({ view: e }), u.emit("view:changed", { view: e });
|
|
5186
5186
|
}
|
|
5187
5187
|
getView() {
|
|
5188
5188
|
return this.state.view;
|
|
5189
5189
|
}
|
|
5190
5190
|
setDate(e) {
|
|
5191
|
-
this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }),
|
|
5191
|
+
this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), u.emit("date:changed", { date: this.state.currentDate });
|
|
5192
5192
|
}
|
|
5193
5193
|
getCurrentDate() {
|
|
5194
5194
|
return this.state.currentDate;
|
|
5195
5195
|
}
|
|
5196
5196
|
// Navigation
|
|
5197
5197
|
next() {
|
|
5198
|
-
this.calendar.next(), this.setState({ currentDate: this.calendar.getCurrentDate() }),
|
|
5198
|
+
this.calendar.next(), this.setState({ currentDate: this.calendar.getCurrentDate() }), u.emit("navigation:next", { date: this.state.currentDate });
|
|
5199
5199
|
}
|
|
5200
5200
|
previous() {
|
|
5201
|
-
this.calendar.previous(), this.setState({ currentDate: this.calendar.getCurrentDate() }),
|
|
5201
|
+
this.calendar.previous(), this.setState({ currentDate: this.calendar.getCurrentDate() }), u.emit("navigation:previous", { date: this.state.currentDate });
|
|
5202
5202
|
}
|
|
5203
5203
|
today() {
|
|
5204
|
-
this.calendar.today(), this.setState({ currentDate: this.calendar.getCurrentDate() }),
|
|
5204
|
+
this.calendar.today(), this.setState({ currentDate: this.calendar.getCurrentDate() }), u.emit("navigation:today", { date: this.state.currentDate });
|
|
5205
5205
|
}
|
|
5206
5206
|
goToDate(e) {
|
|
5207
|
-
this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }),
|
|
5207
|
+
this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), u.emit("navigation:goto", { date: this.state.currentDate });
|
|
5208
5208
|
}
|
|
5209
5209
|
// Event management
|
|
5210
5210
|
addEvent(e) {
|
|
5211
5211
|
const t = this.calendar.addEvent(e);
|
|
5212
|
-
return t ? (this._syncEventsFromCore(),
|
|
5212
|
+
return t ? (this._syncEventsFromCore(), u.emit("event:add", { event: t }), u.emit("event:added", { event: t }), t) : (console.error("Failed to add event to calendar"), u.emit("event:error", { action: "add", event: e, error: "Failed to add event" }), null);
|
|
5213
5213
|
}
|
|
5214
5214
|
updateEvent(e, t) {
|
|
5215
5215
|
this._syncEventsFromCore({ silent: !0 });
|
|
5216
5216
|
const s = this.calendar.updateEvent(e, t);
|
|
5217
|
-
return s ? (this._syncEventsFromCore(),
|
|
5217
|
+
return s ? (this._syncEventsFromCore(), u.emit("event:update", { event: s }), u.emit("event:updated", { event: s }), s) : (console.error(`Failed to update event: ${e}`), u.emit("event:error", { action: "update", eventId: e, updates: t, error: "Event not found in calendar" }), null);
|
|
5218
5218
|
}
|
|
5219
5219
|
deleteEvent(e) {
|
|
5220
|
-
return this._syncEventsFromCore({ silent: !0 }), this.calendar.removeEvent(e) ? (this._syncEventsFromCore(),
|
|
5220
|
+
return this._syncEventsFromCore({ silent: !0 }), this.calendar.removeEvent(e) ? (this._syncEventsFromCore(), u.emit("event:remove", { eventId: e }), u.emit("event:deleted", { eventId: e }), !0) : (console.error(`Failed to delete event: ${e}`), u.emit("event:error", { action: "delete", eventId: e, error: "Event not found" }), !1);
|
|
5221
5221
|
}
|
|
5222
5222
|
getEvents() {
|
|
5223
5223
|
return this.calendar.getEvents() || [];
|
|
@@ -5268,20 +5268,20 @@ class ie {
|
|
|
5268
5268
|
}
|
|
5269
5269
|
// Selection management
|
|
5270
5270
|
selectEvent(e) {
|
|
5271
|
-
this.setState({ selectedEvent: e }),
|
|
5271
|
+
this.setState({ selectedEvent: e }), u.emit("event:selected", { event: e });
|
|
5272
5272
|
}
|
|
5273
5273
|
selectEventById(e) {
|
|
5274
5274
|
const t = this.state.events.find((s) => s.id === e);
|
|
5275
5275
|
t && this.selectEvent(t);
|
|
5276
5276
|
}
|
|
5277
5277
|
deselectEvent() {
|
|
5278
|
-
this.setState({ selectedEvent: null }),
|
|
5278
|
+
this.setState({ selectedEvent: null }), u.emit("event:deselected", {});
|
|
5279
5279
|
}
|
|
5280
5280
|
selectDate(e) {
|
|
5281
|
-
this.setState({ selectedDate: e }),
|
|
5281
|
+
this.setState({ selectedDate: e }), u.emit("date:selected", { date: e });
|
|
5282
5282
|
}
|
|
5283
5283
|
deselectDate() {
|
|
5284
|
-
this.setState({ selectedDate: null }),
|
|
5284
|
+
this.setState({ selectedDate: null }), u.emit("date:deselected", {});
|
|
5285
5285
|
}
|
|
5286
5286
|
// Utility methods
|
|
5287
5287
|
isToday(e) {
|
|
@@ -5301,7 +5301,7 @@ class ie {
|
|
|
5301
5301
|
}
|
|
5302
5302
|
// Error handling
|
|
5303
5303
|
setError(e) {
|
|
5304
|
-
this.setState({ error: e }), e &&
|
|
5304
|
+
this.setState({ error: e }), e && u.emit("error", { error: e });
|
|
5305
5305
|
}
|
|
5306
5306
|
clearError() {
|
|
5307
5307
|
this.setState({ error: null });
|
|
@@ -6864,14 +6864,28 @@ class ne extends O {
|
|
|
6864
6864
|
this.stateManager = new ie(e), this.stateManager.subscribe(this.handleStateChange.bind(this)), this.setupEventListeners();
|
|
6865
6865
|
}
|
|
6866
6866
|
setupEventListeners() {
|
|
6867
|
-
this._busUnsubscribers.forEach((
|
|
6868
|
-
this.emit("calendar-navigate", { action:
|
|
6869
|
-
})), this._busUnsubscribers.push(
|
|
6870
|
-
this.emit("calendar-view-change",
|
|
6871
|
-
}))
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6867
|
+
this._busUnsubscribers.forEach((t) => t()), this._busUnsubscribers = [], this._busUnsubscribers.push(u.on("navigation:*", (t, s) => {
|
|
6868
|
+
this.emit("calendar-navigate", { action: s.split(":")[1], ...t });
|
|
6869
|
+
})), this._busUnsubscribers.push(u.on("view:changed", (t) => {
|
|
6870
|
+
this.emit("calendar-view-change", t);
|
|
6871
|
+
}));
|
|
6872
|
+
const e = (t, s) => {
|
|
6873
|
+
this.emit(`calendar-event-${t}`, s);
|
|
6874
|
+
};
|
|
6875
|
+
this._busUnsubscribers.push(u.on("event:add", (t) => {
|
|
6876
|
+
e("add", t);
|
|
6877
|
+
})), this._busUnsubscribers.push(u.on("event:update", (t) => {
|
|
6878
|
+
e("update", t);
|
|
6879
|
+
})), this._busUnsubscribers.push(u.on("event:remove", (t) => {
|
|
6880
|
+
e("remove", t);
|
|
6881
|
+
})), this._busUnsubscribers.push(u.on("event:added", (t) => {
|
|
6882
|
+
e("add", t), this.emit("calendar-event-added", t);
|
|
6883
|
+
})), this._busUnsubscribers.push(u.on("event:updated", (t) => {
|
|
6884
|
+
e("update", t), this.emit("calendar-event-updated", t);
|
|
6885
|
+
})), this._busUnsubscribers.push(u.on("event:deleted", (t) => {
|
|
6886
|
+
e("remove", t), this.emit("calendar-event-deleted", t);
|
|
6887
|
+
})), this._busUnsubscribers.push(u.on("date:selected", (t) => {
|
|
6888
|
+
this.emit("calendar-date-select", t);
|
|
6875
6889
|
}));
|
|
6876
6890
|
}
|
|
6877
6891
|
handleStateChange(e, t) {
|
|
@@ -7543,6 +7557,6 @@ export {
|
|
|
7543
7557
|
ie as StateManager,
|
|
7544
7558
|
x as StyleUtils,
|
|
7545
7559
|
z as WeekViewRenderer,
|
|
7546
|
-
|
|
7560
|
+
u as eventBus
|
|
7547
7561
|
};
|
|
7548
7562
|
//# sourceMappingURL=force-calendar-interface.esm.js.map
|