first commit
This commit is contained in:
commit
eb2f504652
32490 changed files with 5731109 additions and 0 deletions
15
node_modules/@fullcalendar/vue3/dist/FullCalendar.d.ts
generated
vendored
Normal file
15
node_modules/@fullcalendar/vue3/dist/FullCalendar.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { PropType } from 'vue';
|
||||
import { Calendar, CalendarOptions } from '@fullcalendar/core';
|
||||
import { CustomRendering } from '@fullcalendar/core/internal';
|
||||
declare const FullCalendar: import("vue").DefineComponent<{
|
||||
options: PropType<CalendarOptions>;
|
||||
}, unknown, {
|
||||
renderId: number;
|
||||
customRenderingMap: Map<string, CustomRendering<any>>;
|
||||
}, {}, {
|
||||
getApi(): Calendar;
|
||||
buildOptions(suppliedOptions: CalendarOptions | undefined): CalendarOptions;
|
||||
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
options: PropType<CalendarOptions>;
|
||||
}>>, {}>;
|
||||
export default FullCalendar;
|
||||
139
node_modules/@fullcalendar/vue3/dist/FullCalendar.js
generated
vendored
Normal file
139
node_modules/@fullcalendar/vue3/dist/FullCalendar.js
generated
vendored
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
import { defineComponent, h, Fragment, Teleport } from 'vue';
|
||||
import { Calendar } from '@fullcalendar/core';
|
||||
import { CustomRenderingStore } from '@fullcalendar/core/internal';
|
||||
import { OPTION_IS_COMPLEX } from './options.js';
|
||||
const FullCalendar = defineComponent({
|
||||
props: {
|
||||
options: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
renderId: 0,
|
||||
customRenderingMap: new Map()
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getApi() {
|
||||
return getSecret(this).calendar;
|
||||
},
|
||||
buildOptions(suppliedOptions) {
|
||||
return {
|
||||
...suppliedOptions,
|
||||
customRenderingMetaMap: kebabToCamelKeys(this.$slots),
|
||||
handleCustomRendering: getSecret(this).handleCustomRendering,
|
||||
};
|
||||
},
|
||||
},
|
||||
render() {
|
||||
const customRenderingNodes = [];
|
||||
for (const customRendering of this.customRenderingMap.values()) {
|
||||
customRenderingNodes.push(h(CustomRenderingComponent, {
|
||||
key: customRendering.id,
|
||||
customRendering,
|
||||
}));
|
||||
}
|
||||
return h('div', {
|
||||
// when renderId is changed, Vue will trigger a real-DOM async rerender, calling beforeUpdate/updated
|
||||
attrs: { 'data-fc-render-id': this.renderId }
|
||||
}, h(Fragment, customRenderingNodes)); // for containing CustomRendering keys
|
||||
},
|
||||
mounted() {
|
||||
const customRenderingStore = new CustomRenderingStore();
|
||||
getSecret(this).handleCustomRendering = customRenderingStore.handle.bind(customRenderingStore);
|
||||
const calendarOptions = this.buildOptions(this.options);
|
||||
const calendar = new Calendar(this.$el, calendarOptions);
|
||||
getSecret(this).calendar = calendar;
|
||||
calendar.render();
|
||||
customRenderingStore.subscribe((customRenderingMap) => {
|
||||
this.customRenderingMap = customRenderingMap; // likely same reference, so won't rerender
|
||||
this.renderId++; // force rerender
|
||||
getSecret(this).needCustomRenderingResize = true;
|
||||
});
|
||||
},
|
||||
beforeUpdate() {
|
||||
this.getApi().resumeRendering(); // the watcher handlers paused it
|
||||
},
|
||||
updated() {
|
||||
if (getSecret(this).needCustomRenderingResize) {
|
||||
getSecret(this).needCustomRenderingResize = false;
|
||||
this.getApi().updateSize();
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.getApi().destroy();
|
||||
},
|
||||
watch: buildWatchers()
|
||||
});
|
||||
export default FullCalendar;
|
||||
// Custom Rendering
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
const CustomRenderingComponent = defineComponent({
|
||||
props: {
|
||||
customRendering: Object
|
||||
},
|
||||
render() {
|
||||
const customRendering = this.customRendering;
|
||||
const innerContent = typeof customRendering.generatorMeta === 'function' ?
|
||||
customRendering.generatorMeta(customRendering.renderProps) : // vue-normalized slot function
|
||||
customRendering.generatorMeta; // probably a vue JSX node returned from content-inject func
|
||||
return h(Teleport, { to: customRendering.containerEl }, innerContent);
|
||||
}
|
||||
});
|
||||
// storing internal state:
|
||||
// https://github.com/vuejs/vue/issues/1988#issuecomment-163013818
|
||||
function getSecret(inst) {
|
||||
return inst;
|
||||
}
|
||||
function buildWatchers() {
|
||||
let watchers = {
|
||||
// watches changes of ALL options and their nested objects,
|
||||
// but this is only a means to be notified of top-level non-complex options changes.
|
||||
options: {
|
||||
deep: true,
|
||||
handler(options) {
|
||||
let calendar = this.getApi();
|
||||
calendar.pauseRendering();
|
||||
let calendarOptions = this.buildOptions(options);
|
||||
calendar.resetOptions(calendarOptions);
|
||||
this.renderId++; // will queue a rerender
|
||||
}
|
||||
}
|
||||
};
|
||||
for (let complexOptionName in OPTION_IS_COMPLEX) {
|
||||
// handlers called when nested objects change
|
||||
watchers[`options.${complexOptionName}`] = {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
// unfortunately the handler is called with undefined if new props were set, but the complex one wasn't ever set
|
||||
if (val !== undefined) {
|
||||
let calendar = this.getApi();
|
||||
calendar.pauseRendering();
|
||||
calendar.resetOptions({
|
||||
[complexOptionName]: val
|
||||
}, [complexOptionName]);
|
||||
this.renderId++; // will queue a rerender
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return watchers;
|
||||
}
|
||||
// General Utils
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
function kebabToCamelKeys(map) {
|
||||
const newMap = {};
|
||||
for (const key in map) {
|
||||
newMap[kebabToCamel(key)] = map[key];
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
function kebabToCamel(s) {
|
||||
return s
|
||||
.split('-')
|
||||
.map((word, index) => index ? capitalize(word) : word)
|
||||
.join('');
|
||||
}
|
||||
function capitalize(s) {
|
||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
||||
}
|
||||
//# sourceMappingURL=FullCalendar.js.map
|
||||
1
node_modules/@fullcalendar/vue3/dist/FullCalendar.js.map
generated
vendored
Normal file
1
node_modules/@fullcalendar/vue3/dist/FullCalendar.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"FullCalendar.js","sourceRoot":"","sources":["../src/FullCalendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAS,MAAM,KAAK,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAmB,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAmB,MAAM,6BAA6B,CAAA;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,MAAM,YAAY,GAAG,eAAe,CAAC;IACnC,KAAK,EAAE;QACL,OAAO,EAAE,MAAmC;KAC7C;IAED,IAAI;QACF,OAAO;YACL,QAAQ,EAAE,CAAC;YACX,kBAAkB,EAAE,IAAI,GAAG,EAAgC;SAC5D,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,MAAM;YACJ,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAA;QACjC,CAAC;QAED,YAAY,CAAC,eAA4C;YACvD,OAAO;gBACL,GAAG,eAAe;gBAClB,sBAAsB,EAAE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC;gBACrD,qBAAqB,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,qBAAqB;aAC7D,CAAA;QACH,CAAC;KACF;IAED,MAAM;QACJ,MAAM,oBAAoB,GAAY,EAAE,CAAA;QAExC,KAAK,MAAM,eAAe,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE;YAC9D,oBAAoB,CAAC,IAAI,CACvB,CAAC,CAAC,wBAAwB,EAAE;gBAC1B,GAAG,EAAE,eAAe,CAAC,EAAE;gBACvB,eAAe;aAChB,CAAC,CACH,CAAA;SACF;QAED,OAAO,CAAC,CAAC,KAAK,EAAE;YACd,qGAAqG;YACrG,KA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normal file
|
|
@ -0,0 +1,151 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var vue = require('vue');
|
||||
var index_cjs = require('@fullcalendar/core/index.cjs');
|
||||
var internal_cjs = require('@fullcalendar/core/internal.cjs');
|
||||
|
||||
const OPTION_IS_COMPLEX = {
|
||||
headerToolbar: true,
|
||||
footerToolbar: true,
|
||||
events: true,
|
||||
eventSources: true,
|
||||
resources: true
|
||||
};
|
||||
|
||||
const FullCalendar = vue.defineComponent({
|
||||
props: {
|
||||
options: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
renderId: 0,
|
||||
customRenderingMap: new Map()
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getApi() {
|
||||
return getSecret(this).calendar;
|
||||
},
|
||||
buildOptions(suppliedOptions) {
|
||||
return {
|
||||
...suppliedOptions,
|
||||
customRenderingMetaMap: kebabToCamelKeys(this.$slots),
|
||||
handleCustomRendering: getSecret(this).handleCustomRendering,
|
||||
};
|
||||
},
|
||||
},
|
||||
render() {
|
||||
const customRenderingNodes = [];
|
||||
for (const customRendering of this.customRenderingMap.values()) {
|
||||
customRenderingNodes.push(vue.h(CustomRenderingComponent, {
|
||||
key: customRendering.id,
|
||||
customRendering,
|
||||
}));
|
||||
}
|
||||
return vue.h('div', {
|
||||
// when renderId is changed, Vue will trigger a real-DOM async rerender, calling beforeUpdate/updated
|
||||
attrs: { 'data-fc-render-id': this.renderId }
|
||||
}, vue.h(vue.Fragment, customRenderingNodes)); // for containing CustomRendering keys
|
||||
},
|
||||
mounted() {
|
||||
const customRenderingStore = new internal_cjs.CustomRenderingStore();
|
||||
getSecret(this).handleCustomRendering = customRenderingStore.handle.bind(customRenderingStore);
|
||||
const calendarOptions = this.buildOptions(this.options);
|
||||
const calendar = new index_cjs.Calendar(this.$el, calendarOptions);
|
||||
getSecret(this).calendar = calendar;
|
||||
calendar.render();
|
||||
customRenderingStore.subscribe((customRenderingMap) => {
|
||||
this.customRenderingMap = customRenderingMap; // likely same reference, so won't rerender
|
||||
this.renderId++; // force rerender
|
||||
getSecret(this).needCustomRenderingResize = true;
|
||||
});
|
||||
},
|
||||
beforeUpdate() {
|
||||
this.getApi().resumeRendering(); // the watcher handlers paused it
|
||||
},
|
||||
updated() {
|
||||
if (getSecret(this).needCustomRenderingResize) {
|
||||
getSecret(this).needCustomRenderingResize = false;
|
||||
this.getApi().updateSize();
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.getApi().destroy();
|
||||
},
|
||||
watch: buildWatchers()
|
||||
});
|
||||
// Custom Rendering
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
const CustomRenderingComponent = vue.defineComponent({
|
||||
props: {
|
||||
customRendering: Object
|
||||
},
|
||||
render() {
|
||||
const customRendering = this.customRendering;
|
||||
const innerContent = typeof customRendering.generatorMeta === 'function' ?
|
||||
customRendering.generatorMeta(customRendering.renderProps) : // vue-normalized slot function
|
||||
customRendering.generatorMeta; // probably a vue JSX node returned from content-inject func
|
||||
return vue.h(vue.Teleport, { to: customRendering.containerEl }, innerContent);
|
||||
}
|
||||
});
|
||||
// storing internal state:
|
||||
// https://github.com/vuejs/vue/issues/1988#issuecomment-163013818
|
||||
function getSecret(inst) {
|
||||
return inst;
|
||||
}
|
||||
function buildWatchers() {
|
||||
let watchers = {
|
||||
// watches changes of ALL options and their nested objects,
|
||||
// but this is only a means to be notified of top-level non-complex options changes.
|
||||
options: {
|
||||
deep: true,
|
||||
handler(options) {
|
||||
let calendar = this.getApi();
|
||||
calendar.pauseRendering();
|
||||
let calendarOptions = this.buildOptions(options);
|
||||
calendar.resetOptions(calendarOptions);
|
||||
this.renderId++; // will queue a rerender
|
||||
}
|
||||
}
|
||||
};
|
||||
for (let complexOptionName in OPTION_IS_COMPLEX) {
|
||||
// handlers called when nested objects change
|
||||
watchers[`options.${complexOptionName}`] = {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
// unfortunately the handler is called with undefined if new props were set, but the complex one wasn't ever set
|
||||
if (val !== undefined) {
|
||||
let calendar = this.getApi();
|
||||
calendar.pauseRendering();
|
||||
calendar.resetOptions({
|
||||
[complexOptionName]: val
|
||||
}, [complexOptionName]);
|
||||
this.renderId++; // will queue a rerender
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return watchers;
|
||||
}
|
||||
// General Utils
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
function kebabToCamelKeys(map) {
|
||||
const newMap = {};
|
||||
for (const key in map) {
|
||||
newMap[kebabToCamel(key)] = map[key];
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
function kebabToCamel(s) {
|
||||
return s
|
||||
.split('-')
|
||||
.map((word, index) => index ? capitalize(word) : word)
|
||||
.join('');
|
||||
}
|
||||
function capitalize(s) {
|
||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
||||
}
|
||||
|
||||
exports["default"] = FullCalendar;
|
||||
2
node_modules/@fullcalendar/vue3/dist/index.d.ts
generated
vendored
Normal file
2
node_modules/@fullcalendar/vue3/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import FullCalendarComponent from './FullCalendar.js';
|
||||
export default FullCalendarComponent;
|
||||
153
node_modules/@fullcalendar/vue3/dist/index.global.js
generated
vendored
Normal file
153
node_modules/@fullcalendar/vue3/dist/index.global.js
generated
vendored
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
this.FullCalendar = this.FullCalendar || {};
|
||||
this.FullCalendar.Vue = (function (exports, vue, core, internal) {
|
||||
'use strict';
|
||||
|
||||
const OPTION_IS_COMPLEX = {
|
||||
headerToolbar: true,
|
||||
footerToolbar: true,
|
||||
events: true,
|
||||
eventSources: true,
|
||||
resources: true
|
||||
};
|
||||
|
||||
const FullCalendar = vue.defineComponent({
|
||||
props: {
|
||||
options: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
renderId: 0,
|
||||
customRenderingMap: new Map()
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getApi() {
|
||||
return getSecret(this).calendar;
|
||||
},
|
||||
buildOptions(suppliedOptions) {
|
||||
return {
|
||||
...suppliedOptions,
|
||||
customRenderingMetaMap: kebabToCamelKeys(this.$slots),
|
||||
handleCustomRendering: getSecret(this).handleCustomRendering,
|
||||
};
|
||||
},
|
||||
},
|
||||
render() {
|
||||
const customRenderingNodes = [];
|
||||
for (const customRendering of this.customRenderingMap.values()) {
|
||||
customRenderingNodes.push(vue.h(CustomRenderingComponent, {
|
||||
key: customRendering.id,
|
||||
customRendering,
|
||||
}));
|
||||
}
|
||||
return vue.h('div', {
|
||||
// when renderId is changed, Vue will trigger a real-DOM async rerender, calling beforeUpdate/updated
|
||||
attrs: { 'data-fc-render-id': this.renderId }
|
||||
}, vue.h(vue.Fragment, customRenderingNodes)); // for containing CustomRendering keys
|
||||
},
|
||||
mounted() {
|
||||
const customRenderingStore = new internal.CustomRenderingStore();
|
||||
getSecret(this).handleCustomRendering = customRenderingStore.handle.bind(customRenderingStore);
|
||||
const calendarOptions = this.buildOptions(this.options);
|
||||
const calendar = new core.Calendar(this.$el, calendarOptions);
|
||||
getSecret(this).calendar = calendar;
|
||||
calendar.render();
|
||||
customRenderingStore.subscribe((customRenderingMap) => {
|
||||
this.customRenderingMap = customRenderingMap; // likely same reference, so won't rerender
|
||||
this.renderId++; // force rerender
|
||||
getSecret(this).needCustomRenderingResize = true;
|
||||
});
|
||||
},
|
||||
beforeUpdate() {
|
||||
this.getApi().resumeRendering(); // the watcher handlers paused it
|
||||
},
|
||||
updated() {
|
||||
if (getSecret(this).needCustomRenderingResize) {
|
||||
getSecret(this).needCustomRenderingResize = false;
|
||||
this.getApi().updateSize();
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.getApi().destroy();
|
||||
},
|
||||
watch: buildWatchers()
|
||||
});
|
||||
// Custom Rendering
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
const CustomRenderingComponent = vue.defineComponent({
|
||||
props: {
|
||||
customRendering: Object
|
||||
},
|
||||
render() {
|
||||
const customRendering = this.customRendering;
|
||||
const innerContent = typeof customRendering.generatorMeta === 'function' ?
|
||||
customRendering.generatorMeta(customRendering.renderProps) : // vue-normalized slot function
|
||||
customRendering.generatorMeta; // probably a vue JSX node returned from content-inject func
|
||||
return vue.h(vue.Teleport, { to: customRendering.containerEl }, innerContent);
|
||||
}
|
||||
});
|
||||
// storing internal state:
|
||||
// https://github.com/vuejs/vue/issues/1988#issuecomment-163013818
|
||||
function getSecret(inst) {
|
||||
return inst;
|
||||
}
|
||||
function buildWatchers() {
|
||||
let watchers = {
|
||||
// watches changes of ALL options and their nested objects,
|
||||
// but this is only a means to be notified of top-level non-complex options changes.
|
||||
options: {
|
||||
deep: true,
|
||||
handler(options) {
|
||||
let calendar = this.getApi();
|
||||
calendar.pauseRendering();
|
||||
let calendarOptions = this.buildOptions(options);
|
||||
calendar.resetOptions(calendarOptions);
|
||||
this.renderId++; // will queue a rerender
|
||||
}
|
||||
}
|
||||
};
|
||||
for (let complexOptionName in OPTION_IS_COMPLEX) {
|
||||
// handlers called when nested objects change
|
||||
watchers[`options.${complexOptionName}`] = {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
// unfortunately the handler is called with undefined if new props were set, but the complex one wasn't ever set
|
||||
if (val !== undefined) {
|
||||
let calendar = this.getApi();
|
||||
calendar.pauseRendering();
|
||||
calendar.resetOptions({
|
||||
[complexOptionName]: val
|
||||
}, [complexOptionName]);
|
||||
this.renderId++; // will queue a rerender
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return watchers;
|
||||
}
|
||||
// General Utils
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
function kebabToCamelKeys(map) {
|
||||
const newMap = {};
|
||||
for (const key in map) {
|
||||
newMap[kebabToCamel(key)] = map[key];
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
function kebabToCamel(s) {
|
||||
return s
|
||||
.split('-')
|
||||
.map((word, index) => index ? capitalize(word) : word)
|
||||
.join('');
|
||||
}
|
||||
function capitalize(s) {
|
||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
||||
}
|
||||
|
||||
exports["default"] = FullCalendar;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
return exports;
|
||||
|
||||
})({}, Vue, FullCalendar, FullCalendar.Internal);
|
||||
1
node_modules/@fullcalendar/vue3/dist/index.global.min.js
generated
vendored
Normal file
1
node_modules/@fullcalendar/vue3/dist/index.global.min.js
generated
vendored
Normal file
|
|
@ -0,0 +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);
|
||||
3
node_modules/@fullcalendar/vue3/dist/index.js
generated
vendored
Normal file
3
node_modules/@fullcalendar/vue3/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import FullCalendarComponent from './FullCalendar.js';
|
||||
export default FullCalendarComponent;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@fullcalendar/vue3/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@fullcalendar/vue3/dist/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,mBAAmB,CAAA;AAErD,eAAe,qBAAqB,CAAA"}
|
||||
3
node_modules/@fullcalendar/vue3/dist/options.d.ts
generated
vendored
Normal file
3
node_modules/@fullcalendar/vue3/dist/options.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export declare const OPTION_IS_COMPLEX: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
8
node_modules/@fullcalendar/vue3/dist/options.js
generated
vendored
Normal file
8
node_modules/@fullcalendar/vue3/dist/options.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export const OPTION_IS_COMPLEX = {
|
||||
headerToolbar: true,
|
||||
footerToolbar: true,
|
||||
events: true,
|
||||
eventSources: true,
|
||||
resources: true
|
||||
};
|
||||
//# sourceMappingURL=options.js.map
|
||||
1
node_modules/@fullcalendar/vue3/dist/options.js.map
generated
vendored
Normal file
1
node_modules/@fullcalendar/vue3/dist/options.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;CAChB,CAAA"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue