@forcecalendar/interface 1.0.46 → 1.0.47

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.
@@ -600,7 +600,7 @@ class p extends L {
600
600
  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;
601
601
  }
602
602
  }
603
- class E {
603
+ class D {
604
604
  /**
605
605
  * Create element with attributes and children
606
606
  */
@@ -1241,7 +1241,7 @@ g(f, "breakpoints", {
1241
1241
  xl: "1200px",
1242
1242
  "2xl": "1400px"
1243
1243
  });
1244
- class k {
1244
+ class E {
1245
1245
  /**
1246
1246
  * @param {HTMLElement} container - The DOM element to render into
1247
1247
  * @param {StateManager} stateManager - The state manager instance
@@ -1280,7 +1280,7 @@ class k {
1280
1280
  * @returns {string}
1281
1281
  */
1282
1282
  escapeHTML(t) {
1283
- return t == null ? "" : E.escapeHTML(String(t));
1283
+ return t == null ? "" : D.escapeHTML(String(t));
1284
1284
  }
1285
1285
  /**
1286
1286
  * Check if a date is today
@@ -1341,7 +1341,7 @@ class k {
1341
1341
  */
1342
1342
  renderNowIndicator() {
1343
1343
  const t = /* @__PURE__ */ new Date();
1344
- return `<div class="fc-now-indicator" style="position: absolute; left: 0; right: 0; top: ${t.getHours() * 60 + t.getMinutes()}px; height: 2px; background: #dc2626; z-index: 15; pointer-events: none;"></div>`;
1344
+ return `<div class="fc-now-indicator" style="position: absolute; left: 0; right: 0; top: ${t.getHours() * 60 + t.getMinutes()}px; height: 2px; background: var(--fc-danger-color); z-index: 15; pointer-events: none;"></div>`;
1345
1345
  }
1346
1346
  /**
1347
1347
  * Compute overlap layout columns for a list of timed events.
@@ -1434,7 +1434,7 @@ class k {
1434
1434
  });
1435
1435
  }
1436
1436
  }
1437
- class w extends k {
1437
+ class w extends E {
1438
1438
  constructor(t, e) {
1439
1439
  super(t, e), this.maxEventsToShow = 3;
1440
1440
  }
@@ -1442,7 +1442,7 @@ class w extends k {
1442
1442
  if (!this.container || !this.stateManager) return;
1443
1443
  const t = this.stateManager.getViewData();
1444
1444
  if (!t || !t.weeks) {
1445
- this.container.innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">No data available for month view.</div>';
1445
+ this.container.innerHTML = '<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for month view.</div>';
1446
1446
  return;
1447
1447
  }
1448
1448
  this.cleanup();
@@ -1452,9 +1452,9 @@ class w extends k {
1452
1452
  _renderMonthView(t, e) {
1453
1453
  const r = e.weekStartsOn || 0;
1454
1454
  let i = `
1455
- <div class="fc-month-view" style="display: flex; flex-direction: column; height: 100%; min-height: 400px; background: #fff; border: 1px solid #e5e7eb;">
1456
- <div class="fc-month-header" style="display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #e5e7eb; background: #f9fafb;">
1457
- ${this._getDayNames(r).map((n) => `<div class="fc-month-header-cell" style="padding: 12px 8px; text-align: center; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase;">${n}</div>`).join("")}
1455
+ <div class="fc-month-view" style="display: flex; flex-direction: column; height: 100%; min-height: 400px; background: var(--fc-background); border: 1px solid var(--fc-border-color);">
1456
+ <div class="fc-month-header" style="display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--fc-border-color); background: var(--fc-background-alt);">
1457
+ ${this._getDayNames(r).map((n) => `<div class="fc-month-header-cell" style="padding: 12px 8px; text-align: center; font-size: 11px; font-weight: 600; color: var(--fc-text-light); text-transform: uppercase;">${n}</div>`).join("")}
1458
1458
  </div>
1459
1459
  <div class="fc-month-body" style="display: flex; flex-direction: column; flex: 1;">
1460
1460
  `;
@@ -1477,16 +1477,16 @@ class w extends k {
1477
1477
  }), e += "</div>", e;
1478
1478
  }
1479
1479
  _renderDay(t) {
1480
- const e = !t.isCurrentMonth, r = t.isToday, s = e ? "#f3f4f6" : "#fff", i = e ? "#9ca3af" : "#111827", n = r ? "background: #2563eb; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;" : "", o = t.events || [], a = o.slice(0, this.maxEventsToShow), c = o.length - this.maxEventsToShow;
1480
+ const e = !t.isCurrentMonth, r = t.isToday, s = e ? "var(--fc-background-hover)" : "var(--fc-background)", i = e ? "var(--fc-text-light)" : "var(--fc-text-color)", n = r ? "background: var(--fc-primary-color); color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;" : "", o = t.events || [], a = o.slice(0, this.maxEventsToShow), c = o.length - this.maxEventsToShow;
1481
1481
  return `
1482
1482
  <div class="fc-month-day" data-date="${t.date}"
1483
- style="background: ${s}; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; padding: 4px; min-height: 80px; cursor: pointer; display: flex; flex-direction: column;">
1483
+ style="background: ${s}; border-right: 1px solid var(--fc-border-color); border-bottom: 1px solid var(--fc-border-color); padding: 4px; min-height: 80px; cursor: pointer; display: flex; flex-direction: column;">
1484
1484
  <div class="fc-day-number" style="font-size: 13px; font-weight: 500; color: ${i}; padding: 2px 4px; margin-bottom: 4px; ${n}">
1485
1485
  ${t.dayOfMonth}
1486
1486
  </div>
1487
1487
  <div class="fc-day-events" style="display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden;">
1488
1488
  ${a.map((d) => this._renderEvent(d)).join("")}
1489
- ${c > 0 ? `<div class="fc-more-events" style="font-size: 10px; color: #6b7280; padding: 2px 4px; font-weight: 500;">+${c} more</div>` : ""}
1489
+ ${c > 0 ? `<div class="fc-more-events" style="font-size: 10px; color: var(--fc-text-light); padding: 2px 4px; font-weight: 500;">+${c} more</div>` : ""}
1490
1490
  </div>
1491
1491
  </div>
1492
1492
  `;
@@ -1509,7 +1509,7 @@ class w extends k {
1509
1509
  }), this.attachCommonEventHandlers();
1510
1510
  }
1511
1511
  }
1512
- class I extends k {
1512
+ class I extends E {
1513
1513
  constructor(t, e) {
1514
1514
  super(t, e), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
1515
1515
  }
@@ -1517,7 +1517,7 @@ class I extends k {
1517
1517
  if (!this.container || !this.stateManager) return;
1518
1518
  const t = this.stateManager.getViewData();
1519
1519
  if (!t || !t.days || t.days.length === 0) {
1520
- this.container.innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">No data available for week view.</div>';
1520
+ this.container.innerHTML = '<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for week view.</div>';
1521
1521
  return;
1522
1522
  }
1523
1523
  this.cleanup(), this._scrolled = !1;
@@ -1538,7 +1538,7 @@ class I extends k {
1538
1538
  };
1539
1539
  });
1540
1540
  return `
1541
- <div class="fc-week-view" style="display: flex; flex-direction: column; height: 100%; background: #fff; overflow: hidden;">
1541
+ <div class="fc-week-view" style="display: flex; flex-direction: column; height: 100%; background: var(--fc-background); overflow: hidden;">
1542
1542
  ${this._renderHeader(n)}
1543
1543
  ${this._renderAllDayRow(n)}
1544
1544
  ${this._renderTimeGrid(n, i)}
@@ -1547,15 +1547,15 @@ class I extends k {
1547
1547
  }
1548
1548
  _renderHeader(t) {
1549
1549
  return `
1550
- <div class="fc-week-header" style="display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid #e5e7eb; background: #f9fafb; flex-shrink: 0;">
1551
- <div style="border-right: 1px solid #e5e7eb;"></div>
1550
+ <div class="fc-week-header" style="display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid var(--fc-border-color); background: var(--fc-background-alt); flex-shrink: 0;">
1551
+ <div style="border-right: 1px solid var(--fc-border-color);"></div>
1552
1552
  ${t.map(
1553
1553
  (e) => `
1554
- <div style="padding: 12px 8px; text-align: center; border-right: 1px solid #e5e7eb;">
1555
- <div style="font-size: 10px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.1em;">
1554
+ <div style="padding: 12px 8px; text-align: center; border-right: 1px solid var(--fc-border-color);">
1555
+ <div style="font-size: 10px; font-weight: 700; color: var(--fc-text-light); text-transform: uppercase; letter-spacing: 0.1em;">
1556
1556
  ${e.dayName}
1557
1557
  </div>
1558
- <div style="font-size: 16px; font-weight: 500; margin-top: 4px; ${e.isToday ? "background: #dc2626; color: white; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;" : "color: #111827;"}">
1558
+ <div style="font-size: 16px; font-weight: 500; margin-top: 4px; ${e.isToday ? "background: var(--fc-danger-color); color: white; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;" : "color: var(--fc-text-color);"}">
1559
1559
  ${e.dayOfMonth}
1560
1560
  </div>
1561
1561
  </div>
@@ -1566,13 +1566,13 @@ class I extends k {
1566
1566
  }
1567
1567
  _renderAllDayRow(t) {
1568
1568
  return `
1569
- <div class="fc-all-day-row" style="display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid #e5e7eb; background: #fafafa; min-height: 32px; flex-shrink: 0;">
1570
- <div style="font-size: 9px; color: #6b7280; display: flex; align-items: center; justify-content: center; border-right: 1px solid #e5e7eb; text-transform: uppercase; font-weight: 700;">
1569
+ <div class="fc-all-day-row" style="display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid var(--fc-border-color); background: var(--fc-background-alt); min-height: 32px; flex-shrink: 0;">
1570
+ <div style="font-size: 9px; color: var(--fc-text-light); display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--fc-border-color); text-transform: uppercase; font-weight: 700;">
1571
1571
  All day
1572
1572
  </div>
1573
1573
  ${t.map(
1574
1574
  (e) => `
1575
- <div class="fc-all-day-cell" data-date="${e.date.toISOString()}" style="border-right: 1px solid #e5e7eb; padding: 4px; display: flex; flex-direction: column; gap: 2px;">
1575
+ <div class="fc-all-day-cell" data-date="${e.date.toISOString()}" style="border-right: 1px solid var(--fc-border-color); padding: 4px; display: flex; flex-direction: column; gap: 2px;">
1576
1576
  ${e.allDayEvents.map(
1577
1577
  (r) => `
1578
1578
  <div class="fc-event fc-all-day-event" data-event-id="${this.escapeHTML(r.id)}"
@@ -1599,10 +1599,10 @@ class I extends k {
1599
1599
  }
1600
1600
  _renderTimeGutter(t) {
1601
1601
  return `
1602
- <div class="fc-time-gutter" style="border-right: 1px solid #e5e7eb; background: #fafafa;">
1602
+ <div class="fc-time-gutter" style="border-right: 1px solid var(--fc-border-color); background: var(--fc-background-alt);">
1603
1603
  ${t.map(
1604
1604
  (e) => `
1605
- <div style="height: ${this.hourHeight}px; font-size: 10px; color: #6b7280; text-align: right; padding-right: 8px; font-weight: 500;">
1605
+ <div style="height: ${this.hourHeight}px; font-size: 10px; color: var(--fc-text-light); text-align: right; padding-right: 8px; font-weight: 500;">
1606
1606
  ${e === 0 ? "" : this.formatHour(e)}
1607
1607
  </div>
1608
1608
  `
@@ -1612,9 +1612,9 @@ class I extends k {
1612
1612
  }
1613
1613
  _renderDayColumn(t, e) {
1614
1614
  return `
1615
- <div class="fc-week-day-column" data-date="${t.date.toISOString()}" style="border-right: 1px solid #e5e7eb; position: relative; cursor: pointer;">
1615
+ <div class="fc-week-day-column" data-date="${t.date.toISOString()}" style="border-right: 1px solid var(--fc-border-color); position: relative; cursor: pointer;">
1616
1616
  <!-- Hour grid lines -->
1617
- ${e.map(() => `<div style="height: ${this.hourHeight}px; border-bottom: 1px solid #f3f4f6;"></div>`).join("")}
1617
+ ${e.map(() => `<div style="height: ${this.hourHeight}px; border-bottom: 1px solid var(--fc-background-hover);"></div>`).join("")}
1618
1618
 
1619
1619
  <!-- Now indicator for today -->
1620
1620
  ${t.isToday ? this.renderNowIndicator() : ""}
@@ -1646,7 +1646,7 @@ class I extends k {
1646
1646
  t && (t.scrollTop = 8 * this.hourHeight - 50, this._scrolled = !0);
1647
1647
  }
1648
1648
  }
1649
- class z extends k {
1649
+ class z extends E {
1650
1650
  constructor(t, e) {
1651
1651
  super(t, e), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
1652
1652
  }
@@ -1654,7 +1654,7 @@ class z extends k {
1654
1654
  if (!this.container || !this.stateManager) return;
1655
1655
  const t = this.stateManager.getViewData();
1656
1656
  if (!t) {
1657
- this.container.innerHTML = '<div style="padding: 20px; text-align: center; color: #666;">No data available for day view.</div>';
1657
+ this.container.innerHTML = '<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for day view.</div>';
1658
1658
  return;
1659
1659
  }
1660
1660
  this.cleanup(), this._scrolled = !1;
@@ -1665,10 +1665,10 @@ class z extends k {
1665
1665
  var l, u;
1666
1666
  const r = ((u = (l = this.stateManager) == null ? void 0 : l.getState()) == null ? void 0 : u.currentDate) || /* @__PURE__ */ new Date(), s = this._extractDayData(t, r);
1667
1667
  if (!s)
1668
- return '<div style="padding: 20px; text-align: center; color: #666;">No data available for day view.</div>';
1668
+ return '<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for day view.</div>';
1669
1669
  const { dayDate: i, dayName: n, isToday: o, allDayEvents: a, timedEvents: c } = s, d = Array.from({ length: 24 }, (m, b) => b);
1670
1670
  return `
1671
- <div class="fc-day-view" style="display: flex; flex-direction: column; height: 100%; background: #fff; overflow: hidden;">
1671
+ <div class="fc-day-view" style="display: flex; flex-direction: column; height: 100%; background: var(--fc-background); overflow: hidden;">
1672
1672
  ${this._renderHeader(i, n, o)}
1673
1673
  ${this._renderAllDayRow(a, i)}
1674
1674
  ${this._renderTimeGrid(c, o, i, d)}
@@ -1699,13 +1699,13 @@ class z extends k {
1699
1699
  }
1700
1700
  _renderHeader(t, e, r) {
1701
1701
  return `
1702
- <div class="fc-day-header" style="display: grid; grid-template-columns: 60px 1fr; border-bottom: 1px solid #e5e7eb; background: #f9fafb; flex-shrink: 0;">
1703
- <div style="border-right: 1px solid #e5e7eb;"></div>
1702
+ <div class="fc-day-header" style="display: grid; grid-template-columns: 60px 1fr; border-bottom: 1px solid var(--fc-border-color); background: var(--fc-background-alt); flex-shrink: 0;">
1703
+ <div style="border-right: 1px solid var(--fc-border-color);"></div>
1704
1704
  <div style="padding: 16px 24px;">
1705
- <div style="font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.1em;">
1705
+ <div style="font-size: 12px; font-weight: 700; color: var(--fc-text-light); text-transform: uppercase; letter-spacing: 0.1em;">
1706
1706
  ${e}
1707
1707
  </div>
1708
- <div style="font-size: 24px; font-weight: 600; margin-top: 4px; ${r ? "color: #dc2626;" : "color: #111827;"}">
1708
+ <div style="font-size: 24px; font-weight: 600; margin-top: 4px; ${r ? "color: var(--fc-danger-color);" : "color: var(--fc-text-color);"}">
1709
1709
  ${t.getDate()}
1710
1710
  </div>
1711
1711
  </div>
@@ -1714,8 +1714,8 @@ class z extends k {
1714
1714
  }
1715
1715
  _renderAllDayRow(t, e) {
1716
1716
  return `
1717
- <div class="fc-all-day-row" style="display: grid; grid-template-columns: 60px 1fr; border-bottom: 1px solid #e5e7eb; background: #fafafa; min-height: 36px; flex-shrink: 0;">
1718
- <div style="font-size: 9px; color: #6b7280; display: flex; align-items: center; justify-content: center; border-right: 1px solid #e5e7eb; text-transform: uppercase; font-weight: 700;">
1717
+ <div class="fc-all-day-row" style="display: grid; grid-template-columns: 60px 1fr; border-bottom: 1px solid var(--fc-border-color); background: var(--fc-background-alt); min-height: 36px; flex-shrink: 0;">
1718
+ <div style="font-size: 9px; color: var(--fc-text-light); display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--fc-border-color); text-transform: uppercase; font-weight: 700;">
1719
1719
  All day
1720
1720
  </div>
1721
1721
  <div class="fc-all-day-cell" data-date="${e.toISOString()}" style="padding: 6px 12px; display: flex; flex-wrap: wrap; gap: 4px;">
@@ -1743,10 +1743,10 @@ class z extends k {
1743
1743
  }
1744
1744
  _renderTimeGutter(t) {
1745
1745
  return `
1746
- <div class="fc-time-gutter" style="border-right: 1px solid #e5e7eb; background: #fafafa;">
1746
+ <div class="fc-time-gutter" style="border-right: 1px solid var(--fc-border-color); background: var(--fc-background-alt);">
1747
1747
  ${t.map(
1748
1748
  (e) => `
1749
- <div style="height: ${this.hourHeight}px; font-size: 11px; color: #6b7280; text-align: right; padding-right: 12px; font-weight: 500;">
1749
+ <div style="height: ${this.hourHeight}px; font-size: 11px; color: var(--fc-text-light); text-align: right; padding-right: 12px; font-weight: 500;">
1750
1750
  ${e === 0 ? "" : this.formatHour(e)}
1751
1751
  </div>
1752
1752
  `
@@ -1758,7 +1758,7 @@ class z extends k {
1758
1758
  return `
1759
1759
  <div class="fc-day-column" data-date="${r.toISOString()}" style="position: relative; cursor: pointer;">
1760
1760
  <!-- Hour grid lines -->
1761
- ${s.map(() => `<div style="height: ${this.hourHeight}px; border-bottom: 1px solid #f3f4f6;"></div>`).join("")}
1761
+ ${s.map(() => `<div style="height: ${this.hourHeight}px; border-bottom: 1px solid var(--fc-background-hover);"></div>`).join("")}
1762
1762
 
1763
1763
  <!-- Now indicator for today -->
1764
1764
  ${e ? this.renderNowIndicator() : ""}
@@ -2066,7 +2066,7 @@ class B extends M {
2066
2066
  });
2067
2067
  }
2068
2068
  open(t = /* @__PURE__ */ new Date()) {
2069
- this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = t, this._formData.end = new Date(t.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));
2069
+ this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = t, this._formData.end = new Date(t.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 = D.trapFocus(this.modalContent));
2070
2070
  }
2071
2071
  close() {
2072
2072
  this.removeAttribute("open"), this._cleanupFocusTrap && (this._cleanupFocusTrap(), this._cleanupFocusTrap = null);
@@ -2622,7 +2622,7 @@ const v = class v extends M {
2622
2622
  return `
2623
2623
  <div class="force-calendar">
2624
2624
  <div class="fc-error">
2625
- <p><strong>Error:</strong> ${E.escapeHTML(i.message || "An error occurred")}</p>
2625
+ <p><strong>Error:</strong> ${D.escapeHTML(i.message || "An error occurred")}</p>
2626
2626
  </div>
2627
2627
  </div>
2628
2628
  `;
@@ -2800,16 +2800,16 @@ g(v, "RENDERERS", {
2800
2800
  week: I,
2801
2801
  day: z
2802
2802
  });
2803
- let D = v;
2804
- customElements.get("forcecal-main") || customElements.define("forcecal-main", D);
2803
+ let k = v;
2804
+ customElements.get("forcecal-main") || customElements.define("forcecal-main", k);
2805
2805
  export {
2806
2806
  M as BaseComponent,
2807
- k as BaseViewRenderer,
2808
- E as DOMUtils,
2807
+ E as BaseViewRenderer,
2808
+ D as DOMUtils,
2809
2809
  p as DateUtils,
2810
2810
  z as DayViewRenderer,
2811
2811
  T as EventBus,
2812
- D as ForceCalendar,
2812
+ k as ForceCalendar,
2813
2813
  w as MonthViewRenderer,
2814
2814
  V as StateManager,
2815
2815
  f as StyleUtils,