From cebc19ef236aac2968d2ffccfcff9b975b63fa8d Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 23 Jun 2025 03:33:38 +0200 Subject: fullcalendar --- .../packages/web-component/index.global.js | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 public/js/fullcalendar/packages/web-component/index.global.js (limited to 'public/js/fullcalendar/packages/web-component/index.global.js') diff --git a/public/js/fullcalendar/packages/web-component/index.global.js b/public/js/fullcalendar/packages/web-component/index.global.js new file mode 100644 index 0000000..450b052 --- /dev/null +++ b/public/js/fullcalendar/packages/web-component/index.global.js @@ -0,0 +1,79 @@ +/*! +FullCalendar Web Component v6.1.17 +Docs & License: https://fullcalendar.io/docs/web-component +(c) 2024 Adam Shaw +*/ +(function (core) { + 'use strict'; + + class FullCalendarElement extends HTMLElement { + constructor() { + super(...arguments); + this._calendar = null; + this._options = null; + } + connectedCallback() { + this._handleOptionsStr(this.getAttribute('options')); + } + disconnectedCallback() { + this._handleOptionsStr(null); + } + attributeChangedCallback(name, oldVal, newVal) { + if (name === 'options' && + this._calendar // initial render happened + ) { + this._handleOptionsStr(newVal); + } + } + get options() { + return this._options; + } + set options(options) { + this._handleOptions(options); + } + getApi() { + return this._calendar; + } + _handleOptionsStr(optionsStr) { + this._handleOptions(optionsStr ? JSON.parse(optionsStr) : null); + } + _handleOptions(options) { + if (options) { + if (this._calendar) { + this._calendar.resetOptions(options); + } + else { + let root; + if (this.hasAttribute('shadow')) { + this.attachShadow({ mode: 'open' }); + root = this.shadowRoot; + } + else { + // eslint-disable-next-line @typescript-eslint/no-this-alias + root = this; + } + root.innerHTML = '
'; + let calendarEl = root.querySelector('div'); + let calendar = new core.Calendar(calendarEl, options); + calendar.render(); + this._calendar = calendar; + } + this._options = options; + } + else { + if (this._calendar) { + this._calendar.destroy(); + this._calendar = null; + } + this._options = null; + } + } + static get observedAttributes() { + return ['options']; + } + } + + globalThis.FullCalendarElement = FullCalendarElement; + customElements.define('full-calendar', FullCalendarElement); + +})(FullCalendar); -- cgit v1.2.3