@fullcalendar/vue
Advanced tools
Comparing version 6.0.3 to 6.1.0
@@ -5,3 +5,2 @@ import Vue from 'vue'; | ||
import { OPTION_IS_COMPLEX } from './options.js'; | ||
import { shallowCopy } from './utils.js'; | ||
import OffscreenFragment from './OffscreenFragment.js'; | ||
@@ -114,6 +113,4 @@ import TransportContainer from './TransportContainer.js'; | ||
calendar.resetOptions({ | ||
// the only reason we shallow-copy is to trick FC into knowing there's a nested change. | ||
// TODO: future versions of FC will more gracefully handle event option-changes that are same-reference. | ||
[complexOptionName]: shallowCopy(val) | ||
}, true); | ||
[complexOptionName]: val | ||
}, [complexOptionName]); | ||
this.renderId++; // will queue a rerender | ||
@@ -120,0 +117,0 @@ } |
@@ -17,18 +17,2 @@ this.FullCalendar = this.FullCalendar || {}; | ||
// TODO: add types! | ||
/* | ||
works with objects and arrays | ||
*/ | ||
function shallowCopy(val) { | ||
if (typeof val === 'object') { | ||
if (Array.isArray(val)) { | ||
val = Array.prototype.slice.call(val); | ||
} | ||
else if (val) { // non-null | ||
val = Object.assign({}, val); | ||
} | ||
} | ||
return val; | ||
} | ||
const dummyContainer$1 = document.createDocumentFragment(); | ||
@@ -203,6 +187,4 @@ const OffscreenFragment = Vue__default["default"].extend({ | ||
calendar.resetOptions({ | ||
// the only reason we shallow-copy is to trick FC into knowing there's a nested change. | ||
// TODO: future versions of FC will more gracefully handle event option-changes that are same-reference. | ||
[complexOptionName]: shallowCopy(val) | ||
}, true); | ||
[complexOptionName]: val | ||
}, [complexOptionName]); | ||
this.renderId++; // will queue a rerender | ||
@@ -209,0 +191,0 @@ } |
@@ -1,1 +0,1 @@ | ||
this.FullCalendar=this.FullCalendar||{},this.FullCalendar.Vue=function(e,t,n,s){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);const l={headerToolbar:!0,footerToolbar:!0,events:!0,eventSources:!0,resources:!0};function o(e){return"object"==typeof e&&(Array.isArray(e)?e=Array.prototype.slice.call(e):e&&(e=Object.assign({},e))),e}const d=document.createDocumentFragment(),a=i.default.extend({render(e){return e("aside",{style:{display:"none"}},this.$slots.default||[])},mounted(){d.appendChild(this.$el)},beforeDestroy(){d.removeChild(this.$el)}}),u=document.createDocumentFragment(),h=i.default.extend({props:{inPlaceOf:Element,reportEl:Function,elTag:String,elClasses:Array,elStyle:Object,elAttrs:Object},render(e){return e(this.elTag,{class:this.elClasses,style:this.elStyle,attrs:this.elAttrs},this.$slots.default||[])},mounted(){p(this.$el,this.inPlaceOf),this.inPlaceOf.style.display="none",this.reportEl(this.$el)},updated(){this.inPlaceOf.parentNode!==u&&(p(this.$el,this.inPlaceOf),this.reportEl(this.$el))},beforeDestroy(){this.inPlaceOf.parentNode===u&&u.removeChild(this.inPlaceOf),this.reportEl(null)}});function p(e,t){var n;null===(n=t.parentNode)||void 0===n||n.insertBefore(e,t.nextSibling),u.appendChild(t)}const c=i.default.extend({props:{options:Object},data:()=>({renderId:0,customRenderingMap:new Map}),methods:{getApi(){return this.calendar},buildOptions(e){return Object.assign(Object.assign({},e),{customRenderingMetaMap:this.$scopedSlots,handleCustomRendering:this.handleCustomRendering,customRenderingReplacesEl:!0})}},render(e){const t=[];for(const n of this.customRenderingMap.values())t.push(e("div",{key:n.id},[e(h,{key:n.id,props:{inPlaceOf:n.containerEl,reportEl:n.reportNewContainerEl,elTag:n.elTag,elClasses:n.elClasses,elStyle:n.elStyle,elAttrs:n.elAttrs}},n.generatorMeta(n.renderProps))]));return e("div",{attrs:{"data-fc-render-id":this.renderId}},[e(a,t)])},mounted(){const e=new s.CustomRenderingStore;this.handleCustomRendering=e.handle.bind(e);const t=this.buildOptions(this.options),r=new n.Calendar(this.$el,t);this.calendar=r,r.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())},beforeDestroy(){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 l)e[`options.${t}`]={deep:!0,handler(e){if(void 0!==e){let n=this.getApi();n.pauseRendering(),n.resetOptions({[t]:o(e)},!0),this.renderId++}}};return e}()});let f,g=!1;function m(e){g||(g=!0,e.component("FullCalendar",c))}return f="undefined"!=typeof globalThis?globalThis.Vue:window.Vue,f&&f.use({install:m}),e.default=c,e.install=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue,FullCalendar,FullCalendar.Internal); | ||
this.FullCalendar=this.FullCalendar||{},this.FullCalendar.Vue=function(e,t,n,s){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(t);const l={headerToolbar:!0,footerToolbar:!0,events:!0,eventSources:!0,resources:!0},d=document.createDocumentFragment(),o=r.default.extend({render(e){return e("aside",{style:{display:"none"}},this.$slots.default||[])},mounted(){d.appendChild(this.$el)},beforeDestroy(){d.removeChild(this.$el)}}),a=document.createDocumentFragment(),u=r.default.extend({props:{inPlaceOf:Element,reportEl:Function,elTag:String,elClasses:Array,elStyle:Object,elAttrs:Object},render(e){return e(this.elTag,{class:this.elClasses,style:this.elStyle,attrs:this.elAttrs},this.$slots.default||[])},mounted(){h(this.$el,this.inPlaceOf),this.inPlaceOf.style.display="none",this.reportEl(this.$el)},updated(){this.inPlaceOf.parentNode!==a&&(h(this.$el,this.inPlaceOf),this.reportEl(this.$el))},beforeDestroy(){this.inPlaceOf.parentNode===a&&a.removeChild(this.inPlaceOf),this.reportEl(null)}});function h(e,t){var n;null===(n=t.parentNode)||void 0===n||n.insertBefore(e,t.nextSibling),a.appendChild(t)}const p=r.default.extend({props:{options:Object},data:()=>({renderId:0,customRenderingMap:new Map}),methods:{getApi(){return this.calendar},buildOptions(e){return Object.assign(Object.assign({},e),{customRenderingMetaMap:this.$scopedSlots,handleCustomRendering:this.handleCustomRendering,customRenderingReplacesEl:!0})}},render(e){const t=[];for(const n of this.customRenderingMap.values())t.push(e("div",{key:n.id},[e(u,{key:n.id,props:{inPlaceOf:n.containerEl,reportEl:n.reportNewContainerEl,elTag:n.elTag,elClasses:n.elClasses,elStyle:n.elStyle,elAttrs:n.elAttrs}},n.generatorMeta(n.renderProps))]));return e("div",{attrs:{"data-fc-render-id":this.renderId}},[e(o,t)])},mounted(){const e=new s.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())},beforeDestroy(){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 l)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}()});let c,f=!1;function g(e){f||(f=!0,e.component("FullCalendar",p))}return c="undefined"!=typeof globalThis?globalThis.Vue:window.Vue,c&&c.use({install:g}),e.default=p,e.install=g,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue,FullCalendar,FullCalendar.Internal); |
{ | ||
"name": "@fullcalendar/vue", | ||
"version": "6.0.3", | ||
"version": "6.1.0", | ||
"title": "FullCalendar Vue 2 Component", | ||
@@ -21,3 +21,3 @@ "description": "The official Vue 2 component for FullCalendar", | ||
"peerDependencies": { | ||
"@fullcalendar/core": "~6.0.3", | ||
"@fullcalendar/core": "~6.1.0", | ||
"vue": "^2.6.12" | ||
@@ -30,7 +30,7 @@ }, | ||
"@babel/runtime": "^7.12.1", | ||
"@fullcalendar/core": "~6.0.3", | ||
"@fullcalendar/daygrid": "~6.0.3", | ||
"@fullcalendar/interaction": "~6.0.3", | ||
"@fullcalendar/resource": "~6.0.3", | ||
"@fullcalendar/resource-timeline": "~6.0.3", | ||
"@fullcalendar/core": "~6.1.0", | ||
"@fullcalendar/daygrid": "~6.1.0", | ||
"@fullcalendar/interaction": "~6.1.0", | ||
"@fullcalendar/resource": "~6.1.0", | ||
"@fullcalendar/resource-timeline": "~6.1.0", | ||
"@vue/test-utils": "^1.0.3", | ||
@@ -37,0 +37,0 @@ "babel-loader": "^8.1.0", |
@@ -5,3 +5,2 @@ import Vue, { PropType, VNode } from 'vue' | ||
import { OPTION_IS_COMPLEX } from './options.js' | ||
import { shallowCopy } from './utils.js' | ||
import OffscreenFragment from './OffscreenFragment.js' | ||
@@ -156,6 +155,4 @@ import TransportContainer from './TransportContainer.js' | ||
calendar.resetOptions({ | ||
// the only reason we shallow-copy is to trick FC into knowing there's a nested change. | ||
// TODO: future versions of FC will more gracefully handle event option-changes that are same-reference. | ||
[complexOptionName]: shallowCopy(val) | ||
}, true) | ||
[complexOptionName]: val | ||
}, [complexOptionName]) | ||
@@ -162,0 +159,0 @@ this.renderId++ // will queue a rerender |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53018
28
939