@forcecalendar/interface 1.0.25 → 1.0.26

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.
@@ -5315,7 +5315,7 @@ class ie {
5315
5315
  this.subscribers.clear(), this._subscriberIds && (this._subscriberIds.clear(), this._subscriberIds = null), this.state = null, this.calendar = null;
5316
5316
  }
5317
5317
  }
5318
- class S extends f {
5318
+ class E extends f {
5319
5319
  /**
5320
5320
  * Format date for display
5321
5321
  */
@@ -6210,16 +6210,16 @@ class H {
6210
6210
  * Attach common event handlers for day/event clicks
6211
6211
  */
6212
6212
  attachCommonEventHandlers() {
6213
- this.container.querySelectorAll(".fc-event").forEach((e) => {
6214
- this.addListener(e, "click", (t) => {
6215
- t.stopPropagation();
6216
- const s = e.dataset.eventId, i = this.stateManager.getEvents().find((r) => r.id === s);
6217
- i && this.stateManager.selectEvent(i);
6218
- });
6213
+ this.addListener(this.container, "click", (e) => {
6214
+ const t = e.target.closest(".fc-event");
6215
+ if (!t || !this.container.contains(t)) return;
6216
+ e.stopPropagation();
6217
+ const s = t.dataset.eventId, i = this.stateManager.getEvents().find((r) => r.id === s);
6218
+ i && this.stateManager.selectEvent(i);
6219
6219
  });
6220
6220
  }
6221
6221
  }
6222
- class E extends H {
6222
+ class S extends H {
6223
6223
  constructor(e, t) {
6224
6224
  super(e, t), this.maxEventsToShow = 3;
6225
6225
  }
@@ -6286,12 +6286,11 @@ class E extends H {
6286
6286
  `;
6287
6287
  }
6288
6288
  _attachEventHandlers() {
6289
- this.container.querySelectorAll(".fc-month-day").forEach((e) => {
6290
- this.addListener(e, "click", (t) => {
6291
- if (t.target.closest(".fc-event")) return;
6292
- const s = new Date(e.dataset.date);
6293
- this.stateManager.selectDate(s);
6294
- });
6289
+ this.addListener(this.container, "click", (e) => {
6290
+ const t = e.target.closest(".fc-month-day");
6291
+ if (!t || !this.container.contains(t) || e.target.closest(".fc-event")) return;
6292
+ const s = new Date(t.dataset.date);
6293
+ this.stateManager.selectDate(s);
6295
6294
  }), this.attachCommonEventHandlers();
6296
6295
  }
6297
6296
  }
@@ -6403,12 +6402,11 @@ class z extends H {
6403
6402
  `;
6404
6403
  }
6405
6404
  _attachEventHandlers() {
6406
- this.container.querySelectorAll(".fc-week-day-column").forEach((e) => {
6407
- this.addListener(e, "click", (t) => {
6408
- if (t.target.closest(".fc-event")) return;
6409
- const s = new Date(e.dataset.date), i = e.getBoundingClientRect(), r = this.container.querySelector("#week-scroll-container"), n = t.clientY - i.top + (r ? r.scrollTop : 0);
6410
- s.setHours(Math.floor(n / this.hourHeight), Math.floor(n % this.hourHeight / (this.hourHeight / 60)), 0, 0), this.stateManager.selectDate(s);
6411
- });
6405
+ this.addListener(this.container, "click", (e) => {
6406
+ const t = e.target.closest(".fc-week-day-column");
6407
+ if (!t || !this.container.contains(t) || e.target.closest(".fc-event")) return;
6408
+ const s = new Date(t.dataset.date), i = t.getBoundingClientRect(), r = this.container.querySelector("#week-scroll-container"), n = e.clientY - i.top + (r ? r.scrollTop : 0);
6409
+ s.setHours(Math.floor(n / this.hourHeight), Math.floor(n % this.hourHeight / (this.hourHeight / 60)), 0, 0), this.stateManager.selectDate(s);
6412
6410
  }), this.attachCommonEventHandlers();
6413
6411
  }
6414
6412
  _scrollToCurrentTime() {
@@ -6536,12 +6534,11 @@ class L extends H {
6536
6534
  `;
6537
6535
  }
6538
6536
  _attachEventHandlers() {
6539
- this.container.querySelectorAll(".fc-day-column").forEach((e) => {
6540
- this.addListener(e, "click", (t) => {
6541
- if (t.target.closest(".fc-event")) return;
6542
- const s = new Date(e.dataset.date), i = e.getBoundingClientRect(), r = this.container.querySelector("#day-scroll-container"), n = t.clientY - i.top + (r ? r.scrollTop : 0);
6543
- s.setHours(Math.floor(n / this.hourHeight), Math.floor(n % this.hourHeight / (this.hourHeight / 60)), 0, 0), this.stateManager.selectDate(s);
6544
- });
6537
+ this.addListener(this.container, "click", (e) => {
6538
+ const t = e.target.closest(".fc-day-column");
6539
+ if (!t || !this.container.contains(t) || e.target.closest(".fc-event")) return;
6540
+ const s = new Date(t.dataset.date), i = t.getBoundingClientRect(), r = this.container.querySelector("#day-scroll-container"), n = e.clientY - i.top + (r ? r.scrollTop : 0);
6541
+ s.setHours(Math.floor(n / this.hourHeight), Math.floor(n % this.hourHeight / (this.hourHeight / 60)), 0, 0), this.stateManager.selectDate(s);
6545
6542
  }), this.attachCommonEventHandlers();
6546
6543
  }
6547
6544
  _scrollToCurrentTime() {
@@ -6940,10 +6937,10 @@ class ne extends O {
6940
6937
  this._currentViewInstance && this._currentViewInstance.cleanup && this._currentViewInstance.cleanup();
6941
6938
  try {
6942
6939
  const s = {
6943
- month: E,
6940
+ month: S,
6944
6941
  week: z,
6945
6942
  day: L
6946
- }[this.currentView] || E, i = new s(e, this.stateManager);
6943
+ }[this.currentView] || S, i = new s(e, this.stateManager);
6947
6944
  i._viewType = this.currentView, this._currentViewInstance = i, i.render();
6948
6945
  } catch (t) {
6949
6946
  console.error("[ForceCalendar] Error switching view:", t);
@@ -7428,10 +7425,10 @@ class ne extends O {
7428
7425
  this._currentViewInstance && (this._currentViewInstance.cleanup && this._currentViewInstance.cleanup(), this._viewUnsubscribe && (this._viewUnsubscribe(), this._viewUnsubscribe = null));
7429
7426
  try {
7430
7427
  const r = {
7431
- month: E,
7428
+ month: S,
7432
7429
  week: z,
7433
7430
  day: L
7434
- }[this.currentView] || E, n = new r(e, this.stateManager);
7431
+ }[this.currentView] || S, n = new r(e, this.stateManager);
7435
7432
  n._viewType = this.currentView, this._currentViewInstance = n, n.render();
7436
7433
  } catch (i) {
7437
7434
  console.error("[ForceCalendar] Error creating/rendering view:", i);
@@ -7463,10 +7460,10 @@ class ne extends O {
7463
7460
  */
7464
7461
  _createViewRenderer(e) {
7465
7462
  const s = {
7466
- month: E,
7463
+ month: S,
7467
7464
  week: z,
7468
7465
  day: L
7469
- }[e] || E;
7466
+ }[e] || S;
7470
7467
  return new s(null, null);
7471
7468
  }
7472
7469
  handleNavigation(e) {
@@ -7490,14 +7487,14 @@ class ne extends O {
7490
7487
  const s = this.stateManager.state.config.locale;
7491
7488
  switch (t) {
7492
7489
  case "month":
7493
- return S.formatDate(e, "month", s);
7490
+ return E.formatDate(e, "month", s);
7494
7491
  case "week":
7495
- const i = S.startOfWeek(e), r = S.endOfWeek(e);
7496
- return S.formatDateRange(i, r, s);
7492
+ const i = E.startOfWeek(e), r = E.endOfWeek(e);
7493
+ return E.formatDateRange(i, r, s);
7497
7494
  case "day":
7498
- return S.formatDate(e, "long", s);
7495
+ return E.formatDate(e, "long", s);
7499
7496
  default:
7500
- return S.formatDate(e, "month", s);
7497
+ return E.formatDate(e, "month", s);
7501
7498
  }
7502
7499
  }
7503
7500
  getIcon(e) {
@@ -7557,11 +7554,11 @@ export {
7557
7554
  O as BaseComponent,
7558
7555
  H as BaseViewRenderer,
7559
7556
  F as DOMUtils,
7560
- S as DateUtils,
7557
+ E as DateUtils,
7561
7558
  L as DayViewRenderer,
7562
7559
  se as EventBus,
7563
7560
  ne as ForceCalendar,
7564
- E as MonthViewRenderer,
7561
+ S as MonthViewRenderer,
7565
7562
  ie as StateManager,
7566
7563
  D as StyleUtils,
7567
7564
  z as WeekViewRenderer,