diff options
Diffstat (limited to 'public/js/fullcalendar/packages/web-component')
| -rw-r--r-- | public/js/fullcalendar/packages/web-component/index.global.js | 79 | ||||
| -rw-r--r-- | public/js/fullcalendar/packages/web-component/index.global.min.js | 6 |
2 files changed, 85 insertions, 0 deletions
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 @@ | |||
| 1 | /*! | ||
| 2 | FullCalendar Web Component v6.1.17 | ||
| 3 | Docs & License: https://fullcalendar.io/docs/web-component | ||
| 4 | (c) 2024 Adam Shaw | ||
| 5 | */ | ||
| 6 | (function (core) { | ||
| 7 | 'use strict'; | ||
| 8 | |||
| 9 | class FullCalendarElement extends HTMLElement { | ||
| 10 | constructor() { | ||
| 11 | super(...arguments); | ||
| 12 | this._calendar = null; | ||
| 13 | this._options = null; | ||
| 14 | } | ||
| 15 | connectedCallback() { | ||
| 16 | this._handleOptionsStr(this.getAttribute('options')); | ||
| 17 | } | ||
| 18 | disconnectedCallback() { | ||
| 19 | this._handleOptionsStr(null); | ||
| 20 | } | ||
| 21 | attributeChangedCallback(name, oldVal, newVal) { | ||
| 22 | if (name === 'options' && | ||
| 23 | this._calendar // initial render happened | ||
| 24 | ) { | ||
| 25 | this._handleOptionsStr(newVal); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | get options() { | ||
| 29 | return this._options; | ||
| 30 | } | ||
| 31 | set options(options) { | ||
| 32 | this._handleOptions(options); | ||
| 33 | } | ||
| 34 | getApi() { | ||
| 35 | return this._calendar; | ||
| 36 | } | ||
| 37 | _handleOptionsStr(optionsStr) { | ||
| 38 | this._handleOptions(optionsStr ? JSON.parse(optionsStr) : null); | ||
| 39 | } | ||
| 40 | _handleOptions(options) { | ||
| 41 | if (options) { | ||
| 42 | if (this._calendar) { | ||
| 43 | this._calendar.resetOptions(options); | ||
| 44 | } | ||
| 45 | else { | ||
| 46 | let root; | ||
| 47 | if (this.hasAttribute('shadow')) { | ||
| 48 | this.attachShadow({ mode: 'open' }); | ||
| 49 | root = this.shadowRoot; | ||
| 50 | } | ||
| 51 | else { | ||
| 52 | // eslint-disable-next-line @typescript-eslint/no-this-alias | ||
| 53 | root = this; | ||
| 54 | } | ||
| 55 | root.innerHTML = '<div></div>'; | ||
| 56 | let calendarEl = root.querySelector('div'); | ||
| 57 | let calendar = new core.Calendar(calendarEl, options); | ||
| 58 | calendar.render(); | ||
| 59 | this._calendar = calendar; | ||
| 60 | } | ||
| 61 | this._options = options; | ||
| 62 | } | ||
| 63 | else { | ||
| 64 | if (this._calendar) { | ||
| 65 | this._calendar.destroy(); | ||
| 66 | this._calendar = null; | ||
| 67 | } | ||
| 68 | this._options = null; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | static get observedAttributes() { | ||
| 72 | return ['options']; | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 76 | globalThis.FullCalendarElement = FullCalendarElement; | ||
| 77 | customElements.define('full-calendar', FullCalendarElement); | ||
| 78 | |||
| 79 | })(FullCalendar); | ||
diff --git a/public/js/fullcalendar/packages/web-component/index.global.min.js b/public/js/fullcalendar/packages/web-component/index.global.min.js new file mode 100644 index 0000000..321e59b --- /dev/null +++ b/public/js/fullcalendar/packages/web-component/index.global.min.js | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | /*! | ||
| 2 | FullCalendar Web Component v6.1.17 | ||
| 3 | Docs & License: https://fullcalendar.io/docs/web-component | ||
| 4 | (c) 2024 Adam Shaw | ||
| 5 | */ | ||
| 6 | !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{let n;this.hasAttribute("shadow")?(this.attachShadow({mode:"open"}),n=this.shadowRoot):n=this,n.innerHTML="<div></div>";let s=n.querySelector("div"),i=new t.Calendar(s,e);i.render(),this._calendar=i}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 | ||
