@forcecalendar/interface 1.0.29 → 1.0.31
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/dist/force-calendar-interface.esm.js +25 -17
- package/dist/force-calendar-interface.esm.js.map +1 -1
- package/dist/force-calendar-interface.umd.js +4 -4
- package/dist/force-calendar-interface.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/EventForm.js +4 -1
- package/src/core/StateManager.js +5 -1
- package/src/renderers/DayViewRenderer.js +1 -1
- package/src/renderers/WeekViewRenderer.js +1 -1
|
@@ -5192,7 +5192,11 @@ class ie {
|
|
|
5192
5192
|
}
|
|
5193
5193
|
// State management
|
|
5194
5194
|
getState() {
|
|
5195
|
-
return {
|
|
5195
|
+
return {
|
|
5196
|
+
...this.state,
|
|
5197
|
+
config: { ...this.state.config },
|
|
5198
|
+
events: [...this.state.events]
|
|
5199
|
+
};
|
|
5196
5200
|
}
|
|
5197
5201
|
setState(e, t = {}) {
|
|
5198
5202
|
const { silent: s = !1 } = t, i = { ...this.state };
|
|
@@ -5492,7 +5496,7 @@ class E extends f {
|
|
|
5492
5496
|
return r && (r.toLowerCase() === "pm" && n < 12 ? o = n + 12 : r.toLowerCase() === "am" && n === 12 && (o = 0)), s.setHours(o, a || 0, 0, 0), s;
|
|
5493
5497
|
}
|
|
5494
5498
|
}
|
|
5495
|
-
class
|
|
5499
|
+
class F {
|
|
5496
5500
|
/**
|
|
5497
5501
|
* Create element with attributes and children
|
|
5498
5502
|
*/
|
|
@@ -6133,7 +6137,7 @@ I(D, "breakpoints", {
|
|
|
6133
6137
|
xl: "1200px",
|
|
6134
6138
|
"2xl": "1400px"
|
|
6135
6139
|
});
|
|
6136
|
-
class
|
|
6140
|
+
class H {
|
|
6137
6141
|
/**
|
|
6138
6142
|
* @param {HTMLElement} container - The DOM element to render into
|
|
6139
6143
|
* @param {StateManager} stateManager - The state manager instance
|
|
@@ -6172,7 +6176,7 @@ class F {
|
|
|
6172
6176
|
* @returns {string}
|
|
6173
6177
|
*/
|
|
6174
6178
|
escapeHTML(e) {
|
|
6175
|
-
return e == null ? "" :
|
|
6179
|
+
return e == null ? "" : F.escapeHTML(String(e));
|
|
6176
6180
|
}
|
|
6177
6181
|
/**
|
|
6178
6182
|
* Check if a date is today
|
|
@@ -6282,7 +6286,7 @@ class F {
|
|
|
6282
6286
|
});
|
|
6283
6287
|
}
|
|
6284
6288
|
}
|
|
6285
|
-
class S extends
|
|
6289
|
+
class S extends H {
|
|
6286
6290
|
constructor(e, t) {
|
|
6287
6291
|
super(e, t), this.maxEventsToShow = 3;
|
|
6288
6292
|
}
|
|
@@ -6357,7 +6361,7 @@ class S extends F {
|
|
|
6357
6361
|
}), this.attachCommonEventHandlers();
|
|
6358
6362
|
}
|
|
6359
6363
|
}
|
|
6360
|
-
class z extends
|
|
6364
|
+
class z extends H {
|
|
6361
6365
|
constructor(e, t) {
|
|
6362
6366
|
super(e, t), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
|
|
6363
6367
|
}
|
|
@@ -6476,10 +6480,12 @@ class z extends F {
|
|
|
6476
6480
|
this.addListener(this.container, "click", (e) => {
|
|
6477
6481
|
const t = e.target.closest(".fc-week-day-column");
|
|
6478
6482
|
if (!t || !this.container.contains(t) || e.target.closest(".fc-event")) return;
|
|
6479
|
-
const s = new Date(t.dataset.date), i = t.getBoundingClientRect()
|
|
6483
|
+
const s = new Date(t.dataset.date), i = t.getBoundingClientRect();
|
|
6484
|
+
this.container.querySelector("#week-scroll-container");
|
|
6485
|
+
const r = e.clientY - i.top;
|
|
6480
6486
|
s.setHours(
|
|
6481
|
-
Math.floor(
|
|
6482
|
-
Math.floor(
|
|
6487
|
+
Math.floor(r / this.hourHeight),
|
|
6488
|
+
Math.floor(r % this.hourHeight / (this.hourHeight / 60)),
|
|
6483
6489
|
0,
|
|
6484
6490
|
0
|
|
6485
6491
|
), this.stateManager.selectDate(s);
|
|
@@ -6491,7 +6497,7 @@ class z extends F {
|
|
|
6491
6497
|
e && (e.scrollTop = 8 * this.hourHeight - 50, this._scrolled = !0);
|
|
6492
6498
|
}
|
|
6493
6499
|
}
|
|
6494
|
-
class L extends
|
|
6500
|
+
class L extends H {
|
|
6495
6501
|
constructor(e, t) {
|
|
6496
6502
|
super(e, t), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
|
|
6497
6503
|
}
|
|
@@ -6617,10 +6623,12 @@ class L extends F {
|
|
|
6617
6623
|
this.addListener(this.container, "click", (e) => {
|
|
6618
6624
|
const t = e.target.closest(".fc-day-column");
|
|
6619
6625
|
if (!t || !this.container.contains(t) || e.target.closest(".fc-event")) return;
|
|
6620
|
-
const s = new Date(t.dataset.date), i = t.getBoundingClientRect()
|
|
6626
|
+
const s = new Date(t.dataset.date), i = t.getBoundingClientRect();
|
|
6627
|
+
this.container.querySelector("#day-scroll-container");
|
|
6628
|
+
const r = e.clientY - i.top;
|
|
6621
6629
|
s.setHours(
|
|
6622
|
-
Math.floor(
|
|
6623
|
-
Math.floor(
|
|
6630
|
+
Math.floor(r / this.hourHeight),
|
|
6631
|
+
Math.floor(r % this.hourHeight / (this.hourHeight / 60)),
|
|
6624
6632
|
0,
|
|
6625
6633
|
0
|
|
6626
6634
|
), this.stateManager.selectDate(s);
|
|
@@ -6908,7 +6916,7 @@ class re extends O {
|
|
|
6908
6916
|
});
|
|
6909
6917
|
}
|
|
6910
6918
|
open(e = /* @__PURE__ */ new Date()) {
|
|
6911
|
-
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 =
|
|
6919
|
+
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 = F.trapFocus(this.modalContent));
|
|
6912
6920
|
}
|
|
6913
6921
|
close() {
|
|
6914
6922
|
this.removeAttribute("open"), this._cleanupFocusTrap && (this._cleanupFocusTrap(), this._cleanupFocusTrap = null);
|
|
@@ -7466,7 +7474,7 @@ class ne extends O {
|
|
|
7466
7474
|
return `
|
|
7467
7475
|
<div class="force-calendar">
|
|
7468
7476
|
<div class="fc-error">
|
|
7469
|
-
<p><strong>Error:</strong> ${
|
|
7477
|
+
<p><strong>Error:</strong> ${F.escapeHTML(r.message || "An error occurred")}</p>
|
|
7470
7478
|
</div>
|
|
7471
7479
|
</div>
|
|
7472
7480
|
`;
|
|
@@ -7657,8 +7665,8 @@ customElements.get("forcecal-main") || customElements.define("forcecal-main", ne
|
|
|
7657
7665
|
typeof window < "u" && typeof customElements < "u" && console.log("Force Calendar Interface loading...");
|
|
7658
7666
|
export {
|
|
7659
7667
|
O as BaseComponent,
|
|
7660
|
-
|
|
7661
|
-
|
|
7668
|
+
H as BaseViewRenderer,
|
|
7669
|
+
F as DOMUtils,
|
|
7662
7670
|
E as DateUtils,
|
|
7663
7671
|
L as DayViewRenderer,
|
|
7664
7672
|
se as EventBus,
|