@forcecalendar/interface 1.0.24 → 1.0.25

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.
@@ -1046,7 +1046,7 @@ class w {
1046
1046
  // Backward-compatible alias for recurrenceRule
1047
1047
  timeZone: v = null,
1048
1048
  endTimeZone: M = null,
1049
- status: D = "confirmed",
1049
+ status: x = "confirmed",
1050
1050
  visibility: T = "public",
1051
1051
  organizer: A = null,
1052
1052
  attendees: _ = [],
@@ -1078,7 +1078,7 @@ class w {
1078
1078
  recurrence: b,
1079
1079
  timeZone: v,
1080
1080
  endTimeZone: M,
1081
- status: D,
1081
+ status: x,
1082
1082
  visibility: T,
1083
1083
  organizer: A,
1084
1084
  attendees: _,
@@ -2237,13 +2237,13 @@ class K {
2237
2237
  const v = 3;
2238
2238
  for (; h <= s && d < i; ) {
2239
2239
  if (h >= t) {
2240
- const D = new Date(h), T = new Date(h.getTime() + o), A = l.getTimezoneOffset(D, c);
2240
+ const x = new Date(h), T = new Date(h.getTime() + o), A = l.getTimezoneOffset(x, c);
2241
2241
  if (A !== p) {
2242
2242
  const _ = p - A;
2243
- D.setMinutes(D.getMinutes() + _), T.setMinutes(T.getMinutes() + _);
2243
+ x.setMinutes(x.getMinutes() + _), T.setMinutes(T.getMinutes() + _);
2244
2244
  }
2245
- p = A, this.isException(D, n, e.id) || a.push({
2246
- start: D,
2245
+ p = A, this.isException(x, n, e.id) || a.push({
2246
+ start: x,
2247
2247
  end: T,
2248
2248
  recurringEventId: e.id,
2249
2249
  timezone: c,
@@ -4749,12 +4749,12 @@ class te {
4749
4749
  days: []
4750
4750
  };
4751
4751
  for (let b = 0; b < 7; b++) {
4752
- const v = new Date(l), M = v.getMonth() === s, D = f.isToday(v), T = v.getDay() === 0 || v.getDay() === 6;
4752
+ const v = new Date(l), M = v.getMonth() === s, x = f.isToday(v), T = v.getDay() === 0 || v.getDay() === 6;
4753
4753
  p.days.push({
4754
4754
  date: v,
4755
4755
  dayOfMonth: v.getDate(),
4756
4756
  isCurrentMonth: M,
4757
- isToday: D,
4757
+ isToday: x,
4758
4758
  isWeekend: T,
4759
4759
  events: this.getEventsForDate(v)
4760
4760
  }), l = f.addDays(l, 1);
@@ -5624,7 +5624,7 @@ class F {
5624
5624
  return e.addEventListener("keydown", r), s == null || s.focus(), () => e.removeEventListener("keydown", r);
5625
5625
  }
5626
5626
  }
5627
- class x {
5627
+ class D {
5628
5628
  /**
5629
5629
  * Get CSS variable value
5630
5630
  */
@@ -5961,7 +5961,7 @@ class x {
5961
5961
  /**
5962
5962
  * Default theme colors
5963
5963
  */
5964
- I(x, "colors", {
5964
+ I(D, "colors", {
5965
5965
  primary: "#3B82F6",
5966
5966
  // Modern Blue
5967
5967
  secondary: "#64748B",
@@ -5994,7 +5994,7 @@ I(x, "colors", {
5994
5994
  }), /**
5995
5995
  * Common CSS variables
5996
5996
  */
5997
- I(x, "cssVariables", {
5997
+ I(D, "cssVariables", {
5998
5998
  // "Pro" Palette - Functional & Sharp
5999
5999
  "--fc-primary-color": "#2563EB",
6000
6000
  // International Blue (Focus)
@@ -6062,7 +6062,7 @@ I(x, "cssVariables", {
6062
6062
  }), /**
6063
6063
  * Get responsive breakpoints
6064
6064
  */
6065
- I(x, "breakpoints", {
6065
+ I(D, "breakpoints", {
6066
6066
  xs: "320px",
6067
6067
  sm: "576px",
6068
6068
  md: "768px",
@@ -6179,7 +6179,7 @@ class H {
6179
6179
  * @returns {string} HTML string
6180
6180
  */
6181
6181
  renderTimedEvent(e, t = {}) {
6182
- const { compact: s = !0 } = t, i = new Date(e.start), r = new Date(e.end), n = i.getHours() * 60 + i.getMinutes(), a = Math.max((r - i) / (1e3 * 60), s ? 20 : 30), o = e.backgroundColor || "#2563eb", c = s ? "4px 8px" : "8px 12px", l = s ? "11px" : "13px", h = s ? "2px" : "12px", d = s ? "2px" : "24px", p = s ? "4px" : "6px";
6182
+ const { compact: s = !0 } = t, i = new Date(e.start), r = new Date(e.end), n = i.getHours() * 60 + i.getMinutes(), a = Math.max((r - i) / (1e3 * 60), s ? 20 : 30), o = this.getEventColor(e), c = s ? "4px 8px" : "8px 12px", l = s ? "11px" : "13px", h = s ? "2px" : "12px", d = s ? "2px" : "24px", p = s ? "4px" : "6px";
6183
6183
  return `
6184
6184
  <div class="fc-event fc-timed-event" data-event-id="${this.escapeHTML(e.id)}"
6185
6185
  style="position: absolute; top: ${n}px; height: ${a}px;
@@ -6198,6 +6198,14 @@ class H {
6198
6198
  </div>
6199
6199
  `;
6200
6200
  }
6201
+ /**
6202
+ * Get a safe, sanitized event color value.
6203
+ * @param {Object} event
6204
+ * @returns {string}
6205
+ */
6206
+ getEventColor(e) {
6207
+ return D.sanitizeColor(e == null ? void 0 : e.backgroundColor, "#2563eb");
6208
+ }
6201
6209
  /**
6202
6210
  * Attach common event handlers for day/event clicks
6203
6211
  */
@@ -6269,7 +6277,7 @@ class E extends H {
6269
6277
  `;
6270
6278
  }
6271
6279
  _renderEvent(e) {
6272
- const t = e.backgroundColor || "#2563eb";
6280
+ const t = this.getEventColor(e);
6273
6281
  return `
6274
6282
  <div class="fc-event" data-event-id="${this.escapeHTML(e.id)}"
6275
6283
  style="background-color: ${t}; font-size: 11px; padding: 2px 6px; border-radius: 3px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;">
@@ -6350,7 +6358,7 @@ class z extends H {
6350
6358
  <div class="fc-all-day-cell" data-date="${t.date.toISOString()}" style="border-right: 1px solid #e5e7eb; padding: 4px; display: flex; flex-direction: column; gap: 2px;">
6351
6359
  ${t.allDayEvents.map((s) => `
6352
6360
  <div class="fc-event fc-all-day-event" data-event-id="${this.escapeHTML(s.id)}"
6353
- style="background-color: ${s.backgroundColor || "#2563eb"}; font-size: 10px; padding: 2px 4px; border-radius: 2px; color: white; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
6361
+ style="background-color: ${this.getEventColor(s)}; font-size: 10px; padding: 2px 4px; border-radius: 2px; color: white; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
6354
6362
  ${this.escapeHTML(s.title)}
6355
6363
  </div>
6356
6364
  `).join("")}
@@ -6484,7 +6492,7 @@ class L extends H {
6484
6492
  <div class="fc-all-day-cell" data-date="${t.toISOString()}" style="padding: 6px 12px; display: flex; flex-wrap: wrap; gap: 4px;">
6485
6493
  ${e.map((s) => `
6486
6494
  <div class="fc-event fc-all-day-event" data-event-id="${this.escapeHTML(s.id)}"
6487
- style="background-color: ${s.backgroundColor || "#2563eb"}; font-size: 12px; padding: 4px 8px; border-radius: 4px; color: white; cursor: pointer; font-weight: 500;">
6495
+ style="background-color: ${this.getEventColor(s)}; font-size: 12px; padding: 4px 8px; border-radius: 4px; color: white; cursor: pointer; font-weight: 500;">
6488
6496
  ${this.escapeHTML(s.title)}
6489
6497
  </div>
6490
6498
  `).join("")}
@@ -6572,8 +6580,8 @@ class re extends O {
6572
6580
  }
6573
6581
  getStyles() {
6574
6582
  return `
6575
- ${x.getBaseStyles()}
6576
- ${x.getButtonStyles()}
6583
+ ${D.getBaseStyles()}
6584
+ ${D.getButtonStyles()}
6577
6585
 
6578
6586
  :host {
6579
6587
  display: none;
@@ -6964,10 +6972,10 @@ class ne extends O {
6964
6972
  getStyles() {
6965
6973
  const e = this.getAttribute("height") || "800px";
6966
6974
  return `
6967
- ${x.getBaseStyles()}
6968
- ${x.getButtonStyles()}
6969
- ${x.getGridStyles()}
6970
- ${x.getAnimations()}
6975
+ ${D.getBaseStyles()}
6976
+ ${D.getButtonStyles()}
6977
+ ${D.getGridStyles()}
6978
+ ${D.getAnimations()}
6971
6979
 
6972
6980
  :host {
6973
6981
  --calendar-height: ${e};
@@ -7555,7 +7563,7 @@ export {
7555
7563
  ne as ForceCalendar,
7556
7564
  E as MonthViewRenderer,
7557
7565
  ie as StateManager,
7558
- x as StyleUtils,
7566
+ D as StyleUtils,
7559
7567
  z as WeekViewRenderer,
7560
7568
  u as eventBus
7561
7569
  };