@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.
@@ -1,6 +1,6 @@
1
1
  var W = Object.defineProperty;
2
- var j = (u, e, t) => e in u ? W(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
- var I = (u, e, t) => j(u, typeof e != "symbol" ? e + "" : e, t);
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 g = w.normalize({
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(g), this.id = g.id, this.title = g.title, this._timezoneManager = C.getInstance(), this.timeZone = g.timeZone || this._timezoneManager.getSystemTimezone(), this.endTimeZone = g.endTimeZone || this.timeZone, this.start = g.start, this.end = g.end, this.startUTC = this._timezoneManager.toUTC(this.start, this.timeZone), this.endUTC = this._timezoneManager.toUTC(this.end, this.endTimeZone), this.allDay = g.allDay, this.description = g.description, this.location = g.location, this.color = g.color, this.backgroundColor = g.backgroundColor, this.borderColor = g.borderColor, this.textColor = g.textColor, this.recurring = g.recurring, this.recurrenceRule = g.recurrenceRule, this._originalTimeZone = g.timeZone || null, this.status = g.status, this.visibility = g.visibility, this.organizer = g.organizer, this.attendees = [...g.attendees], this.reminders = [...g.reminders], this.categories = g.categories ? [...g.categories] : [], this.attachments = [...g.attachments], this.conferenceData = g.conferenceData, this.metadata = { ...g.metadata }, this._cache = {}, this._validateAttendees(), this._validateReminders();
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 m = new se();
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
- m.emit(`state:${i}:changed`, {
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 && m.emit("state:changed", { oldState: e, newState: t, changedKeys: s });
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 }), m.emit("view:changed", { 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() }), m.emit("date:changed", { date: this.state.currentDate });
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() }), m.emit("navigation:next", { date: this.state.currentDate });
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() }), m.emit("navigation:previous", { date: this.state.currentDate });
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() }), m.emit("navigation:today", { date: this.state.currentDate });
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() }), m.emit("navigation:goto", { date: this.state.currentDate });
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(), m.emit("event:added", { event: t }), t) : (console.error("Failed to add event to calendar"), m.emit("event:error", { action: "add", event: e, error: "Failed to add event" }), null);
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(), m.emit("event:updated", { event: s }), s) : (console.error(`Failed to update event: ${e}`), m.emit("event:error", { action: "update", eventId: e, updates: t, error: "Event not found in calendar" }), null);
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(), m.emit("event:deleted", { eventId: e }), !0) : (console.error(`Failed to delete event: ${e}`), m.emit("event:error", { action: "delete", eventId: e, error: "Event not found" }), !1);
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 }), m.emit("event:selected", { event: 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 }), m.emit("event:deselected", {});
5278
+ this.setState({ selectedEvent: null }), u.emit("event:deselected", {});
5279
5279
  }
5280
5280
  selectDate(e) {
5281
- this.setState({ selectedDate: e }), m.emit("date:selected", { date: e });
5281
+ this.setState({ selectedDate: e }), u.emit("date:selected", { date: e });
5282
5282
  }
5283
5283
  deselectDate() {
5284
- this.setState({ selectedDate: null }), m.emit("date:deselected", {});
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 && m.emit("error", { error: 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((e) => e()), this._busUnsubscribers = [], this._busUnsubscribers.push(m.on("navigation:*", (e, t) => {
6868
- this.emit("calendar-navigate", { action: t.split(":")[1], ...e });
6869
- })), this._busUnsubscribers.push(m.on("view:changed", (e) => {
6870
- this.emit("calendar-view-change", e);
6871
- })), this._busUnsubscribers.push(m.on("event:*", (e, t) => {
6872
- this.emit(`calendar-event-${t.split(":")[1]}`, e);
6873
- })), this._busUnsubscribers.push(m.on("date:selected", (e) => {
6874
- this.emit("calendar-date-select", e);
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
- m as eventBus
7560
+ u as eventBus
7547
7561
  };
7548
7562
  //# sourceMappingURL=force-calendar-interface.esm.js.map