@event-calendar/core
Advanced tools
Comparing version 0.17.1 to 0.18.0
441
index.js
import { is_function, noop, identity, tick, SvelteComponent, init, safe_not_equal, empty, insert, destroy_each, detach, component_subscribe, set_store_value, element, text, attr, append, listen, set_data, transition_in, group_outros, check_outros, transition_out, space, create_component, mount_component, destroy_component, construct_svelte_component, set_style, get_current_component } from 'svelte/internal'; | ||
import { getContext, setContext, beforeUpdate } from 'svelte'; | ||
import { derived, writable, readable, get } from 'svelte/store'; | ||
import { assign, setMidnight, createDate, createDuration, createEvents, createEventSources, cloneDate, prevClosestDay, nextClosestDay, DAY_IN_SECONDS, addDuration, subtractDay, debounce, toLocalDate, toISOString, derived2, addDay, createView, writable2, intl, intlRange, subtractDuration, flushDebounce, toEventWithLocalDates, toViewWithLocalDates, hasFn, runFn, ignore } from '@event-calendar/common'; | ||
import { assign, setMidnight, createDate, createDuration, createEvents, createEventSources, cloneDate, prevClosestDay, nextClosestDay, DAY_IN_SECONDS, addDuration, subtractDay, derived2, addDay, createView, debounce, toISOString, toLocalDate, writable2, intl, intlRange, subtractDuration, toViewWithLocalDates, flushDebounce, toEventWithLocalDates, hasFn, runFn, ignore } from '@event-calendar/common'; | ||
@@ -160,3 +160,3 @@ function createOptions(plugins) { | ||
function activeRange(state) { | ||
let _activeRange = derived( | ||
return derived( | ||
[state._currentRange, state.firstDay, state.monthMode, state.slotMinTime, state.slotMaxTime], | ||
@@ -182,20 +182,2 @@ ([$_currentRange, $firstDay, $monthMode, $slotMinTime, $slotMaxTime]) => { | ||
); | ||
let debounceHandle = {}; | ||
derived([_activeRange, state.datesSet], values => { | ||
let [, $datesSet] = values; | ||
if ($datesSet) { | ||
debounce(() => { | ||
let [$_activeRange, $datesSet] = values; | ||
$datesSet({ | ||
start: toLocalDate($_activeRange.start), | ||
end: toLocalDate($_activeRange.end), | ||
startStr: toISOString($_activeRange.start), | ||
endStr: toISOString($_activeRange.end) | ||
}); | ||
}, debounceHandle, state._queue); | ||
} | ||
}).subscribe(noop); | ||
return _activeRange; | ||
} | ||
@@ -379,2 +361,3 @@ | ||
this._queue = writable(new Map()); // debounce queue | ||
this._auxiliary = writable([]); // auxiliary components | ||
this._currentRange = currentRange(this); | ||
@@ -397,2 +380,4 @@ this._activeRange = activeRange(this); | ||
this._viewClass = writable(undefined); | ||
// Resources | ||
this._resBgColor = writable(noop); | ||
// Interaction | ||
@@ -477,3 +462,3 @@ this._interaction = writable({}); | ||
function get_each_context$1(ctx, list, i) { | ||
function get_each_context$2(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
@@ -696,3 +681,3 @@ child_ctx[23] = list[i]; | ||
// (28:0) {#each buttons as button} | ||
function create_each_block$1(ctx) { | ||
function create_each_block$2(ctx) { | ||
let if_block_anchor; | ||
@@ -741,3 +726,3 @@ | ||
function create_fragment$2(ctx) { | ||
function create_fragment$3(ctx) { | ||
let each_1_anchor; | ||
@@ -748,3 +733,3 @@ let each_value = /*buttons*/ ctx[0]; | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); | ||
each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); | ||
} | ||
@@ -773,3 +758,3 @@ | ||
for (i = 0; i < each_value.length; i += 1) { | ||
const child_ctx = get_each_context$1(ctx, each_value, i); | ||
const child_ctx = get_each_context$2(ctx, each_value, i); | ||
@@ -779,3 +764,3 @@ if (each_blocks[i]) { | ||
} else { | ||
each_blocks[i] = create_each_block$1(child_ctx); | ||
each_blocks[i] = create_each_block$2(child_ctx); | ||
each_blocks[i].c(); | ||
@@ -802,3 +787,3 @@ each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); | ||
function instance$2($$self, $$props, $$invalidate) { | ||
function instance$3($$self, $$props, $$invalidate) { | ||
let $duration; | ||
@@ -881,3 +866,3 @@ let $date; | ||
super(); | ||
init(this, options, instance$2, create_fragment$2, safe_not_equal, { buttons: 0 }); | ||
init(this, options, instance$3, create_fragment$3, safe_not_equal, { buttons: 0 }); | ||
} | ||
@@ -888,3 +873,3 @@ } | ||
function get_each_context(ctx, list, i) { | ||
function get_each_context$1(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
@@ -1050,3 +1035,3 @@ child_ctx[5] = list[i]; | ||
// (21:4) {#each Object.keys(sections) as key} | ||
function create_each_block(ctx) { | ||
function create_each_block$1(ctx) { | ||
let div; | ||
@@ -1139,3 +1124,3 @@ let t; | ||
function create_fragment$1(ctx) { | ||
function create_fragment$2(ctx) { | ||
let div; | ||
@@ -1148,3 +1133,3 @@ let div_class_value; | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); | ||
each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); | ||
} | ||
@@ -1181,3 +1166,3 @@ | ||
for (i = 0; i < each_value.length; i += 1) { | ||
const child_ctx = get_each_context(ctx, each_value, i); | ||
const child_ctx = get_each_context$1(ctx, each_value, i); | ||
@@ -1188,3 +1173,3 @@ if (each_blocks[i]) { | ||
} else { | ||
each_blocks[i] = create_each_block(child_ctx); | ||
each_blocks[i] = create_each_block$1(child_ctx); | ||
each_blocks[i].c(); | ||
@@ -1234,3 +1219,3 @@ transition_in(each_blocks[i], 1); | ||
function instance$1($$self, $$props, $$invalidate) { | ||
function instance$2($$self, $$props, $$invalidate) { | ||
let $headerToolbar; | ||
@@ -1259,2 +1244,202 @@ let $theme; | ||
super(); | ||
init(this, options, instance$2, create_fragment$2, safe_not_equal, {}); | ||
} | ||
} | ||
/* packages/core/src/Auxiliary.svelte generated by Svelte v3.55.1 */ | ||
function get_each_context(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
child_ctx[11] = list[i]; | ||
return child_ctx; | ||
} | ||
// (25:0) {#each $_auxiliary as component} | ||
function create_each_block(ctx) { | ||
let switch_instance; | ||
let switch_instance_anchor; | ||
let current; | ||
var switch_value = /*component*/ ctx[11]; | ||
function switch_props(ctx) { | ||
return {}; | ||
} | ||
if (switch_value) { | ||
switch_instance = construct_svelte_component(switch_value, switch_props()); | ||
} | ||
return { | ||
c() { | ||
if (switch_instance) create_component(switch_instance.$$.fragment); | ||
switch_instance_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
if (switch_instance) mount_component(switch_instance, target, anchor); | ||
insert(target, switch_instance_anchor, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
if (switch_value !== (switch_value = /*component*/ ctx[11])) { | ||
if (switch_instance) { | ||
group_outros(); | ||
const old_component = switch_instance; | ||
transition_out(old_component.$$.fragment, 1, 0, () => { | ||
destroy_component(old_component, 1); | ||
}); | ||
check_outros(); | ||
} | ||
if (switch_value) { | ||
switch_instance = construct_svelte_component(switch_value, switch_props()); | ||
create_component(switch_instance.$$.fragment); | ||
transition_in(switch_instance.$$.fragment, 1); | ||
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor); | ||
} else { | ||
switch_instance = null; | ||
} | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
if (switch_instance) transition_in(switch_instance.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
if (switch_instance) transition_out(switch_instance.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(switch_instance_anchor); | ||
if (switch_instance) destroy_component(switch_instance, detaching); | ||
} | ||
}; | ||
} | ||
function create_fragment$1(ctx) { | ||
let each_1_anchor; | ||
let current; | ||
let each_value = /*$_auxiliary*/ ctx[0]; | ||
let each_blocks = []; | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); | ||
} | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
}); | ||
return { | ||
c() { | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].c(); | ||
} | ||
each_1_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].m(target, anchor); | ||
} | ||
insert(target, each_1_anchor, anchor); | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
if (dirty & /*$_auxiliary*/ 1) { | ||
each_value = /*$_auxiliary*/ ctx[0]; | ||
let i; | ||
for (i = 0; i < each_value.length; i += 1) { | ||
const child_ctx = get_each_context(ctx, each_value, i); | ||
if (each_blocks[i]) { | ||
each_blocks[i].p(child_ctx, dirty); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block(child_ctx); | ||
each_blocks[i].c(); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); | ||
} | ||
} | ||
group_outros(); | ||
for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
out(i); | ||
} | ||
check_outros(); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
transition_in(each_blocks[i]); | ||
} | ||
current = true; | ||
}, | ||
o(local) { | ||
each_blocks = each_blocks.filter(Boolean); | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
transition_out(each_blocks[i]); | ||
} | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_each(each_blocks, detaching); | ||
if (detaching) detach(each_1_anchor); | ||
} | ||
}; | ||
} | ||
function instance$1($$self, $$props, $$invalidate) { | ||
let $_view; | ||
let $datesSet; | ||
let $_activeRange; | ||
let $_auxiliary; | ||
let { datesSet, _auxiliary, _activeRange, _queue, _view } = getContext('state'); | ||
component_subscribe($$self, datesSet, value => $$invalidate(7, $datesSet = value)); | ||
component_subscribe($$self, _auxiliary, value => $$invalidate(0, $_auxiliary = value)); | ||
component_subscribe($$self, _activeRange, value => $$invalidate(5, $_activeRange = value)); | ||
component_subscribe($$self, _view, value => $$invalidate(6, $_view = value)); | ||
let debounceHandle = {}; | ||
function runDatesSet(_activeRange) { | ||
if (is_function($datesSet)) { | ||
debounce( | ||
() => $datesSet({ | ||
start: toLocalDate(_activeRange.start), | ||
end: toLocalDate(_activeRange.end), | ||
startStr: toISOString(_activeRange.start), | ||
endStr: toISOString(_activeRange.end), | ||
view: toViewWithLocalDates($_view) | ||
}), | ||
debounceHandle, | ||
_queue | ||
); | ||
} | ||
} | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*$_activeRange*/ 32) { | ||
// Set up datesSet callback | ||
runDatesSet($_activeRange); | ||
} | ||
}; | ||
return [$_auxiliary, datesSet, _auxiliary, _activeRange, _view, $_activeRange]; | ||
} | ||
class Auxiliary extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$1, create_fragment$1, safe_not_equal, {}); | ||
@@ -1270,6 +1455,6 @@ } | ||
let t0; | ||
let switch_instance0; | ||
let switch_instance; | ||
let div_class_value; | ||
let t1; | ||
let switch_instance1; | ||
let div_class_value; | ||
let auxiliary; | ||
let current; | ||
@@ -1279,3 +1464,3 @@ let mounted; | ||
toolbar = new Toolbar({}); | ||
var switch_value = /*$_viewComponent*/ ctx[5]; | ||
var switch_value = /*$_viewComponent*/ ctx[4]; | ||
@@ -1287,15 +1472,7 @@ function switch_props(ctx) { | ||
if (switch_value) { | ||
switch_instance0 = construct_svelte_component(switch_value, switch_props()); | ||
switch_instance = construct_svelte_component(switch_value, switch_props()); | ||
} | ||
var switch_value_1 = /*$_interaction*/ ctx[0].component; | ||
auxiliary = new Auxiliary({}); | ||
function switch_props_1(ctx) { | ||
return {}; | ||
} | ||
if (switch_value_1) { | ||
switch_instance1 = construct_svelte_component(switch_value_1, switch_props_1()); | ||
} | ||
return { | ||
@@ -1306,13 +1483,13 @@ c() { | ||
t0 = space(); | ||
if (switch_instance0) create_component(switch_instance0.$$.fragment); | ||
if (switch_instance) create_component(switch_instance.$$.fragment); | ||
t1 = space(); | ||
if (switch_instance1) create_component(switch_instance1.$$.fragment); | ||
create_component(auxiliary.$$.fragment); | ||
attr(div, "class", div_class_value = "" + (/*$theme*/ ctx[1].calendar + (/*$_viewClass*/ ctx[2] | ||
? ' ' + /*$theme*/ ctx[1][/*$_viewClass*/ ctx[2]] | ||
: '') + (/*$_iClass*/ ctx[3] | ||
? ' ' + /*$theme*/ ctx[1][/*$_iClass*/ ctx[3]] | ||
attr(div, "class", div_class_value = "" + (/*$theme*/ ctx[0].calendar + (/*$_viewClass*/ ctx[1] | ||
? ' ' + /*$theme*/ ctx[0][/*$_viewClass*/ ctx[1]] | ||
: '') + (/*$_iClass*/ ctx[2] | ||
? ' ' + /*$theme*/ ctx[0][/*$_iClass*/ ctx[2]] | ||
: ''))); | ||
set_style(div, "height", /*$height*/ ctx[4]); | ||
set_style(div, "height", /*$height*/ ctx[3]); | ||
}, | ||
@@ -1323,9 +1500,9 @@ m(target, anchor) { | ||
append(div, t0); | ||
if (switch_instance0) mount_component(switch_instance0, div, null); | ||
append(div, t1); | ||
if (switch_instance1) mount_component(switch_instance1, div, null); | ||
if (switch_instance) mount_component(switch_instance, div, null); | ||
insert(target, t1, anchor); | ||
mount_component(auxiliary, target, anchor); | ||
current = true; | ||
if (!mounted) { | ||
dispose = listen(window, "click", /*handleClick*/ ctx[17], true); | ||
dispose = listen(window, "click", /*handleClick*/ ctx[16], true); | ||
mounted = true; | ||
@@ -1335,6 +1512,6 @@ } | ||
p(ctx, dirty) { | ||
if (switch_value !== (switch_value = /*$_viewComponent*/ ctx[5])) { | ||
if (switch_instance0) { | ||
if (switch_value !== (switch_value = /*$_viewComponent*/ ctx[4])) { | ||
if (switch_instance) { | ||
group_outros(); | ||
const old_component = switch_instance0; | ||
const old_component = switch_instance; | ||
@@ -1349,37 +1526,15 @@ transition_out(old_component.$$.fragment, 1, 0, () => { | ||
if (switch_value) { | ||
switch_instance0 = construct_svelte_component(switch_value, switch_props()); | ||
create_component(switch_instance0.$$.fragment); | ||
transition_in(switch_instance0.$$.fragment, 1); | ||
mount_component(switch_instance0, div, t1); | ||
switch_instance = construct_svelte_component(switch_value, switch_props()); | ||
create_component(switch_instance.$$.fragment); | ||
transition_in(switch_instance.$$.fragment, 1); | ||
mount_component(switch_instance, div, null); | ||
} else { | ||
switch_instance0 = null; | ||
switch_instance = null; | ||
} | ||
} | ||
if (switch_value_1 !== (switch_value_1 = /*$_interaction*/ ctx[0].component)) { | ||
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 = construct_svelte_component(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[0] & /*$theme, $_viewClass, $_iClass*/ 14 && div_class_value !== (div_class_value = "" + (/*$theme*/ ctx[1].calendar + (/*$_viewClass*/ ctx[2] | ||
? ' ' + /*$theme*/ ctx[1][/*$_viewClass*/ ctx[2]] | ||
: '') + (/*$_iClass*/ ctx[3] | ||
? ' ' + /*$theme*/ ctx[1][/*$_iClass*/ ctx[3]] | ||
if (!current || dirty[0] & /*$theme, $_viewClass, $_iClass*/ 7 && div_class_value !== (div_class_value = "" + (/*$theme*/ ctx[0].calendar + (/*$_viewClass*/ ctx[1] | ||
? ' ' + /*$theme*/ ctx[0][/*$_viewClass*/ ctx[1]] | ||
: '') + (/*$_iClass*/ ctx[2] | ||
? ' ' + /*$theme*/ ctx[0][/*$_iClass*/ ctx[2]] | ||
: '')))) { | ||
@@ -1389,4 +1544,4 @@ attr(div, "class", div_class_value); | ||
if (!current || dirty[0] & /*$height*/ 16) { | ||
set_style(div, "height", /*$height*/ ctx[4]); | ||
if (!current || dirty[0] & /*$height*/ 8) { | ||
set_style(div, "height", /*$height*/ ctx[3]); | ||
} | ||
@@ -1397,4 +1552,4 @@ }, | ||
transition_in(toolbar.$$.fragment, local); | ||
if (switch_instance0) transition_in(switch_instance0.$$.fragment, local); | ||
if (switch_instance1) transition_in(switch_instance1.$$.fragment, local); | ||
if (switch_instance) transition_in(switch_instance.$$.fragment, local); | ||
transition_in(auxiliary.$$.fragment, local); | ||
current = true; | ||
@@ -1404,4 +1559,4 @@ }, | ||
transition_out(toolbar.$$.fragment, local); | ||
if (switch_instance0) transition_out(switch_instance0.$$.fragment, local); | ||
if (switch_instance1) transition_out(switch_instance1.$$.fragment, local); | ||
if (switch_instance) transition_out(switch_instance.$$.fragment, local); | ||
transition_out(auxiliary.$$.fragment, local); | ||
current = false; | ||
@@ -1412,4 +1567,5 @@ }, | ||
destroy_component(toolbar); | ||
if (switch_instance0) destroy_component(switch_instance0); | ||
if (switch_instance1) destroy_component(switch_instance1); | ||
if (switch_instance) destroy_component(switch_instance); | ||
if (detaching) detach(t1); | ||
destroy_component(auxiliary, detaching); | ||
mounted = false; | ||
@@ -1439,13 +1595,13 @@ dispose(); | ||
let { _viewComponent, _viewClass, _ignoreClick, _interaction, _iClass, _events, _queue, events, eventSources, height, theme } = state; | ||
component_subscribe($$self, _viewComponent, value => $$invalidate(5, $_viewComponent = value)); | ||
component_subscribe($$self, _viewClass, value => $$invalidate(2, $_viewClass = value)); | ||
component_subscribe($$self, _ignoreClick, value => $$invalidate(33, $_ignoreClick = value)); | ||
component_subscribe($$self, _interaction, value => $$invalidate(0, $_interaction = value)); | ||
component_subscribe($$self, _iClass, value => $$invalidate(3, $_iClass = value)); | ||
component_subscribe($$self, _events, value => $$invalidate(35, $_events = value)); | ||
component_subscribe($$self, _queue, value => $$invalidate(32, $_queue = value)); | ||
component_subscribe($$self, events, value => $$invalidate(34, $events = value)); | ||
component_subscribe($$self, eventSources, value => $$invalidate(36, $eventSources = value)); | ||
component_subscribe($$self, height, value => $$invalidate(4, $height = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(1, $theme = value)); | ||
component_subscribe($$self, _viewComponent, value => $$invalidate(4, $_viewComponent = value)); | ||
component_subscribe($$self, _viewClass, value => $$invalidate(1, $_viewClass = value)); | ||
component_subscribe($$self, _ignoreClick, value => $$invalidate(32, $_ignoreClick = value)); | ||
component_subscribe($$self, _interaction, value => $$invalidate(36, $_interaction = value)); | ||
component_subscribe($$self, _iClass, value => $$invalidate(2, $_iClass = value)); | ||
component_subscribe($$self, _events, value => $$invalidate(34, $_events = value)); | ||
component_subscribe($$self, _queue, value => $$invalidate(31, $_queue = value)); | ||
component_subscribe($$self, events, value => $$invalidate(33, $events = value)); | ||
component_subscribe($$self, eventSources, value => $$invalidate(35, $eventSources = value)); | ||
component_subscribe($$self, height, value => $$invalidate(3, $height = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(0, $theme = value)); | ||
@@ -1563,8 +1719,8 @@ function setOption(name, value) { | ||
$$self.$$set = $$props => { | ||
if ('plugins' in $$props) $$invalidate(18, plugins = $$props.plugins); | ||
if ('options' in $$props) $$invalidate(19, options = $$props.options); | ||
if ('plugins' in $$props) $$invalidate(17, plugins = $$props.plugins); | ||
if ('options' in $$props) $$invalidate(18, options = $$props.options); | ||
}; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty[0] & /*options*/ 524288) { | ||
if ($$self.$$.dirty[0] & /*options*/ 262144) { | ||
// Reactively update options that did change | ||
@@ -1578,3 +1734,2 @@ for (let [name, value] of diff(options)) { | ||
return [ | ||
$_interaction, | ||
$theme, | ||
@@ -1625,16 +1780,16 @@ $_viewClass, | ||
{ | ||
plugins: 18, | ||
options: 19, | ||
setOption: 20, | ||
getOption: 21, | ||
refetchEvents: 22, | ||
getEvents: 23, | ||
getEventById: 24, | ||
addEvent: 25, | ||
updateEvent: 26, | ||
removeEventById: 27, | ||
getView: 28, | ||
unselect: 29, | ||
dateFromPoint: 30, | ||
destroy: 31 | ||
plugins: 17, | ||
options: 18, | ||
setOption: 19, | ||
getOption: 20, | ||
refetchEvents: 21, | ||
getEvents: 22, | ||
getEventById: 23, | ||
addEvent: 24, | ||
updateEvent: 25, | ||
removeEventById: 26, | ||
getView: 27, | ||
unselect: 28, | ||
dateFromPoint: 29, | ||
destroy: 30 | ||
}, | ||
@@ -1647,47 +1802,47 @@ null, | ||
get setOption() { | ||
return this.$$.ctx[20]; | ||
return this.$$.ctx[19]; | ||
} | ||
get getOption() { | ||
return this.$$.ctx[21]; | ||
return this.$$.ctx[20]; | ||
} | ||
get refetchEvents() { | ||
return this.$$.ctx[22]; | ||
return this.$$.ctx[21]; | ||
} | ||
get getEvents() { | ||
return this.$$.ctx[23]; | ||
return this.$$.ctx[22]; | ||
} | ||
get getEventById() { | ||
return this.$$.ctx[24]; | ||
return this.$$.ctx[23]; | ||
} | ||
get addEvent() { | ||
return this.$$.ctx[25]; | ||
return this.$$.ctx[24]; | ||
} | ||
get updateEvent() { | ||
return this.$$.ctx[26]; | ||
return this.$$.ctx[25]; | ||
} | ||
get removeEventById() { | ||
return this.$$.ctx[27]; | ||
return this.$$.ctx[26]; | ||
} | ||
get getView() { | ||
return this.$$.ctx[28]; | ||
return this.$$.ctx[27]; | ||
} | ||
get unselect() { | ||
return this.$$.ctx[29]; | ||
return this.$$.ctx[28]; | ||
} | ||
get dateFromPoint() { | ||
return this.$$.ctx[30]; | ||
return this.$$.ctx[29]; | ||
} | ||
get destroy() { | ||
return this.$$.ctx[31]; | ||
return this.$$.ctx[30]; | ||
} | ||
@@ -1694,0 +1849,0 @@ } |
{ | ||
"name": "@event-calendar/core", | ||
"version": "0.17.1", | ||
"version": "0.18.0", | ||
"title": "Event Calendar Core package", | ||
@@ -40,5 +40,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/common": "~0.17.1", | ||
"@event-calendar/common": "~0.18.0", | ||
"svelte": "^3.55.1" | ||
} | ||
} |
@@ -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) [![npm](https://img.shields.io/npm/dm/@event-calendar/core?color=red&label=npm&style=flat-square)](https://www.npmjs.com/package/@event-calendar/core) | ||
* Lightweight (37kb [br](https://en.wikipedia.org/wiki/Brotli) compressed) | ||
* Lightweight (38kb [br](https://en.wikipedia.org/wiki/Brotli) compressed) | ||
* Zero-dependency (pre-built bundle) | ||
@@ -196,4 +196,4 @@ * Used on over 60,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/) | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.17.1/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.17.1/event-calendar.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.18.0/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.18.0/event-calendar.min.js"></script> | ||
``` | ||
@@ -2205,3 +2205,3 @@ | ||
`boolean` Determines if the event is shown in the all-day slot. Default `false` | ||
`boolean` Determines if the event is shown in the all-day slot. Defaults to `true` if `start` and `end` are both passed without a time part, `false` otherwise | ||
</td> | ||
@@ -2387,2 +2387,9 @@ </tr> | ||
</tr> | ||
<tr> | ||
<td> | ||
`eventBackgroundColor` | ||
</td> | ||
<td>Default background color for this resource's events</td> | ||
</tr> | ||
</table> | ||
@@ -2425,2 +2432,12 @@ | ||
</tr> | ||
<tr> | ||
<td> | ||
`eventBackgroundColor` | ||
</td> | ||
<td> | ||
`string` Sets the default background color for this resource's events just like the calendar-wide [eventBackgroundColor](#eventbackgroundcolor) option. Default `undefined` | ||
</td> | ||
</tr> | ||
</table> | ||
@@ -2427,0 +2444,0 @@ |
@@ -32,2 +32,3 @@ import {writable} from 'svelte/store'; | ||
this._queue = writable(new Map()); // debounce queue | ||
this._auxiliary = writable([]); // auxiliary components | ||
this._currentRange = currentRange(this); | ||
@@ -50,2 +51,4 @@ this._activeRange = activeRange(this); | ||
this._viewClass = writable(undefined); | ||
// Resources | ||
this._resBgColor = writable(noop); | ||
// Interaction | ||
@@ -126,2 +129,2 @@ this._interaction = writable({}); | ||
} | ||
} | ||
} |
import {derived, writable, readable} from 'svelte/store'; | ||
import {is_function, noop} from 'svelte/internal'; | ||
import {is_function} from 'svelte/internal'; | ||
import { | ||
@@ -23,3 +23,3 @@ DAY_IN_SECONDS, | ||
export function activeRange(state) { | ||
let _activeRange = derived( | ||
return derived( | ||
[state._currentRange, state.firstDay, state.monthMode, state.slotMinTime, state.slotMaxTime], | ||
@@ -45,20 +45,2 @@ ([$_currentRange, $firstDay, $monthMode, $slotMinTime, $slotMaxTime]) => { | ||
); | ||
let debounceHandle = {}; | ||
derived([_activeRange, state.datesSet], values => { | ||
let [, $datesSet] = values; | ||
if ($datesSet) { | ||
debounce(() => { | ||
let [$_activeRange, $datesSet] = values; | ||
$datesSet({ | ||
start: toLocalDate($_activeRange.start), | ||
end: toLocalDate($_activeRange.end), | ||
startStr: toISOString($_activeRange.start), | ||
endStr: toISOString($_activeRange.end) | ||
}); | ||
}, debounceHandle, state._queue); | ||
} | ||
}).subscribe(noop); | ||
return _activeRange; | ||
} | ||
@@ -65,0 +47,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
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
149306
13
2531
2493
+ Added@event-calendar/common@0.18.1(transitive)
- Removed@event-calendar/common@0.17.1(transitive)