@forcecalendar/interface 1.0.22 → 1.0.23

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
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 _ = (u, e, t) => j(u, typeof e != "symbol" ? e + "" : e, t);
3
+ var I = (u, e, t) => j(u, 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;
@@ -1049,7 +1049,7 @@ class w {
1049
1049
  status: D = "confirmed",
1050
1050
  visibility: T = "public",
1051
1051
  organizer: A = null,
1052
- attendees: I = [],
1052
+ attendees: _ = [],
1053
1053
  reminders: R = [],
1054
1054
  category: B,
1055
1055
  // Support singular category (no default)
@@ -1081,7 +1081,7 @@ class w {
1081
1081
  status: D,
1082
1082
  visibility: T,
1083
1083
  organizer: A,
1084
- attendees: I,
1084
+ attendees: _,
1085
1085
  reminders: R,
1086
1086
  category: B,
1087
1087
  // Pass category to normalize
@@ -2239,8 +2239,8 @@ class K {
2239
2239
  if (h >= t) {
2240
2240
  const D = new Date(h), T = new Date(h.getTime() + o), A = l.getTimezoneOffset(D, c);
2241
2241
  if (A !== p) {
2242
- const I = p - A;
2243
- D.setMinutes(D.getMinutes() + I), T.setMinutes(T.getMinutes() + I);
2242
+ const _ = p - A;
2243
+ D.setMinutes(D.getMinutes() + _), T.setMinutes(T.getMinutes() + _);
2244
2244
  }
2245
2245
  p = A, this.isException(D, n, e.id) || a.push({
2246
2246
  start: D,
@@ -5961,7 +5961,7 @@ class x {
5961
5961
  /**
5962
5962
  * Default theme colors
5963
5963
  */
5964
- _(x, "colors", {
5964
+ I(x, "colors", {
5965
5965
  primary: "#3B82F6",
5966
5966
  // Modern Blue
5967
5967
  secondary: "#64748B",
@@ -5994,7 +5994,7 @@ _(x, "colors", {
5994
5994
  }), /**
5995
5995
  * Common CSS variables
5996
5996
  */
5997
- _(x, "cssVariables", {
5997
+ I(x, "cssVariables", {
5998
5998
  // "Pro" Palette - Functional & Sharp
5999
5999
  "--fc-primary-color": "#2563EB",
6000
6000
  // International Blue (Focus)
@@ -6062,7 +6062,7 @@ _(x, "cssVariables", {
6062
6062
  }), /**
6063
6063
  * Get responsive breakpoints
6064
6064
  */
6065
- _(x, "breakpoints", {
6065
+ I(x, "breakpoints", {
6066
6066
  xs: "320px",
6067
6067
  sm: "576px",
6068
6068
  md: "768px",
@@ -6878,11 +6878,15 @@ class ne extends O {
6878
6878
  var o, c;
6879
6879
  if (!this._hasRendered)
6880
6880
  return;
6881
- const s = e.view !== (t == null ? void 0 : t.view), i = ((o = e.currentDate) == null ? void 0 : o.getTime()) !== ((c = t == null ? void 0 : t.currentDate) == null ? void 0 : c.getTime()), r = e.events !== (t == null ? void 0 : t.events), n = e.loading !== (t == null ? void 0 : t.loading), a = e.error !== (t == null ? void 0 : t.error);
6882
- if (n || a) {
6881
+ const s = e.view !== (t == null ? void 0 : t.view), i = ((o = e.currentDate) == null ? void 0 : o.getTime()) !== ((c = t == null ? void 0 : t.currentDate) == null ? void 0 : c.getTime()), r = e.events !== (t == null ? void 0 : t.events), n = e.loading !== (t == null ? void 0 : t.loading);
6882
+ if (e.error !== (t == null ? void 0 : t.error)) {
6883
6883
  this.render();
6884
6884
  return;
6885
6885
  }
6886
+ if (n) {
6887
+ this._updateLoadingState(e.loading);
6888
+ return;
6889
+ }
6886
6890
  s && (this.currentView = e.view), s ? (this._updateTitle(), this._updateViewButtons(), this._switchView()) : i ? (this._updateTitle(), this._updateViewContent()) : r && this._updateViewContent();
6887
6891
  }
6888
6892
  /**
@@ -6930,11 +6934,18 @@ class ne extends O {
6930
6934
  _updateViewContent() {
6931
6935
  this._currentViewInstance && this._currentViewInstance.render && this._currentViewInstance.render();
6932
6936
  }
6937
+ /**
6938
+ * Toggle loading overlay without rebuilding the component tree.
6939
+ */
6940
+ _updateLoadingState(e) {
6941
+ const t = this.$(".fc-loading"), s = this.$(".fc-view-container");
6942
+ t && (t.style.display = e ? "flex" : "none"), s && (s.style.display = e ? "none" : "flex");
6943
+ }
6933
6944
  mount() {
6934
- super.mount(), this.loadView(this.stateManager.getView());
6945
+ this.currentView = this.stateManager.getView(), super.mount();
6935
6946
  }
6936
6947
  loadView(e) {
6937
- this.currentView = e, this.render();
6948
+ !e || this.currentView === e || (this.currentView = e, this._switchView(), this._updateViewButtons(), this._updateTitle());
6938
6949
  }
6939
6950
  getStyles() {
6940
6951
  const e = this.getAttribute("height") || "800px";
@@ -7371,16 +7382,13 @@ class ne extends O {
7371
7382
  </header>
7372
7383
 
7373
7384
  <div class="fc-body">
7374
- ${i ? `
7375
- <div class="fc-loading">
7376
- <div class="fc-spinner"></div>
7377
- <span>Loading...</span>
7378
- </div>
7379
- ` : `
7380
- <div class="fc-view-container">
7381
- ${this.renderView()}
7382
- </div>
7383
- `}
7385
+ <div class="fc-loading" style="display: ${i ? "flex" : "none"};">
7386
+ <div class="fc-spinner"></div>
7387
+ <span>Loading...</span>
7388
+ </div>
7389
+ <div class="fc-view-container" style="display: ${i ? "none" : "flex"};">
7390
+ ${this.renderView()}
7391
+ </div>
7384
7392
  </div>
7385
7393
 
7386
7394
  <forcecal-event-form id="event-modal"></forcecal-event-form>