@event-calendar/day-grid
Advanced tools
Comparing version 0.14.2 to 0.14.3
176
index.js
@@ -1,3 +0,3 @@ | ||
import { SvelteComponent, init, safe_not_equal, element, space, attr, insert, append, noop, detach, destroy_each, component_subscribe, text, set_data, create_slot, listen, is_function, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, run_all, set_store_value, binding_callbacks, construct_svelte_component, create_component, mount_component, action_destroyer, group_outros, destroy_component, check_outros, stop_propagation, bubble, update_keyed_each, outro_and_destroy_block, empty } from 'svelte/internal'; | ||
import { getContext, tick, createEventDispatcher, onMount, afterUpdate, setContext } from 'svelte'; | ||
import { SvelteComponent, init, safe_not_equal, element, space, attr, insert, append, noop, detach, destroy_each, component_subscribe, text, set_data, create_slot, listen, is_function, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, run_all, set_store_value, binding_callbacks, construct_svelte_component, create_component, mount_component, action_destroyer, group_outros, destroy_component, check_outros, stop_propagation, update_keyed_each, outro_and_destroy_block, empty, bubble } from 'svelte/internal'; | ||
import { getContext, tick, onMount, afterUpdate, setContext } from 'svelte'; | ||
import { derived, writable } from 'svelte/store'; | ||
@@ -519,3 +519,2 @@ import { cloneDate, subtractDay, addDay, hasYScroll, setContent, maybeIgnore, toEventWithLocalDates, toViewWithLocalDates, createEventContent, height, ancestor, outsideEvent, rect, datesEqual, setMidnight, createDate, toLocalDate, toISOString, assign, createEventChunk, prepareEventChunks, intl } from '@event-calendar/common'; | ||
component_subscribe($$self, _hiddenEvents, value => $$invalidate(36, $_hiddenEvents = value)); | ||
createEventDispatcher(); | ||
let el; | ||
@@ -564,6 +563,7 @@ let event; | ||
$$invalidate(31, chunk.ready = false, chunk); | ||
$$invalidate(31, chunk.top = 0, chunk); | ||
if (chunk.prev) { | ||
if (chunk.prev.bottom === undefined) { | ||
if (!chunk.prev.ready) { | ||
// 'prev' is not ready yet, try again later | ||
@@ -584,3 +584,3 @@ tick().then(reposition); | ||
for (let longChunk of longChunks[key]) { | ||
if (longChunk.bottom === undefined) { | ||
if (!longChunk.ready) { | ||
// 'longChunk' is not ready yet, try again later | ||
@@ -608,2 +608,4 @@ tick().then(reposition); | ||
} | ||
$$invalidate(31, chunk.ready = true, chunk); | ||
} | ||
@@ -776,4 +778,5 @@ | ||
// (56:8) {#each $_popupChunks as chunk} | ||
function create_each_block$3(ctx) { | ||
// (61:8) {#each $_popupChunks as chunk (chunk.event)} | ||
function create_each_block$3(key_1, ctx) { | ||
let first; | ||
let event; | ||
@@ -787,10 +790,16 @@ let current; | ||
return { | ||
key: key_1, | ||
first: null, | ||
c() { | ||
first = empty(); | ||
create_component(event.$$.fragment); | ||
this.first = first; | ||
}, | ||
m(target, anchor) { | ||
insert(target, first, anchor); | ||
mount_component(event, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
p(new_ctx, dirty) { | ||
ctx = new_ctx; | ||
const event_changes = {}; | ||
@@ -810,2 +819,3 @@ if (dirty & /*$_popupChunks*/ 32) event_changes.chunk = /*chunk*/ ctx[16]; | ||
d(detaching) { | ||
if (detaching) detach(first); | ||
destroy_component(event, detaching); | ||
@@ -826,2 +836,4 @@ } | ||
let div1; | ||
let each_blocks = []; | ||
let each_1_lookup = new Map(); | ||
let div1_class_value; | ||
@@ -833,12 +845,10 @@ let div2_class_value; | ||
let each_value = /*$_popupChunks*/ ctx[5]; | ||
let each_blocks = []; | ||
const get_key = ctx => /*chunk*/ ctx[16].event; | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); | ||
let child_ctx = get_each_context$3(ctx, each_value, i); | ||
let key = get_key(child_ctx); | ||
each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx)); | ||
} | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
}); | ||
return { | ||
@@ -900,24 +910,4 @@ c() { | ||
each_value = /*$_popupChunks*/ ctx[5]; | ||
let i; | ||
for (i = 0; i < each_value.length; i += 1) { | ||
const child_ctx = get_each_context$3(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$3(child_ctx); | ||
each_blocks[i].c(); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(div1, null); | ||
} | ||
} | ||
group_outros(); | ||
for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
out(i); | ||
} | ||
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div1, outro_and_destroy_block, create_each_block$3, null, get_each_context$3); | ||
check_outros(); | ||
@@ -948,4 +938,2 @@ } | ||
o(local) { | ||
each_blocks = each_blocks.filter(Boolean); | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
@@ -959,3 +947,7 @@ transition_out(each_blocks[i]); | ||
if (detaching) detach(div2); | ||
destroy_each(each_blocks, detaching); | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].d(); | ||
} | ||
/*div2_binding*/ ctx[14](null); | ||
@@ -1008,2 +1000,7 @@ mounted = false; | ||
$$invalidate(1, style += `top:${top}px;`); | ||
if (popupRect.top + top + popupRect.height > bodyRect.bottom) { | ||
let bottom = popupRect.top + dayEl.offsetHeight - bodyRect.bottom; | ||
$$invalidate(1, style += `bottom:${bottom}px;`); | ||
} | ||
}); | ||
@@ -1065,3 +1062,3 @@ | ||
// (138:4) {#if iChunks[1] && datesEqual(iChunks[1].date, date)} | ||
// (124:4) {#if iChunks[1] && datesEqual(iChunks[1].date, date)} | ||
function create_if_block_3(ctx) { | ||
@@ -1110,3 +1107,3 @@ let div; | ||
// (144:4) {#if iChunks[0] && datesEqual(iChunks[0].date, date)} | ||
// (130:4) {#if iChunks[0] && datesEqual(iChunks[0].date, date)} | ||
function create_if_block_2(ctx) { | ||
@@ -1155,3 +1152,3 @@ let div; | ||
// (150:8) {#each dayChunks as chunk (chunk.event)} | ||
// (136:8) {#each dayChunks as chunk (chunk.event)} | ||
function create_each_block$2(key_1, ctx) { | ||
@@ -1205,3 +1202,3 @@ let first; | ||
// (154:4) {#if $_popupDate && datesEqual(date, $_popupDate)} | ||
// (140:4) {#if showPopup} | ||
function create_if_block_1(ctx) { | ||
@@ -1235,3 +1232,3 @@ let popup; | ||
// (158:8) {#if hiddenEvents.size} | ||
// (144:8) {#if hiddenEvents.size} | ||
function create_if_block(ctx) { | ||
@@ -1253,3 +1250,3 @@ let a; | ||
listen(a, "click", stop_propagation(/*showMore*/ ctx[28])), | ||
listen(a, "pointerdown", stop_propagation(/*pointerdown_handler*/ ctx[35])), | ||
listen(a, "pointerdown", stop_propagation(/*pointerdown_handler*/ ctx[36])), | ||
action_destroyer(setContent_action = setContent.call(null, a, /*moreLink*/ ctx[5])) | ||
@@ -1279,5 +1276,5 @@ ]; | ||
let t1; | ||
let show_if_2 = /*iChunks*/ ctx[2][1] && datesEqual(/*iChunks*/ ctx[2][1].date, /*date*/ ctx[0]); | ||
let show_if_1 = /*iChunks*/ ctx[2][1] && datesEqual(/*iChunks*/ ctx[2][1].date, /*date*/ ctx[0]); | ||
let t2; | ||
let show_if_1 = /*iChunks*/ ctx[2][0] && datesEqual(/*iChunks*/ ctx[2][0].date, /*date*/ ctx[0]); | ||
let show_if = /*iChunks*/ ctx[2][0] && datesEqual(/*iChunks*/ ctx[2][0].date, /*date*/ ctx[0]); | ||
let t3; | ||
@@ -1289,3 +1286,2 @@ let div1; | ||
let t4; | ||
let show_if = /*$_popupDate*/ ctx[6] && datesEqual(/*date*/ ctx[0], /*$_popupDate*/ ctx[6]); | ||
let t5; | ||
@@ -1298,4 +1294,4 @@ let div2; | ||
let dispose; | ||
let if_block0 = show_if_2 && create_if_block_3(ctx); | ||
let if_block1 = show_if_1 && create_if_block_2(ctx); | ||
let if_block0 = show_if_1 && create_if_block_3(ctx); | ||
let if_block1 = show_if && create_if_block_2(ctx); | ||
let each_value = /*dayChunks*/ ctx[3]; | ||
@@ -1310,3 +1306,3 @@ const get_key = ctx => /*chunk*/ ctx[43].event; | ||
let if_block2 = show_if && create_if_block_1(); | ||
let if_block2 = /*showPopup*/ ctx[6] && create_if_block_1(); | ||
let if_block3 = /*hiddenEvents*/ ctx[4].size && create_if_block(ctx); | ||
@@ -1365,3 +1361,3 @@ | ||
if (if_block3) if_block3.m(div2, null); | ||
/*div3_binding*/ ctx[36](div3); | ||
/*div3_binding*/ ctx[37](div3); | ||
current = true; | ||
@@ -1396,5 +1392,5 @@ | ||
if (dirty[0] & /*iChunks, date*/ 5) show_if_2 = /*iChunks*/ ctx[2][1] && datesEqual(/*iChunks*/ ctx[2][1].date, /*date*/ ctx[0]); | ||
if (dirty[0] & /*iChunks, date*/ 5) show_if_1 = /*iChunks*/ ctx[2][1] && datesEqual(/*iChunks*/ ctx[2][1].date, /*date*/ ctx[0]); | ||
if (show_if_2) { | ||
if (show_if_1) { | ||
if (if_block0) { | ||
@@ -1422,5 +1418,5 @@ if_block0.p(ctx, dirty); | ||
if (dirty[0] & /*iChunks, date*/ 5) show_if_1 = /*iChunks*/ ctx[2][0] && datesEqual(/*iChunks*/ ctx[2][0].date, /*date*/ ctx[0]); | ||
if (dirty[0] & /*iChunks, date*/ 5) show_if = /*iChunks*/ ctx[2][0] && datesEqual(/*iChunks*/ ctx[2][0].date, /*date*/ ctx[0]); | ||
if (show_if_1) { | ||
if (show_if) { | ||
if (if_block1) { | ||
@@ -1459,7 +1455,5 @@ if_block1.p(ctx, dirty); | ||
if (dirty[0] & /*$_popupDate, date*/ 65) show_if = /*$_popupDate*/ ctx[6] && datesEqual(/*date*/ ctx[0], /*$_popupDate*/ ctx[6]); | ||
if (show_if) { | ||
if (/*showPopup*/ ctx[6]) { | ||
if (if_block2) { | ||
if (dirty[0] & /*$_popupDate, date*/ 65) { | ||
if (dirty[0] & /*showPopup*/ 64) { | ||
transition_in(if_block2, 1); | ||
@@ -1542,3 +1536,3 @@ } | ||
if (if_block3) if_block3.d(); | ||
/*div3_binding*/ ctx[36](null); | ||
/*div3_binding*/ ctx[37](null); | ||
mounted = false; | ||
@@ -1556,6 +1550,2 @@ run_all(dispose); | ||
function sortChunks(chunks) { | ||
chunks.sort((a, b) => a.top - b.top); | ||
} | ||
function instance$2($$self, $$props, $$invalidate) { | ||
@@ -1578,14 +1568,14 @@ let $_popupChunks; | ||
let { date: currentDate, dateClick, dayMaxEvents, highlightedDates, moreLinkContent, theme, _view, _interaction, selectable } = getContext('state'); | ||
component_subscribe($$self, currentDate, value => $$invalidate(34, $currentDate = value)); | ||
component_subscribe($$self, currentDate, value => $$invalidate(35, $currentDate = value)); | ||
component_subscribe($$self, dateClick, value => $$invalidate(12, $dateClick = value)); | ||
component_subscribe($$self, highlightedDates, value => $$invalidate(33, $highlightedDates = value)); | ||
component_subscribe($$self, moreLinkContent, value => $$invalidate(31, $moreLinkContent = value)); | ||
component_subscribe($$self, highlightedDates, value => $$invalidate(34, $highlightedDates = value)); | ||
component_subscribe($$self, moreLinkContent, value => $$invalidate(32, $moreLinkContent = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(11, $theme = value)); | ||
component_subscribe($$self, _view, value => $$invalidate(38, $_view = value)); | ||
component_subscribe($$self, _view, value => $$invalidate(39, $_view = value)); | ||
component_subscribe($$self, _interaction, value => $$invalidate(13, $_interaction = value)); | ||
component_subscribe($$self, selectable, value => $$invalidate(14, $selectable = value)); | ||
let { _hiddenEvents, _popupDate, _popupChunks } = getContext('view-state'); | ||
component_subscribe($$self, _hiddenEvents, value => $$invalidate(32, $_hiddenEvents = value)); | ||
component_subscribe($$self, _popupDate, value => $$invalidate(6, $_popupDate = value)); | ||
component_subscribe($$self, _popupChunks, value => $$invalidate(37, $_popupChunks = value)); | ||
component_subscribe($$self, _hiddenEvents, value => $$invalidate(33, $_hiddenEvents = value)); | ||
component_subscribe($$self, _popupDate, value => $$invalidate(31, $_popupDate = value)); | ||
component_subscribe($$self, _popupChunks, value => $$invalidate(38, $_popupChunks = value)); | ||
let el; | ||
@@ -1599,2 +1589,3 @@ let dayChunks; | ||
let moreLink = ''; | ||
let showPopup; | ||
@@ -1621,3 +1612,2 @@ function createClickHandler(fn) { | ||
function showMore() { | ||
setPopupChunks(); | ||
set_store_value(_popupDate, $_popupDate = date, $_popupDate); | ||
@@ -1627,27 +1617,12 @@ } | ||
function setPopupChunks() { | ||
let chunks = createPopupChunks(); | ||
let nextDay = addDay(cloneDate(date)); | ||
let chunks = dayChunks.concat(longChunks[date.getTime()] || []); | ||
if (chunks.length) { | ||
if (chunks[0].top) { | ||
// @todo check for the presence of top in all chunks | ||
// top is available, sort now | ||
sortChunks(chunks); | ||
} else { | ||
// sort later | ||
tick().then(() => { | ||
let chunks = createPopupChunks(); | ||
sortChunks(chunks); | ||
set_store_value(_popupChunks, $_popupChunks = chunks, $_popupChunks); | ||
}); | ||
} | ||
if (chunks.every(chunk => chunk.ready)) { | ||
set_store_value(_popupChunks, $_popupChunks = chunks.map(chunk => assign({}, chunk, createEventChunk(chunk.event, date, nextDay), { days: 1, dates: [date] })).sort((a, b) => a.top - b.top), $_popupChunks); | ||
} else { | ||
tick().then(setPopupChunks); | ||
} | ||
set_store_value(_popupChunks, $_popupChunks = chunks, $_popupChunks); | ||
} | ||
function createPopupChunks() { | ||
let nextDay = addDay(cloneDate(date)); | ||
return dayChunks.concat(longChunks[date.getTime()] || []).map(c => assign({}, c, createEventChunk(c.event, date, nextDay), { days: 1, dates: [date] })); | ||
} | ||
function createPointerDownHandler(interaction, selectable) { | ||
@@ -1697,3 +1672,3 @@ return selectable && interaction.action | ||
if ($$self.$$.dirty[0] & /*date*/ 1 | $$self.$$.dirty[1] & /*$currentDate, $highlightedDates*/ 12) { | ||
if ($$self.$$.dirty[0] & /*date*/ 1 | $$self.$$.dirty[1] & /*$currentDate, $highlightedDates*/ 24) { | ||
{ | ||
@@ -1706,3 +1681,3 @@ $$invalidate(8, isToday = datesEqual(date, today)); | ||
if ($$self.$$.dirty[0] & /*hiddenEvents, moreLink*/ 48 | $$self.$$.dirty[1] & /*$_hiddenEvents, $moreLinkContent*/ 3) { | ||
if ($$self.$$.dirty[0] & /*hiddenEvents, moreLink*/ 48 | $$self.$$.dirty[1] & /*$_hiddenEvents, $moreLinkContent*/ 6) { | ||
if ($_hiddenEvents && hiddenEvents.size) { | ||
@@ -1726,4 +1701,8 @@ // make Svelte update this block on $_hiddenEvents update | ||
if ($$self.$$.dirty[0] & /*$_popupDate, date, longChunks, dayChunks*/ 75) { | ||
if ($_popupDate && datesEqual(date, $_popupDate) && longChunks && dayChunks) { | ||
if ($$self.$$.dirty[0] & /*date*/ 1 | $$self.$$.dirty[1] & /*$_popupDate*/ 1) { | ||
$$invalidate(6, showPopup = $_popupDate && datesEqual(date, $_popupDate)); | ||
} | ||
if ($$self.$$.dirty[0] & /*showPopup, longChunks, dayChunks*/ 74) { | ||
if (showPopup && longChunks && dayChunks) { | ||
setPopupChunks(); | ||
@@ -1741,3 +1720,3 @@ } | ||
moreLink, | ||
$_popupDate, | ||
showPopup, | ||
el, | ||
@@ -1767,2 +1746,3 @@ isToday, | ||
chunks, | ||
$_popupDate, | ||
$moreLinkContent, | ||
@@ -1769,0 +1749,0 @@ $_hiddenEvents, |
{ | ||
"name": "@event-calendar/day-grid", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"title": "Event Calendar DayGrid plugin", | ||
@@ -39,5 +39,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/common": "~0.14.2", | ||
"@event-calendar/common": "~0.14.3", | ||
"svelte": "^3.55.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
132846
2015