From a9ae17036d30a676c833a6ddb98409f19cbbd963 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Jan 2023 13:09:00 +0000 Subject: update fullcalendar --- .../packages/web-component/index.global.js | 70 ++++++++++++++++++++++ .../packages/web-component/index.global.min.js | 6 ++ 2 files changed, 76 insertions(+) create mode 100644 library/fullcalendar/packages/web-component/index.global.js create mode 100644 library/fullcalendar/packages/web-component/index.global.min.js (limited to 'library/fullcalendar/packages/web-component') diff --git a/library/fullcalendar/packages/web-component/index.global.js b/library/fullcalendar/packages/web-component/index.global.js new file mode 100644 index 000000000..aa22a52a3 --- /dev/null +++ b/library/fullcalendar/packages/web-component/index.global.js @@ -0,0 +1,70 @@ +/*! +FullCalendar Web Component v6.0.3 +Docs & License: https://fullcalendar.io +(c) 2022 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 { + this.innerHTML = '
'; + let calendarEl = this.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); diff --git a/library/fullcalendar/packages/web-component/index.global.min.js b/library/fullcalendar/packages/web-component/index.global.min.js new file mode 100644 index 000000000..9a3a78173 --- /dev/null +++ b/library/fullcalendar/packages/web-component/index.global.min.js @@ -0,0 +1,6 @@ +/*! +FullCalendar Web Component v6.0.3 +Docs & License: https://fullcalendar.io +(c) 2022 Adam Shaw +*/ +!function(t){"use strict";class e extends HTMLElement{constructor(){super(...arguments),this._calendar=null,this._options=null}connectedCallback(){this._handleOptionsStr(this.getAttribute("options"))}disconnectedCallback(){this._handleOptionsStr(null)}attributeChangedCallback(t,e,n){"options"===t&&this._calendar&&this._handleOptionsStr(n)}get options(){return this._options}set options(t){this._handleOptions(t)}getApi(){return this._calendar}_handleOptionsStr(t){this._handleOptions(t?JSON.parse(t):null)}_handleOptions(e){if(e){if(this._calendar)this._calendar.resetOptions(e);else{this.innerHTML="
";let n=this.querySelector("div"),s=new t.Calendar(n,e);s.render(),this._calendar=s}this._options=e}else this._calendar&&(this._calendar.destroy(),this._calendar=null),this._options=null}static get observedAttributes(){return["options"]}}globalThis.FullCalendarElement=e,customElements.define("full-calendar",e)}(FullCalendar); \ No newline at end of file -- cgit v1.2.3