aboutsummaryrefslogtreecommitdiffstats
path: root/library/fullcalendar/packages/web-component/index.global.min.js
blob: 9a3a781737cfe9d2a167f9963d2b4ee6a5f9f353 (plain) (blame)
1
2
3
4
5
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="<div></div>";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);