@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.
package/package.json
CHANGED
|
@@ -93,10 +93,14 @@ export class ForceCalendar extends BaseComponent {
|
|
|
93
93
|
const errorChanged = newState.error !== oldState?.error;
|
|
94
94
|
|
|
95
95
|
// For loading/error state changes, do full re-render (rare)
|
|
96
|
-
if (
|
|
96
|
+
if (errorChanged) {
|
|
97
97
|
this.render();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
+
if (loadingChanged) {
|
|
101
|
+
this._updateLoadingState(newState.loading);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
100
104
|
|
|
101
105
|
// Update local view reference if needed
|
|
102
106
|
if (viewChanged) {
|
|
@@ -184,15 +188,31 @@ export class ForceCalendar extends BaseComponent {
|
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Toggle loading overlay without rebuilding the component tree.
|
|
193
|
+
*/
|
|
194
|
+
_updateLoadingState(isLoading) {
|
|
195
|
+
const loadingEl = this.$('.fc-loading');
|
|
196
|
+
const viewContainer = this.$('.fc-view-container');
|
|
197
|
+
if (loadingEl) {
|
|
198
|
+
loadingEl.style.display = isLoading ? 'flex' : 'none';
|
|
199
|
+
}
|
|
200
|
+
if (viewContainer) {
|
|
201
|
+
viewContainer.style.display = isLoading ? 'none' : 'flex';
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
187
205
|
mount() {
|
|
206
|
+
this.currentView = this.stateManager.getView();
|
|
188
207
|
super.mount();
|
|
189
|
-
this.loadView(this.stateManager.getView());
|
|
190
208
|
}
|
|
191
209
|
|
|
192
210
|
loadView(viewType) {
|
|
193
|
-
|
|
211
|
+
if (!viewType || this.currentView === viewType) return;
|
|
194
212
|
this.currentView = viewType;
|
|
195
|
-
this.
|
|
213
|
+
this._switchView();
|
|
214
|
+
this._updateViewButtons();
|
|
215
|
+
this._updateTitle();
|
|
196
216
|
}
|
|
197
217
|
|
|
198
218
|
getStyles() {
|
|
@@ -637,16 +657,13 @@ export class ForceCalendar extends BaseComponent {
|
|
|
637
657
|
</header>
|
|
638
658
|
|
|
639
659
|
<div class="fc-body">
|
|
640
|
-
${loading ?
|
|
641
|
-
<div class="fc-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
${this.renderView()}
|
|
648
|
-
</div>
|
|
649
|
-
`}
|
|
660
|
+
<div class="fc-loading" style="display: ${loading ? 'flex' : 'none'};">
|
|
661
|
+
<div class="fc-spinner"></div>
|
|
662
|
+
<span>Loading...</span>
|
|
663
|
+
</div>
|
|
664
|
+
<div class="fc-view-container" style="display: ${loading ? 'none' : 'flex'};">
|
|
665
|
+
${this.renderView()}
|
|
666
|
+
</div>
|
|
650
667
|
</div>
|
|
651
668
|
|
|
652
669
|
<forcecal-event-form id="event-modal"></forcecal-event-form>
|