@event-calendar/core
Advanced tools
Comparing version 0.0.1 to 0.1.0-beta.1
162
index.js
@@ -107,4 +107,4 @@ import { is_function, tick, SvelteComponent, init, safe_not_equal, empty, insert, detach, noop, 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 createMutators(options, plugins) { | ||
let mutators = { | ||
function createParsers(options, plugins) { | ||
let parsers = { | ||
buttonText: input => is_function(input) ? input(options.buttonText) : input, | ||
@@ -125,8 +125,8 @@ date: date => setMidnight(createDate(date)), | ||
for (let plugin of plugins) { | ||
if ('createMutators' in plugin) { | ||
plugin.createMutators(mutators, options); | ||
if ('createParsers' in plugin) { | ||
plugin.createParsers(parsers, options); | ||
} | ||
} | ||
return mutators; | ||
return parsers; | ||
} | ||
@@ -305,7 +305,7 @@ | ||
let options = createOptions(plugins); | ||
let mutators = createMutators(options, plugins); | ||
let parsers = createParsers(options, plugins); | ||
// Create stores for options | ||
for (let [option, value] of Object.entries(options)) { | ||
this[option] = writable2(value, mutators[option]); | ||
this[option] = writable2(value, parsers[option]); | ||
} | ||
@@ -327,2 +327,5 @@ | ||
this._viewComponent = writable(undefined); | ||
this._interaction = writable({}); | ||
this._interactionComponent = writable(null); | ||
this._dragEvent = writable(null); | ||
@@ -356,3 +359,3 @@ // Let plugins create their private stores | ||
if (this.hasOwnProperty(key) && key[0] !== '_') { | ||
let {set, _set, mutate, ...rest} = this[key]; | ||
let {set, _set, parse, ...rest} = this[key]; | ||
@@ -364,4 +367,4 @@ if (!_set) { | ||
if (mutate) { | ||
opts[key] = mutate(opts[key]); | ||
if (parse) { | ||
opts[key] = parse(opts[key]); | ||
} | ||
@@ -373,3 +376,3 @@ | ||
_set, | ||
mutate, | ||
parse, | ||
...rest | ||
@@ -1168,4 +1171,6 @@ }; | ||
let toolbar; | ||
let t; | ||
let switch_instance; | ||
let t0; | ||
let switch_instance0; | ||
let t1; | ||
let switch_instance1; | ||
let div_class_value; | ||
@@ -1181,5 +1186,15 @@ let current; | ||
if (switch_value) { | ||
switch_instance = new switch_value(switch_props()); | ||
switch_instance0 = new switch_value(switch_props()); | ||
} | ||
var switch_value_1 = /*$_interactionComponent*/ ctx[3]; | ||
function switch_props_1(ctx) { | ||
return {}; | ||
} | ||
if (switch_value_1) { | ||
switch_instance1 = new switch_value_1(switch_props_1()); | ||
} | ||
return { | ||
@@ -1189,4 +1204,6 @@ c() { | ||
create_component(toolbar.$$.fragment); | ||
t = space(); | ||
if (switch_instance) create_component(switch_instance.$$.fragment); | ||
t0 = space(); | ||
if (switch_instance0) create_component(switch_instance0.$$.fragment); | ||
t1 = space(); | ||
if (switch_instance1) create_component(switch_instance1.$$.fragment); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[0].calendar); | ||
@@ -1198,8 +1215,14 @@ set_style(div, "height", /*$height*/ ctx[1]); | ||
mount_component(toolbar, div, null); | ||
append(div, t); | ||
append(div, t0); | ||
if (switch_instance) { | ||
mount_component(switch_instance, div, null); | ||
if (switch_instance0) { | ||
mount_component(switch_instance0, div, null); | ||
} | ||
append(div, t1); | ||
if (switch_instance1) { | ||
mount_component(switch_instance1, div, null); | ||
} | ||
current = true; | ||
@@ -1209,5 +1232,5 @@ }, | ||
if (switch_value !== (switch_value = /*$_viewComponent*/ ctx[2])) { | ||
if (switch_instance) { | ||
if (switch_instance0) { | ||
group_outros(); | ||
const old_component = switch_instance; | ||
const old_component = switch_instance0; | ||
@@ -1222,11 +1245,33 @@ transition_out(old_component.$$.fragment, 1, 0, () => { | ||
if (switch_value) { | ||
switch_instance = new switch_value(switch_props()); | ||
create_component(switch_instance.$$.fragment); | ||
transition_in(switch_instance.$$.fragment, 1); | ||
mount_component(switch_instance, div, null); | ||
switch_instance0 = new switch_value(switch_props()); | ||
create_component(switch_instance0.$$.fragment); | ||
transition_in(switch_instance0.$$.fragment, 1); | ||
mount_component(switch_instance0, div, t1); | ||
} else { | ||
switch_instance = null; | ||
switch_instance0 = null; | ||
} | ||
} | ||
if (switch_value_1 !== (switch_value_1 = /*$_interactionComponent*/ ctx[3])) { | ||
if (switch_instance1) { | ||
group_outros(); | ||
const old_component = switch_instance1; | ||
transition_out(old_component.$$.fragment, 1, 0, () => { | ||
destroy_component(old_component, 1); | ||
}); | ||
check_outros(); | ||
} | ||
if (switch_value_1) { | ||
switch_instance1 = new switch_value_1(switch_props_1()); | ||
create_component(switch_instance1.$$.fragment); | ||
transition_in(switch_instance1.$$.fragment, 1); | ||
mount_component(switch_instance1, div, null); | ||
} else { | ||
switch_instance1 = null; | ||
} | ||
} | ||
if (!current || dirty & /*$theme*/ 1 && div_class_value !== (div_class_value = /*$theme*/ ctx[0].calendar)) { | ||
@@ -1243,3 +1288,4 @@ attr(div, "class", div_class_value); | ||
transition_in(toolbar.$$.fragment, local); | ||
if (switch_instance) transition_in(switch_instance.$$.fragment, local); | ||
if (switch_instance0) transition_in(switch_instance0.$$.fragment, local); | ||
if (switch_instance1) transition_in(switch_instance1.$$.fragment, local); | ||
current = true; | ||
@@ -1249,3 +1295,4 @@ }, | ||
transition_out(toolbar.$$.fragment, local); | ||
if (switch_instance) transition_out(switch_instance.$$.fragment, local); | ||
if (switch_instance0) transition_out(switch_instance0.$$.fragment, local); | ||
if (switch_instance1) transition_out(switch_instance1.$$.fragment, local); | ||
current = false; | ||
@@ -1256,3 +1303,4 @@ }, | ||
destroy_component(toolbar); | ||
if (switch_instance) destroy_component(switch_instance); | ||
if (switch_instance0) destroy_component(switch_instance0); | ||
if (switch_instance1) destroy_component(switch_instance1); | ||
} | ||
@@ -1266,2 +1314,3 @@ }; | ||
let $_viewComponent; | ||
let $_interactionComponent; | ||
let { plugins = [] } = $$props; | ||
@@ -1271,4 +1320,5 @@ let { options = {} } = $$props; | ||
setContext("state", state); | ||
let { _viewComponent, height, theme } = state; | ||
let { _viewComponent, _interactionComponent, height, theme } = state; | ||
component_subscribe($$self, _viewComponent, value => $$invalidate(2, $_viewComponent = value)); | ||
component_subscribe($$self, _interactionComponent, value => $$invalidate(3, $_interactionComponent = value)); | ||
component_subscribe($$self, height, value => $$invalidate(1, $height = value)); | ||
@@ -1279,4 +1329,4 @@ component_subscribe($$self, theme, value => $$invalidate(0, $theme = value)); | ||
if (state.hasOwnProperty(name)) { | ||
if (state[name].mutate) { | ||
value = state[name].mutate(value); | ||
if (state[name].parse) { | ||
value = state[name].parse(value); | ||
} | ||
@@ -1312,3 +1362,3 @@ | ||
function addEvent(event) { | ||
state._events.update(events => events.concat(state.events.mutate([event]))); | ||
state._events.update(events => events.concat(state.events.parse([event]))); | ||
return this; | ||
@@ -1321,3 +1371,3 @@ } | ||
if (e.id == event.id) { | ||
assign(e, state.events.mutate([event])[0]); | ||
assign(e, state.events.parse([event])[0]); | ||
break; | ||
@@ -1343,8 +1393,8 @@ } | ||
$$self.$$set = $$props => { | ||
if ("plugins" in $$props) $$invalidate(6, plugins = $$props.plugins); | ||
if ("options" in $$props) $$invalidate(7, options = $$props.options); | ||
if ("plugins" in $$props) $$invalidate(8, plugins = $$props.plugins); | ||
if ("options" in $$props) $$invalidate(9, options = $$props.options); | ||
}; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*options*/ 128) { | ||
if ($$self.$$.dirty & /*options*/ 512) { | ||
// Reactively update options that did change | ||
@@ -1361,3 +1411,5 @@ for (let [name, value] of diff(options)) { | ||
$_viewComponent, | ||
$_interactionComponent, | ||
_viewComponent, | ||
_interactionComponent, | ||
height, | ||
@@ -1383,12 +1435,12 @@ theme, | ||
init(this, options, instance, create_fragment, safe_not_equal, { | ||
plugins: 6, | ||
options: 7, | ||
setOption: 8, | ||
getOption: 9, | ||
refetchEvents: 10, | ||
getEventById: 11, | ||
addEvent: 12, | ||
updateEvent: 13, | ||
removeEvent: 14, | ||
getView: 15 | ||
plugins: 8, | ||
options: 9, | ||
setOption: 10, | ||
getOption: 11, | ||
refetchEvents: 12, | ||
getEventById: 13, | ||
addEvent: 14, | ||
updateEvent: 15, | ||
removeEvent: 16, | ||
getView: 17 | ||
}); | ||
@@ -1398,31 +1450,31 @@ } | ||
get setOption() { | ||
return this.$$.ctx[8]; | ||
return this.$$.ctx[10]; | ||
} | ||
get getOption() { | ||
return this.$$.ctx[9]; | ||
return this.$$.ctx[11]; | ||
} | ||
get refetchEvents() { | ||
return this.$$.ctx[10]; | ||
return this.$$.ctx[12]; | ||
} | ||
get getEventById() { | ||
return this.$$.ctx[11]; | ||
return this.$$.ctx[13]; | ||
} | ||
get addEvent() { | ||
return this.$$.ctx[12]; | ||
return this.$$.ctx[14]; | ||
} | ||
get updateEvent() { | ||
return this.$$.ctx[13]; | ||
return this.$$.ctx[15]; | ||
} | ||
get removeEvent() { | ||
return this.$$.ctx[14]; | ||
return this.$$.ctx[16]; | ||
} | ||
get getView() { | ||
return this.$$.ctx[15]; | ||
return this.$$.ctx[17]; | ||
} | ||
@@ -1429,0 +1481,0 @@ } |
{ | ||
"name": "@event-calendar/core", | ||
"version": "0.0.1", | ||
"title": "EventCalendar Core Package", | ||
"version": "0.1.0-beta.1", | ||
"title": "Event Calendar Core package", | ||
"description": "Full-sized event calendar with resource view", | ||
@@ -20,5 +20,5 @@ "keywords": ["calendar", "event", "resource", "full-sized"], | ||
"dependencies": { | ||
"@event-calendar/common": "~0.0.1", | ||
"@event-calendar/common": "~0.1.0-beta.1", | ||
"svelte": "^3.35.0" | ||
} | ||
} |
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
1276
45166
4
+ Added@event-calendar/common@0.1.2(transitive)
- Removed@event-calendar/common@0.0.1(transitive)