@fullcalendar/vue
Advanced tools
Comparing version 5.0.0-beta.4 to 5.0.0-rc
306
dist/main.js
@@ -0,261 +1,3 @@ | ||
import FullCalendarComponent from './FullCalendar'; | ||
/* | ||
FullCalendar Vue Component v5.0.0-beta.4 | ||
Docs: https://fullcalendar.io/docs/vue | ||
License: MIT | ||
*/ | ||
import { createPlugin, Calendar } from '@fullcalendar/core'; | ||
import Vue from 'vue'; | ||
export * from '@fullcalendar/common'; | ||
function _typeof(obj) { | ||
"@babel/helpers - typeof"; | ||
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { | ||
_typeof = function (obj) { | ||
return typeof obj; | ||
}; | ||
} else { | ||
_typeof = function (obj) { | ||
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}; | ||
} | ||
return _typeof(obj); | ||
} | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
var OPTION_IS_COMPLEX = { | ||
headerToolbar: true, | ||
footerToolbar: true, | ||
events: true, | ||
eventSources: true, | ||
resources: true | ||
}; | ||
/* | ||
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 = _objectSpread2({}, val); | ||
} | ||
} | ||
return val; | ||
} | ||
function mapHash(input, func) { | ||
var output = {}; | ||
for (var key in input) { | ||
if (hasOwnProperty.call(input, key)) { | ||
output[key] = func(input[key], key); | ||
} | ||
} | ||
return output; | ||
} | ||
/* | ||
wrap it in an object with a `vue` key, which the custom content-type handler system will look for | ||
*/ | ||
function wrapVDomGenerator(vDomGenerator) { | ||
return function () { | ||
return { | ||
vue: vDomGenerator.apply(this, arguments) | ||
}; | ||
}; | ||
} | ||
var VueContentTypePlugin = createPlugin({ | ||
contentTypeHandlers: { | ||
vue: buildVDomHandler // looks for the `vue` key | ||
} | ||
}); | ||
function buildVDomHandler() { | ||
var currentEl; | ||
var v; // the Vue instance | ||
return function (el, vDomContent) { | ||
// the handler | ||
if (currentEl !== el) { | ||
if (currentEl && v) { | ||
// if changing elements, recreate the vue | ||
v.$destroy(); | ||
} | ||
currentEl = el; | ||
} | ||
if (!v) { | ||
v = initVue(vDomContent); // vue's mount method *replaces* the given element. create an artificial inner el | ||
var innerEl = document.createElement('span'); | ||
el.appendChild(innerEl); | ||
v.$mount(innerEl); | ||
} else { | ||
v.content = vDomContent; | ||
} | ||
}; | ||
} | ||
function initVue(initialContent) { | ||
return new Vue({ | ||
props: ['content'], | ||
propsData: { | ||
content: initialContent | ||
}, | ||
render: function render(h) { | ||
var content = this.content; // the slot result can be an array, but the returned value of a vue component's | ||
// render method must be a single node. | ||
if (content.length === 1) { | ||
return content[0]; | ||
} else if (content.length) { | ||
return h('span', {}, content); | ||
} | ||
} | ||
}); | ||
} | ||
/* | ||
IMPORTANT NOTE: `this.$options` is merely a place to store state. | ||
The `this.options` prop holds the FullCalendar options. | ||
*/ | ||
var FullCalendarComponent = { | ||
props: ['options'], | ||
data: function data() { | ||
return { | ||
renderId: 0 | ||
}; | ||
}, | ||
render: function render(createElement) { | ||
return createElement('div', { | ||
// when renderId is changed, Vue will trigger a real-DOM async rerender, calling beforeUpdate/updated | ||
attrs: { | ||
'data-fc-render-id': this.renderId | ||
} | ||
}); | ||
}, | ||
mounted: function mounted() { | ||
var options = this.options || {}; | ||
this.$options.calendar = new Calendar(this.$el, // the snapshot will NOT use this transformed object, so it's okay to inject new values | ||
buildInitialOptions(options, this.$scopedSlots) // will pull out the values from the options getter functions | ||
); | ||
this.$options.calendar.render(); | ||
}, | ||
methods: { | ||
getApi: function getApi() { | ||
return this.$options.calendar; | ||
} | ||
}, | ||
beforeUpdate: function beforeUpdate() { | ||
this.getApi().resumeRendering(); // the watcher handlers paused it | ||
}, | ||
beforeDestroy: function beforeDestroy() { | ||
this.getApi().destroy(); | ||
}, | ||
watch: buildWatchers() | ||
}; | ||
function buildWatchers() { | ||
var 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: function handler(options) { | ||
var calendar = this.getApi(); | ||
calendar.pauseRendering(); | ||
calendar.resetOptions(shallowCopy(options)); // pull out values from getters | ||
this.renderId++; // will queue a rerender | ||
} | ||
} | ||
}; | ||
var _loop = function _loop(complexOptionName) { | ||
// handlers called when nested objects change | ||
watchers["options.".concat(complexOptionName)] = { | ||
deep: true, | ||
handler: function 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) { | ||
var calendar = this.getApi(); | ||
calendar.pauseRendering(); | ||
calendar.resetOptions(_defineProperty({}, complexOptionName, shallowCopy(val)), true); | ||
this.renderId++; // will queue a rerender | ||
} | ||
} | ||
}; | ||
}; | ||
for (var complexOptionName in OPTION_IS_COMPLEX) { | ||
_loop(complexOptionName); | ||
} | ||
return watchers; | ||
} | ||
function buildInitialOptions(options, scopedSlots) { | ||
return _objectSpread2(_objectSpread2({}, options), {}, { | ||
plugins: (options.plugins || []).concat([VueContentTypePlugin]) | ||
}, mapHash(scopedSlots, wrapVDomGenerator)); | ||
} | ||
/* | ||
Registers the component globally if appropriate. | ||
@@ -267,28 +9,28 @@ This modules exposes the component AND an install function. | ||
*/ | ||
var installed = false; // declare install function executed by Vue.use() | ||
function install(Vue) { | ||
if (!installed) { | ||
installed = true; | ||
Vue.component('FullCalendar', FullCalendarComponent); | ||
} | ||
} // detect a globally availble version of Vue (eg. in browser via <script> tag) | ||
var installed = false; | ||
// declare install function executed by Vue.use() | ||
export function install(Vue) { | ||
if (!installed) { | ||
installed = true; | ||
Vue.component('FullCalendar', FullCalendarComponent); | ||
} | ||
} | ||
// detect a globally availble version of Vue (eg. in browser via <script> tag) | ||
var GlobalVue; | ||
if (typeof window !== 'undefined') { | ||
GlobalVue = window.Vue; | ||
} else if (typeof global !== 'undefined') { | ||
GlobalVue = global.Vue; | ||
} // auto-install if possible | ||
GlobalVue = window.Vue; | ||
} | ||
else if (typeof global !== 'undefined') { | ||
GlobalVue = global.Vue; | ||
} | ||
// auto-install if possible | ||
if (GlobalVue) { | ||
GlobalVue.use({ | ||
install: install | ||
}); | ||
} // to allow use as module (npm/webpack/etc.) export component | ||
GlobalVue.use({ | ||
install: install | ||
}); | ||
} | ||
// to allow use as module (npm/webpack/etc.) export component | ||
export default FullCalendarComponent; | ||
export { install }; | ||
// so can access any of the utils/types from this lib | ||
export * from '@fullcalendar/core'; | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "@fullcalendar/vue", | ||
"version": "5.0.0-beta.4", | ||
"version": "5.0.0-rc", | ||
"title": "FullCalendar Vue Component", | ||
@@ -18,32 +18,25 @@ "description": "An official FullCalendar component for Vue", | ||
"scripts": { | ||
"clean": "rm -rf dist tmp", | ||
"watch": "rollup -c --environment BUILD:development --watch", | ||
"build": "rollup -c --environment BUILD:production", | ||
"test": "karma start --browsers ChromeHeadless --single-run --no-auto-watch", | ||
"test:watch": "karma start", | ||
"lint": "eslint src tests *.js", | ||
"tsc": "tsc -p tsconfig.json", | ||
"clean": "rm -rf dist", | ||
"build": "tsc -p tsconfig.json", | ||
"watch": "tsc -p tsconfig.json --watch", | ||
"test": "karma start", | ||
"test:ci": "karma start --browsers ChromeHeadless --single-run --no-auto-watch", | ||
"ci": "./scripts/ci.sh" | ||
}, | ||
"dependencies": { | ||
"@fullcalendar/core": "5.0.0-beta.4", | ||
"@fullcalendar/common": "5.0.0-beta.4" | ||
"@fullcalendar/core": "5.0.0-rc", | ||
"tslib": "^2.0.0" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^2.6.6" | ||
"vue": "^2.6.11" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.10.2", | ||
"@babel/plugin-transform-runtime": "^7.10.1", | ||
"@babel/preset-env": "^7.8.4", | ||
"@fullcalendar/daygrid": "5.0.0-beta.4", | ||
"@rollup/plugin-babel": "^5.0.0", | ||
"@rollup/plugin-commonjs": "^11.1.0", | ||
"@rollup/plugin-json": "^4.0.3", | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"@rollup/plugin-replace": "^2.3.2", | ||
"@vue/test-utils": "1.0.0-beta.29", | ||
"eslint": "^5.16.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "^2.20.1", | ||
"eslint-plugin-node": "^9.2.0", | ||
"eslint-plugin-promise": "^4.1.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"@fullcalendar/daygrid": "5.0.0-rc", | ||
"@vue/test-utils": "^1.0.3", | ||
"babel-loader": "^8.1.0", | ||
"css-loader": "^3.6.0", | ||
"karma": "^5.0.4", | ||
@@ -54,11 +47,16 @@ "karma-chrome-launcher": "^3.1.0", | ||
"karma-spec-reporter": "^0.0.32", | ||
"rollup": "^1.31.0", | ||
"rollup-plugin-postcss": "^2.0.3", | ||
"karma-webpack": "^4.0.2", | ||
"source-map-loader": "^1.0.0", | ||
"style-loader": "^1.2.1", | ||
"typescript": "^3.8.3", | ||
"vue": "^2.6.11", | ||
"vue-template-compiler": "^2.6.11" | ||
"vue-template-compiler": "^2.6.11", | ||
"webpack": "^4.43.0" | ||
}, | ||
"module": "dist/main.js", | ||
"main": "dist/main.js", | ||
"types": "dist/main.d.ts", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"src" | ||
] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25027
19
24
464
1
+ Addedtslib@^2.0.0
+ Added@fullcalendar/common@5.0.0-rc(transitive)
+ Added@fullcalendar/core@5.0.0-rc(transitive)
+ Addedtslib@2.6.3(transitive)
- Removed@fullcalendar/common@5.0.0-beta.4
- Removed@fullcalendar/common@5.0.0-beta.4(transitive)
- Removed@fullcalendar/core@5.0.0-beta.4(transitive)
- Removedtslib@1.14.1(transitive)
Updated@fullcalendar/core@5.0.0-rc