@event-calendar/core
Advanced tools
Comparing version 0.7.0 to 0.7.1
67
index.js
@@ -1347,2 +1347,5 @@ import { is_function, tick, noop, identity, SvelteComponent, init, safe_not_equal, empty, insert, detach, destroy_each, component_subscribe, set_store_value, element, text, attr, append, listen, set_data, space, transition_in, group_outros, transition_out, check_outros, create_component, mount_component, destroy_component, set_style } from 'svelte/internal'; | ||
function instance($$self, $$props, $$invalidate) { | ||
let $events; | ||
let $_events; | ||
let $eventSources; | ||
let $theme; | ||
@@ -1356,5 +1359,8 @@ let $height; | ||
setContext('state', state); | ||
let { _viewComponent, _interaction, height, theme } = state; | ||
let { _viewComponent, _interaction, _events, events, eventSources, height, theme } = state; | ||
component_subscribe($$self, _viewComponent, value => $$invalidate(2, $_viewComponent = value)); | ||
component_subscribe($$self, _interaction, value => $$invalidate(3, $_interaction = value)); | ||
component_subscribe($$self, _events, value => $$invalidate(22, $_events = value)); | ||
component_subscribe($$self, events, value => $$invalidate(21, $events = value)); | ||
component_subscribe($$self, eventSources, value => $$invalidate(23, $eventSources = value)); | ||
component_subscribe($$self, height, value => $$invalidate(1, $height = value)); | ||
@@ -1397,3 +1403,3 @@ component_subscribe($$self, theme, value => $$invalidate(0, $theme = value)); | ||
function addEvent(event) { | ||
state._events.update(events => events.concat(state.events.parse([event]))); | ||
updateEvents(events => events.concat(state.events.parse([event]))); | ||
return this; | ||
@@ -1403,3 +1409,3 @@ } | ||
function updateEvent(event) { | ||
state._events.update(events => { | ||
updateEvents(events => { | ||
for (let e of events) { | ||
@@ -1419,3 +1425,3 @@ if (e.id == event.id) { | ||
function removeEventById(id) { | ||
state._events.update(events => events.filter(event => event.id != id)); | ||
updateEvents(events => events.filter(event => event.id != id)); | ||
return this; | ||
@@ -1428,9 +1434,17 @@ } | ||
function updateEvents(func) { | ||
if ($eventSources.length) { | ||
set_store_value(_events, $_events = func($_events), $_events); | ||
} else { | ||
set_store_value(events, $events = func($events), $events); | ||
} | ||
} | ||
$$self.$$set = $$props => { | ||
if ('plugins' in $$props) $$invalidate(8, plugins = $$props.plugins); | ||
if ('options' in $$props) $$invalidate(9, options = $$props.options); | ||
if ('plugins' in $$props) $$invalidate(11, plugins = $$props.plugins); | ||
if ('options' in $$props) $$invalidate(12, options = $$props.options); | ||
}; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*options*/ 512) { | ||
if ($$self.$$.dirty & /*options*/ 4096) { | ||
// Reactively update options that did change | ||
@@ -1450,2 +1464,5 @@ for (let [name, value] of diff(options)) { | ||
_interaction, | ||
_events, | ||
events, | ||
eventSources, | ||
height, | ||
@@ -1471,12 +1488,12 @@ theme, | ||
init(this, options, instance, create_fragment, safe_not_equal, { | ||
plugins: 8, | ||
options: 9, | ||
setOption: 10, | ||
getOption: 11, | ||
refetchEvents: 12, | ||
getEventById: 13, | ||
addEvent: 14, | ||
updateEvent: 15, | ||
removeEventById: 16, | ||
getView: 17 | ||
plugins: 11, | ||
options: 12, | ||
setOption: 13, | ||
getOption: 14, | ||
refetchEvents: 15, | ||
getEventById: 16, | ||
addEvent: 17, | ||
updateEvent: 18, | ||
removeEventById: 19, | ||
getView: 20 | ||
}); | ||
@@ -1486,31 +1503,31 @@ } | ||
get setOption() { | ||
return this.$$.ctx[10]; | ||
return this.$$.ctx[13]; | ||
} | ||
get getOption() { | ||
return this.$$.ctx[11]; | ||
return this.$$.ctx[14]; | ||
} | ||
get refetchEvents() { | ||
return this.$$.ctx[12]; | ||
return this.$$.ctx[15]; | ||
} | ||
get getEventById() { | ||
return this.$$.ctx[13]; | ||
return this.$$.ctx[16]; | ||
} | ||
get addEvent() { | ||
return this.$$.ctx[14]; | ||
return this.$$.ctx[17]; | ||
} | ||
get updateEvent() { | ||
return this.$$.ctx[15]; | ||
return this.$$.ctx[18]; | ||
} | ||
get removeEventById() { | ||
return this.$$.ctx[16]; | ||
return this.$$.ctx[19]; | ||
} | ||
get getView() { | ||
return this.$$.ctx[17]; | ||
return this.$$.ctx[20]; | ||
} | ||
@@ -1517,0 +1534,0 @@ } |
{ | ||
"name": "@event-calendar/core", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"title": "Event Calendar Core package", | ||
@@ -21,5 +21,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/common": "~0.7.0", | ||
"@event-calendar/common": "~0.7.1", | ||
"svelte": "^3.42.4" | ||
} | ||
} |
@@ -7,3 +7,3 @@ # Event Calendar [![](https://data.jsdelivr.com/v1/package/npm/@event-calendar/build/badge)](https://www.jsdelivr.com/package/npm/@event-calendar/build) | ||
* Lightweight (41.9kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Lightweight (44kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Zero-dependency (pre-built bundle) | ||
@@ -10,0 +10,0 @@ * Used by [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/) |
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
91751
1342