@fullcalendar/vue
Advanced tools
Comparing version 6.0.0-beta.3 to 6.0.0-beta.4
@@ -23,19 +23,25 @@ import Vue from 'vue'; | ||
buildOptions(suppliedOptions) { | ||
return Object.assign(Object.assign({}, suppliedOptions), { customRenderingMetaMap: this.$scopedSlots, handleCustomRendering: getSecret(this).handleCustomRendering }); | ||
return Object.assign(Object.assign({}, suppliedOptions), { customRenderingMetaMap: this.$scopedSlots, handleCustomRendering: getSecret(this).handleCustomRendering, customRenderingReplacesEl: true }); | ||
}, | ||
}, | ||
render(h) { | ||
const transportContainerNodes = []; | ||
const customRenderingNodes = []; | ||
for (const customRendering of this.customRenderingMap.values()) { | ||
transportContainerNodes.push(h(TransportContainer, { | ||
key: customRendering.id, | ||
props: { | ||
inPlaceOf: customRendering.containerEl, | ||
elTag: customRendering.elTag, | ||
elClasses: customRendering.elClasses, | ||
elStyle: customRendering.elStyle, | ||
elAttrs: customRendering.elAttrs, | ||
} | ||
}, customRendering.generatorMeta(// a slot-render-function | ||
customRendering.renderProps))); | ||
customRenderingNodes.push( | ||
// need stable element reference for list-diffing | ||
// TODO: move this functionality within TransportContainer | ||
h('div', { key: customRendering.id }, [ | ||
h(TransportContainer, { | ||
key: customRendering.id, | ||
props: { | ||
inPlaceOf: customRendering.containerEl, | ||
reportEl: customRendering.reportNewContainerEl, | ||
elTag: customRendering.elTag, | ||
elClasses: customRendering.elClasses, | ||
elStyle: customRendering.elStyle, | ||
elAttrs: customRendering.elAttrs, | ||
} | ||
}, customRendering.generatorMeta(// a slot-render-function | ||
customRendering.renderProps)) | ||
])); | ||
} | ||
@@ -47,3 +53,3 @@ return h('div', { | ||
// for containing TransportContainer keys | ||
h(OffscreenFragment, transportContainerNodes) | ||
h(OffscreenFragment, customRenderingNodes) | ||
]); | ||
@@ -59,4 +65,4 @@ }, | ||
customRenderingStore.subscribe((customRenderingMap) => { | ||
this.renderId++; // because below line won't trigger if reference is same | ||
this.customRenderingMap = customRenderingMap; | ||
this.customRenderingMap = customRenderingMap; // likely same reference, so won't rerender | ||
this.renderId++; // force rerender | ||
}); | ||
@@ -63,0 +69,0 @@ }, |
@@ -47,3 +47,3 @@ this.FullCalendar = this.FullCalendar || {}; | ||
}, | ||
destroyed() { | ||
beforeDestroy() { | ||
dummyContainer$1.removeChild(this.$el); | ||
@@ -57,2 +57,3 @@ } | ||
inPlaceOf: Element, | ||
reportEl: Function, | ||
elTag: String, | ||
@@ -72,2 +73,3 @@ elClasses: Array, | ||
replaceEl(this.$el, this.inPlaceOf); | ||
this.reportEl(this.$el); | ||
}, | ||
@@ -81,6 +83,8 @@ updated() { | ||
replaceEl(this.$el, this.inPlaceOf); | ||
this.reportEl(this.$el); | ||
} | ||
}, | ||
destroyed() { | ||
beforeDestroy() { | ||
dummyContainer.removeChild(this.inPlaceOf); | ||
this.reportEl(null); | ||
} | ||
@@ -109,19 +113,25 @@ }); | ||
buildOptions(suppliedOptions) { | ||
return Object.assign(Object.assign({}, suppliedOptions), { customRenderingMetaMap: this.$scopedSlots, handleCustomRendering: getSecret(this).handleCustomRendering }); | ||
return Object.assign(Object.assign({}, suppliedOptions), { customRenderingMetaMap: this.$scopedSlots, handleCustomRendering: getSecret(this).handleCustomRendering, customRenderingReplacesEl: true }); | ||
}, | ||
}, | ||
render(h) { | ||
const transportContainerNodes = []; | ||
const customRenderingNodes = []; | ||
for (const customRendering of this.customRenderingMap.values()) { | ||
transportContainerNodes.push(h(TransportContainer, { | ||
key: customRendering.id, | ||
props: { | ||
inPlaceOf: customRendering.containerEl, | ||
elTag: customRendering.elTag, | ||
elClasses: customRendering.elClasses, | ||
elStyle: customRendering.elStyle, | ||
elAttrs: customRendering.elAttrs, | ||
} | ||
}, customRendering.generatorMeta(// a slot-render-function | ||
customRendering.renderProps))); | ||
customRenderingNodes.push( | ||
// need stable element reference for list-diffing | ||
// TODO: move this functionality within TransportContainer | ||
h('div', { key: customRendering.id }, [ | ||
h(TransportContainer, { | ||
key: customRendering.id, | ||
props: { | ||
inPlaceOf: customRendering.containerEl, | ||
reportEl: customRendering.reportNewContainerEl, | ||
elTag: customRendering.elTag, | ||
elClasses: customRendering.elClasses, | ||
elStyle: customRendering.elStyle, | ||
elAttrs: customRendering.elAttrs, | ||
} | ||
}, customRendering.generatorMeta(// a slot-render-function | ||
customRendering.renderProps)) | ||
])); | ||
} | ||
@@ -133,3 +143,3 @@ return h('div', { | ||
// for containing TransportContainer keys | ||
h(OffscreenFragment, transportContainerNodes) | ||
h(OffscreenFragment, customRenderingNodes) | ||
]); | ||
@@ -145,4 +155,4 @@ }, | ||
customRenderingStore.subscribe((customRenderingMap) => { | ||
this.renderId++; // because below line won't trigger if reference is same | ||
this.customRenderingMap = customRenderingMap; | ||
this.customRenderingMap = customRenderingMap; // likely same reference, so won't rerender | ||
this.renderId++; // force rerender | ||
}); | ||
@@ -149,0 +159,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 l=r(t);const i={headerToolbar:!0,footerToolbar:!0,events:!0,eventSources:!0,resources:!0};function a(e){return"object"==typeof e&&(Array.isArray(e)?e=Array.prototype.slice.call(e):e&&(e=Object.assign({},e))),e}const d=document.createDocumentFragment(),o=l.default.extend({render(e){return e("aside",{style:{display:"none"}},this.$slots.default||[])},mounted(){d.appendChild(this.$el)},destroyed(){d.removeChild(this.$el)}}),u=document.createDocumentFragment(),c=l.default.extend({props:{inPlaceOf:Element,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)},updated(){this.inPlaceOf.parentNode!==u&&h(this.$el,this.inPlaceOf)},destroyed(){u.removeChild(this.inPlaceOf)}});function h(e,t){var n;null===(n=t.parentNode)||void 0===n||n.insertBefore(e,t.nextSibling),u.appendChild(t)}const p=l.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})}},render(e){const t=[];for(const n of this.customRenderingMap.values())t.push(e(c,{key:n.id,props:{inPlaceOf:n.containerEl,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),r=new n.Calendar(this.$el,t);this.calendar=r,r.render(),e.subscribe((e=>{this.renderId++,this.customRenderingMap=e}))},beforeUpdate(){this.getApi().resumeRendering()},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 i)e[`options.${t}`]={deep:!0,handler(e){if(void 0!==e){let n=this.getApi();n.pauseRendering(),n.resetOptions({[t]:a(e)},!0),this.renderId++}}};return e}()});let f,g=!1;function m(e){g||(g=!0,e.component("FullCalendar",p))}return f="undefined"!=typeof globalThis?globalThis.Vue:window.Vue,f&&f.use({install:m}),e.default=p,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,r){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(t);const i={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 a=document.createDocumentFragment(),d=l.default.extend({render(e){return e("aside",{style:{display:"none"}},this.$slots.default||[])},mounted(){a.appendChild(this.$el)},beforeDestroy(){a.removeChild(this.$el)}}),u=document.createDocumentFragment(),h=l.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(){c(this.$el,this.inPlaceOf),this.reportEl(this.$el)},updated(){this.inPlaceOf.parentNode!==u&&(c(this.$el,this.inPlaceOf),this.reportEl(this.$el))},beforeDestroy(){u.removeChild(this.inPlaceOf),this.reportEl(null)}});function c(e,t){var n;null===(n=t.parentNode)||void 0===n||n.insertBefore(e,t.nextSibling),u.appendChild(t)}const p=l.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(d,t)])},mounted(){const e=new r.CustomRenderingStore;this.handleCustomRendering=e.handle.bind(e);const t=this.buildOptions(this.options),s=new n.Calendar(this.$el,t);this.calendar=s,s.render(),e.subscribe((e=>{this.customRenderingMap=e,this.renderId++}))},beforeUpdate(){this.getApi().resumeRendering()},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 i)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 b(e){g||(g=!0,e.component("FullCalendar",p))}return f="undefined"!=typeof globalThis?globalThis.Vue:window.Vue,f&&f.use({install:b}),e.default=p,e.install=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue,FullCalendar,FullCalendar.Internal); |
@@ -16,3 +16,3 @@ import Vue from 'vue'; | ||
}, | ||
destroyed() { | ||
beforeDestroy() { | ||
dummyContainer.removeChild(this.$el); | ||
@@ -19,0 +19,0 @@ } |
import Vue from 'vue'; | ||
declare const TransportContainer: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, unknown, unknown, unknown, { | ||
inPlaceOf: Element; | ||
reportEl: Function; | ||
elTag: string; | ||
@@ -5,0 +6,0 @@ elClasses: unknown[]; |
@@ -6,2 +6,3 @@ import Vue from 'vue'; | ||
inPlaceOf: Element, | ||
reportEl: Function, | ||
elTag: String, | ||
@@ -21,2 +22,3 @@ elClasses: Array, | ||
replaceEl(this.$el, this.inPlaceOf); | ||
this.reportEl(this.$el); | ||
}, | ||
@@ -30,6 +32,8 @@ updated() { | ||
replaceEl(this.$el, this.inPlaceOf); | ||
this.reportEl(this.$el); | ||
} | ||
}, | ||
destroyed() { | ||
beforeDestroy() { | ||
dummyContainer.removeChild(this.inPlaceOf); | ||
this.reportEl(null); | ||
} | ||
@@ -36,0 +40,0 @@ }); |
{ | ||
"name": "@fullcalendar/vue", | ||
"version": "6.0.0-beta.3", | ||
"version": "6.0.0-beta.4", | ||
"title": "FullCalendar Vue 2 Component", | ||
@@ -18,3 +18,3 @@ "description": "An official FullCalendar component for Vue 2", | ||
"peerDependencies": { | ||
"@fullcalendar/core": "6.0.0-beta.3", | ||
"@fullcalendar/core": "6.0.0-beta.4", | ||
"vue": "^2.6.12" | ||
@@ -27,4 +27,5 @@ }, | ||
"@babel/runtime": "^7.12.1", | ||
"@fullcalendar/core": "6.0.0-beta.3", | ||
"@fullcalendar/daygrid": "6.0.0-beta.3", | ||
"@fullcalendar/core": "6.0.0-beta.4", | ||
"@fullcalendar/daygrid": "6.0.0-beta.4", | ||
"@fullcalendar/interaction": "6.0.0-beta.4", | ||
"@vue/test-utils": "^1.0.3", | ||
@@ -59,6 +60,5 @@ "babel-loader": "^8.1.0", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.global.js" | ||
"import": "./dist/index.js" | ||
} | ||
@@ -65,0 +65,0 @@ }, |
@@ -31,2 +31,3 @@ import Vue, { PropType, VNode } from 'vue' | ||
handleCustomRendering: getSecret(this).handleCustomRendering, | ||
customRenderingReplacesEl: true, | ||
} | ||
@@ -37,18 +38,23 @@ }, | ||
render(h) { | ||
const transportContainerNodes: VNode[] = [] | ||
const customRenderingNodes: VNode[] = [] | ||
for (const customRendering of this.customRenderingMap.values()) { | ||
transportContainerNodes.push( | ||
h(TransportContainer, { | ||
key: customRendering.id, | ||
props: { | ||
inPlaceOf: customRendering.containerEl, | ||
elTag: customRendering.elTag, | ||
elClasses: customRendering.elClasses, | ||
elStyle: customRendering.elStyle, | ||
elAttrs: customRendering.elAttrs, | ||
} | ||
}, customRendering.generatorMeta( // a slot-render-function | ||
customRendering.renderProps | ||
)) | ||
customRenderingNodes.push( | ||
// need stable element reference for list-diffing | ||
// TODO: move this functionality within TransportContainer | ||
h('div', { key: customRendering.id}, [ | ||
h(TransportContainer, { | ||
key: customRendering.id, | ||
props: { | ||
inPlaceOf: customRendering.containerEl, | ||
reportEl: customRendering.reportNewContainerEl, | ||
elTag: customRendering.elTag, | ||
elClasses: customRendering.elClasses, | ||
elStyle: customRendering.elStyle, | ||
elAttrs: customRendering.elAttrs, | ||
} | ||
}, customRendering.generatorMeta( // a slot-render-function | ||
customRendering.renderProps | ||
)) | ||
]) | ||
) | ||
@@ -62,3 +68,3 @@ } | ||
// for containing TransportContainer keys | ||
h(OffscreenFragment, transportContainerNodes) | ||
h(OffscreenFragment, customRenderingNodes) | ||
]) | ||
@@ -77,4 +83,4 @@ }, | ||
customRenderingStore.subscribe((customRenderingMap) => { | ||
this.renderId++ // because below line won't trigger if reference is same | ||
this.customRenderingMap = customRenderingMap | ||
this.customRenderingMap = customRenderingMap // likely same reference, so won't rerender | ||
this.renderId++ // force rerender | ||
}) | ||
@@ -81,0 +87,0 @@ }, |
@@ -20,3 +20,3 @@ import Vue from 'vue' | ||
destroyed() { | ||
beforeDestroy() { | ||
dummyContainer.removeChild(this.$el) | ||
@@ -23,0 +23,0 @@ } |
@@ -8,2 +8,3 @@ import Vue from 'vue' | ||
inPlaceOf: Element, | ||
reportEl: Function, // TODO: better type | ||
elTag: String, | ||
@@ -25,2 +26,3 @@ elClasses: Array, | ||
replaceEl(this.$el, this.inPlaceOf) | ||
this.reportEl(this.$el) | ||
}, | ||
@@ -35,7 +37,9 @@ | ||
replaceEl(this.$el, this.inPlaceOf) | ||
this.reportEl(this.$el) | ||
} | ||
}, | ||
destroyed() { | ||
beforeDestroy() { | ||
dummyContainer.removeChild(this.inPlaceOf) | ||
this.reportEl(null) | ||
} | ||
@@ -42,0 +46,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
50601
963
26