@forcecalendar/interface 1.0.42 → 1.0.43
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
|
-
var
|
|
2
|
-
var F = (h, e, t) => e in h ?
|
|
3
|
-
var
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var F = (h, e, t) => e in h ? C(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t;
|
|
3
|
+
var g = (h, e, t) => F(h, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { Calendar as H, DateUtils as L } from "@forcecalendar/core";
|
|
5
5
|
class M extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -253,7 +253,7 @@ class T {
|
|
|
253
253
|
return e;
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
const
|
|
256
|
+
const j = new T();
|
|
257
257
|
class V {
|
|
258
258
|
constructor(e = {}) {
|
|
259
259
|
this.eventBus = new T(), this.calendar = new H({
|
|
@@ -604,7 +604,7 @@ class p extends L {
|
|
|
604
604
|
return i && (i.toLowerCase() === "pm" && n < 12 ? a = n + 12 : i.toLowerCase() === "am" && n === 12 && (a = 0)), r.setHours(a, o || 0, 0, 0), r;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
class
|
|
607
|
+
class E {
|
|
608
608
|
/**
|
|
609
609
|
* Create element with attributes and children
|
|
610
610
|
*/
|
|
@@ -1136,7 +1136,7 @@ class u {
|
|
|
1136
1136
|
/**
|
|
1137
1137
|
* Default theme colors
|
|
1138
1138
|
*/
|
|
1139
|
-
|
|
1139
|
+
g(u, "colors", {
|
|
1140
1140
|
primary: "#3B82F6",
|
|
1141
1141
|
// Modern Blue
|
|
1142
1142
|
secondary: "#64748B",
|
|
@@ -1169,7 +1169,7 @@ v(u, "colors", {
|
|
|
1169
1169
|
}), /**
|
|
1170
1170
|
* Common CSS variables
|
|
1171
1171
|
*/
|
|
1172
|
-
|
|
1172
|
+
g(u, "cssVariables", {
|
|
1173
1173
|
// "Pro" Palette - Functional & Sharp
|
|
1174
1174
|
"--fc-primary-color": "#2563EB",
|
|
1175
1175
|
// International Blue (Focus)
|
|
@@ -1237,7 +1237,7 @@ v(u, "cssVariables", {
|
|
|
1237
1237
|
}), /**
|
|
1238
1238
|
* Get responsive breakpoints
|
|
1239
1239
|
*/
|
|
1240
|
-
|
|
1240
|
+
g(u, "breakpoints", {
|
|
1241
1241
|
xs: "320px",
|
|
1242
1242
|
sm: "576px",
|
|
1243
1243
|
md: "768px",
|
|
@@ -1245,7 +1245,7 @@ v(u, "breakpoints", {
|
|
|
1245
1245
|
xl: "1200px",
|
|
1246
1246
|
"2xl": "1400px"
|
|
1247
1247
|
});
|
|
1248
|
-
class
|
|
1248
|
+
class k {
|
|
1249
1249
|
/**
|
|
1250
1250
|
* @param {HTMLElement} container - The DOM element to render into
|
|
1251
1251
|
* @param {StateManager} stateManager - The state manager instance
|
|
@@ -1284,7 +1284,7 @@ class E {
|
|
|
1284
1284
|
* @returns {string}
|
|
1285
1285
|
*/
|
|
1286
1286
|
escapeHTML(e) {
|
|
1287
|
-
return e == null ? "" :
|
|
1287
|
+
return e == null ? "" : E.escapeHTML(String(e));
|
|
1288
1288
|
}
|
|
1289
1289
|
/**
|
|
1290
1290
|
* Check if a date is today
|
|
@@ -1395,8 +1395,8 @@ class E {
|
|
|
1395
1395
|
const { compact: r = !0, overlapLayout: s = null } = t, i = new Date(e.start), n = new Date(e.end), o = i.getHours() * 60 + i.getMinutes(), a = Math.max((n - i) / (1e3 * 60), r ? 20 : 30), c = this.getEventColor(e), d = r ? "4px 8px" : "8px 12px", l = r ? "11px" : "13px", f = r ? 2 : 12, m = r ? 2 : 24, b = r ? "4px" : "6px";
|
|
1396
1396
|
let y, x;
|
|
1397
1397
|
if (s && s.has(e.id)) {
|
|
1398
|
-
const { column:
|
|
1399
|
-
y = `calc(${f}px + ${
|
|
1398
|
+
const { column: S, totalColumns: _ } = s.get(e.id), $ = `(100% - ${f + m}px)`;
|
|
1399
|
+
y = `calc(${f}px + ${S} * ${$} / ${_})`, x = `calc(${$} / ${_})`;
|
|
1400
1400
|
} else
|
|
1401
1401
|
y = `${f}px`, x = `calc(100% - ${f + m}px)`;
|
|
1402
1402
|
return `
|
|
@@ -1438,7 +1438,7 @@ class E {
|
|
|
1438
1438
|
});
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
class
|
|
1441
|
+
class w extends k {
|
|
1442
1442
|
constructor(e, t) {
|
|
1443
1443
|
super(e, t), this.maxEventsToShow = 3;
|
|
1444
1444
|
}
|
|
@@ -1513,7 +1513,7 @@ class g extends E {
|
|
|
1513
1513
|
}), this.attachCommonEventHandlers();
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
|
-
class
|
|
1516
|
+
class I extends k {
|
|
1517
1517
|
constructor(e, t) {
|
|
1518
1518
|
super(e, t), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
|
|
1519
1519
|
}
|
|
@@ -1650,7 +1650,7 @@ class w extends E {
|
|
|
1650
1650
|
e && (e.scrollTop = 8 * this.hourHeight - 50, this._scrolled = !0);
|
|
1651
1651
|
}
|
|
1652
1652
|
}
|
|
1653
|
-
class
|
|
1653
|
+
class z extends k {
|
|
1654
1654
|
constructor(e, t) {
|
|
1655
1655
|
super(e, t), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
|
|
1656
1656
|
}
|
|
@@ -1794,7 +1794,7 @@ class D extends E {
|
|
|
1794
1794
|
e && (e.scrollTop = 8 * this.hourHeight - 50, this._scrolled = !0);
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
class
|
|
1797
|
+
class B extends M {
|
|
1798
1798
|
constructor() {
|
|
1799
1799
|
super(), this._isVisible = !1, this._cleanupFocusTrap = null, this.config = {
|
|
1800
1800
|
title: "New Event",
|
|
@@ -2070,7 +2070,7 @@ class I extends M {
|
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
2072
|
open(e = /* @__PURE__ */ new Date()) {
|
|
2073
|
-
this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = e, this._formData.end = new Date(e.getTime() + this.config.defaultDuration * 60 * 1e3), this._formData.title = "", this._formData.color = this.config.colors[0].color, this.startInput && (this.titleInput.value = "", this.startInput.value = this.formatDateForInput(this._formData.start), this.endInput.value = this.formatDateForInput(this._formData.end), this.updateColorSelection(), this._cleanupFocusTrap && this._cleanupFocusTrap(), this._cleanupFocusTrap =
|
|
2073
|
+
this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = e, this._formData.end = new Date(e.getTime() + this.config.defaultDuration * 60 * 1e3), this._formData.title = "", this._formData.color = this.config.colors[0].color, this.startInput && (this.titleInput.value = "", this.startInput.value = this.formatDateForInput(this._formData.start), this.endInput.value = this.formatDateForInput(this._formData.end), this.updateColorSelection(), this._cleanupFocusTrap && this._cleanupFocusTrap(), this._cleanupFocusTrap = E.trapFocus(this.modalContent));
|
|
2074
2074
|
}
|
|
2075
2075
|
close() {
|
|
2076
2076
|
this.removeAttribute("open"), this._cleanupFocusTrap && (this._cleanupFocusTrap(), this._cleanupFocusTrap = null);
|
|
@@ -2099,8 +2099,8 @@ class I extends M {
|
|
|
2099
2099
|
this._cleanupFocusTrap && this._cleanupFocusTrap(), this._handleKeyDown && (window.removeEventListener("keydown", this._handleKeyDown), this._handleKeyDown = null, this._keydownListenerAdded = !1);
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
|
-
customElements.get("forcecal-event-form") || customElements.define("forcecal-event-form",
|
|
2103
|
-
class
|
|
2102
|
+
customElements.get("forcecal-event-form") || customElements.define("forcecal-event-form", B);
|
|
2103
|
+
const v = class v extends M {
|
|
2104
2104
|
static get observedAttributes() {
|
|
2105
2105
|
return ["view", "date", "locale", "timezone", "week-starts-on", "height"];
|
|
2106
2106
|
}
|
|
@@ -2205,12 +2205,8 @@ class z extends M {
|
|
|
2205
2205
|
if (e) {
|
|
2206
2206
|
this._currentViewInstance && this._currentViewInstance.cleanup && this._currentViewInstance.cleanup();
|
|
2207
2207
|
try {
|
|
2208
|
-
const r =
|
|
2209
|
-
|
|
2210
|
-
week: w,
|
|
2211
|
-
day: D
|
|
2212
|
-
}[this.currentView] || g, s = new r(e, this.stateManager);
|
|
2213
|
-
s._viewType = this.currentView, this._currentViewInstance = s, s.render();
|
|
2208
|
+
const t = v.RENDERERS[this.currentView] || w, r = new t(e, this.stateManager);
|
|
2209
|
+
r._viewType = this.currentView, this._currentViewInstance = r, r.render();
|
|
2214
2210
|
} catch (t) {
|
|
2215
2211
|
console.error("[ForceCalendar] Error switching view:", t);
|
|
2216
2212
|
}
|
|
@@ -2630,7 +2626,7 @@ class z extends M {
|
|
|
2630
2626
|
return `
|
|
2631
2627
|
<div class="force-calendar">
|
|
2632
2628
|
<div class="fc-error">
|
|
2633
|
-
<p><strong>Error:</strong> ${
|
|
2629
|
+
<p><strong>Error:</strong> ${E.escapeHTML(i.message || "An error occurred")}</p>
|
|
2634
2630
|
</div>
|
|
2635
2631
|
</div>
|
|
2636
2632
|
`;
|
|
@@ -2693,12 +2689,8 @@ class z extends M {
|
|
|
2693
2689
|
return;
|
|
2694
2690
|
this._currentViewInstance && (this._currentViewInstance.cleanup && this._currentViewInstance.cleanup(), this._viewUnsubscribe && (this._viewUnsubscribe(), this._viewUnsubscribe = null));
|
|
2695
2691
|
try {
|
|
2696
|
-
const i =
|
|
2697
|
-
|
|
2698
|
-
week: w,
|
|
2699
|
-
day: D
|
|
2700
|
-
}[this.currentView] || g, n = new i(e, this.stateManager);
|
|
2701
|
-
n._viewType = this.currentView, this._currentViewInstance = n, n.render();
|
|
2692
|
+
const s = v.RENDERERS[this.currentView] || w, i = new s(e, this.stateManager);
|
|
2693
|
+
i._viewType = this.currentView, this._currentViewInstance = i, i.render();
|
|
2702
2694
|
} catch (s) {
|
|
2703
2695
|
console.error("[ForceCalendar] Error creating/rendering view:", s);
|
|
2704
2696
|
}
|
|
@@ -2721,20 +2713,6 @@ class z extends M {
|
|
|
2721
2713
|
});
|
|
2722
2714
|
}), this._hasRendered = !0;
|
|
2723
2715
|
}
|
|
2724
|
-
/**
|
|
2725
|
-
* Create a view renderer instance for the given view type
|
|
2726
|
-
* Uses pure JavaScript renderer classes for Salesforce Locker Service compatibility
|
|
2727
|
-
* @param {string} viewName - 'month', 'week', or 'day'
|
|
2728
|
-
* @returns {BaseViewRenderer} Renderer instance
|
|
2729
|
-
*/
|
|
2730
|
-
_createViewRenderer(e) {
|
|
2731
|
-
const r = {
|
|
2732
|
-
month: g,
|
|
2733
|
-
week: w,
|
|
2734
|
-
day: D
|
|
2735
|
-
}[e] || g;
|
|
2736
|
-
return new r(null, null);
|
|
2737
|
-
}
|
|
2738
2716
|
handleNavigation(e) {
|
|
2739
2717
|
switch (e.currentTarget.dataset.action) {
|
|
2740
2718
|
case "today":
|
|
@@ -2817,20 +2795,26 @@ class z extends M {
|
|
|
2817
2795
|
destroy() {
|
|
2818
2796
|
this._busUnsubscribers.forEach((e) => e()), this._busUnsubscribers = [], this.stateManager && this.stateManager.destroy(), super.cleanup();
|
|
2819
2797
|
}
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2798
|
+
};
|
|
2799
|
+
g(v, "RENDERERS", {
|
|
2800
|
+
month: w,
|
|
2801
|
+
week: I,
|
|
2802
|
+
day: z
|
|
2803
|
+
});
|
|
2804
|
+
let D = v;
|
|
2805
|
+
customElements.get("forcecal-main") || customElements.define("forcecal-main", D);
|
|
2822
2806
|
export {
|
|
2823
2807
|
M as BaseComponent,
|
|
2824
|
-
|
|
2825
|
-
|
|
2808
|
+
k as BaseViewRenderer,
|
|
2809
|
+
E as DOMUtils,
|
|
2826
2810
|
p as DateUtils,
|
|
2827
|
-
|
|
2811
|
+
z as DayViewRenderer,
|
|
2828
2812
|
T as EventBus,
|
|
2829
|
-
|
|
2830
|
-
|
|
2813
|
+
D as ForceCalendar,
|
|
2814
|
+
w as MonthViewRenderer,
|
|
2831
2815
|
V as StateManager,
|
|
2832
2816
|
u as StyleUtils,
|
|
2833
|
-
|
|
2834
|
-
|
|
2817
|
+
I as WeekViewRenderer,
|
|
2818
|
+
j as eventBus
|
|
2835
2819
|
};
|
|
2836
2820
|
//# sourceMappingURL=force-calendar-interface.esm.js.map
|