| 1 |
- this.FullCalendar=this.FullCalendar||{},this.FullCalendar.Vue=function(e,t,n,r){"use strict";const i={headerToolbar:!0,footerToolbar:!0,events:!0,eventSources:!0,resources:!0},s=t.defineComponent({props:{options:Object},data:()=>({renderId:0,customRenderingMap:new Map}),methods:{getApi(){return this.calendar},buildOptions(e){return{...e,customRenderingMetaMap:d(this.$slots),handleCustomRendering:this.handleCustomRendering}}},render(){const e=[];for(const n of this.customRenderingMap.values())e.push(t.h(o,{key:n.id,customRendering:n}));return t.h("div",{attrs:{"data-fc-render-id":this.renderId}},t.h(t.Fragment,e))},mounted(){const e=new r.CustomRenderingStore;this.handleCustomRendering=e.handle.bind(e);const t=this.buildOptions(this.options),i=new n.Calendar(this.$el,t);this.calendar=i,i.render(),e.subscribe((e=>{this.customRenderingMap=e,this.renderId++,this.needCustomRenderingResize=!0}))},beforeUpdate(){this.getApi().resumeRendering()},updated(){this.needCustomRenderingResize&&(this.needCustomRenderingResize=!1,this.getApi().updateSize())},beforeUnmount(){this.getApi().destroy()},watch:function(){let e={options:{deep:!0,handler(e){let t=this.getApi();t.pauseRendering();let n=this.buildOptions(e);t.resetOptions(n),this.renderId++}}};for(let t in i)e[`options.${t}`]={deep:!0,handler(e){if(void 0!==e){let n=this.getApi();n.pauseRendering(),n.resetOptions({[t]:e},[t]),this.renderId++}}};return e}()}),o=t.defineComponent({props:{customRendering:Object},render(){const e=this.customRendering,n="function"==typeof e.generatorMeta?e.generatorMeta(e.renderProps):e.generatorMeta;return t.h(t.Teleport,{to:e.containerEl},n)}});function d(e){const t={};for(const r in e)t[(n=r,n.split("-").map(((e,t)=>t?function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(e):e)).join(""))]=e[r];var n;return t}return e.default=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue,FullCalendar,FullCalendar.Internal);
|