@event-calendar/resource-time-grid
Advanced tools
Comparing version 0.10.2 to 0.11.0
686
index.js
@@ -1,4 +0,4 @@ | ||
import { SvelteComponent, init, safe_not_equal, create_component, space, mount_component, insert, transition_in, transition_out, destroy_component, detach, component_subscribe, set_store_value, element, text, attr, append, set_data, destroy_each, empty, group_outros, check_outros } from 'svelte/internal'; | ||
import { SvelteComponent, init, safe_not_equal, create_component, mount_component, transition_in, transition_out, destroy_component, space, insert, group_outros, check_outros, detach, component_subscribe, set_store_value, element, text, attr, append, set_data, destroy_each, empty } from 'svelte/internal'; | ||
import { getContext, setContext } from 'svelte'; | ||
import { State as State$1, Header, Body, Day } from '@event-calendar/time-grid'; | ||
import { State as State$1, Header, Body, Day, Week } from '@event-calendar/time-grid'; | ||
import { derived } from 'svelte/store'; | ||
@@ -49,3 +49,3 @@ | ||
const child_ctx = ctx.slice(); | ||
child_ctx[16] = list[i]; | ||
child_ctx[18] = list[i]; | ||
return child_ctx; | ||
@@ -56,9 +56,15 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[19] = list[i]; | ||
child_ctx[21] = list[i]; | ||
return child_ctx; | ||
} | ||
function get_each_context_4(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
child_ctx[27] = list[i]; | ||
return child_ctx; | ||
} | ||
function get_each_context_2(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
child_ctx[16] = list[i]; | ||
child_ctx[24] = list[i]; | ||
return child_ctx; | ||
@@ -69,15 +75,27 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[19] = list[i]; | ||
child_ctx[27] = list[i]; | ||
return child_ctx; | ||
} | ||
function get_each_context_5(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
child_ctx[18] = list[i]; | ||
return child_ctx; | ||
} | ||
function get_each_context_6(ctx, list, i) { | ||
const child_ctx = ctx.slice(); | ||
child_ctx[21] = list[i]; | ||
return child_ctx; | ||
} | ||
// (31:3) {#if loops[1].length > 1} | ||
function create_if_block(ctx) { | ||
function create_if_block_2(ctx) { | ||
let div; | ||
let div_class_value; | ||
let each_value_3 = /*loops*/ ctx[0][1]; | ||
let each_value_6 = /*loops*/ ctx[0][1]; | ||
let each_blocks = []; | ||
for (let i = 0; i < each_value_3.length; i += 1) { | ||
each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); | ||
for (let i = 0; i < each_value_6.length; i += 1) { | ||
each_blocks[i] = create_each_block_6(get_each_context_6(ctx, each_value_6, i)); | ||
} | ||
@@ -93,3 +111,3 @@ | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[3].days); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[5].days); | ||
}, | ||
@@ -104,8 +122,8 @@ m(target, anchor) { | ||
p(ctx, dirty) { | ||
if (dirty & /*$theme, titles, loops*/ 11) { | ||
each_value_3 = /*loops*/ ctx[0][1]; | ||
if (dirty[0] & /*$theme, titles, loops*/ 35) { | ||
each_value_6 = /*loops*/ ctx[0][1]; | ||
let i; | ||
for (i = 0; i < each_value_3.length; i += 1) { | ||
const child_ctx = get_each_context_3(ctx, each_value_3, i); | ||
for (i = 0; i < each_value_6.length; i += 1) { | ||
const child_ctx = get_each_context_6(ctx, each_value_6, i); | ||
@@ -115,3 +133,3 @@ if (each_blocks[i]) { | ||
} else { | ||
each_blocks[i] = create_each_block_3(child_ctx); | ||
each_blocks[i] = create_each_block_6(child_ctx); | ||
each_blocks[i].c(); | ||
@@ -126,6 +144,6 @@ each_blocks[i].m(div, null); | ||
each_blocks.length = each_value_3.length; | ||
each_blocks.length = each_value_6.length; | ||
} | ||
if (dirty & /*$theme*/ 8 && div_class_value !== (div_class_value = /*$theme*/ ctx[3].days)) { | ||
if (dirty[0] & /*$theme*/ 32 && div_class_value !== (div_class_value = /*$theme*/ ctx[5].days)) { | ||
attr(div, "class", div_class_value); | ||
@@ -142,5 +160,5 @@ } | ||
// (33:5) {#each loops[1] as item1} | ||
function create_each_block_3(ctx) { | ||
function create_each_block_6(ctx) { | ||
let div; | ||
let t_value = /*titles*/ ctx[1][1](/*item1*/ ctx[19]) + ""; | ||
let t_value = /*titles*/ ctx[1][1](/*item1*/ ctx[21]) + ""; | ||
let t; | ||
@@ -153,3 +171,3 @@ let div_class_value; | ||
t = text(t_value); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[3].day); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[5].day); | ||
}, | ||
@@ -161,5 +179,5 @@ m(target, anchor) { | ||
p(ctx, dirty) { | ||
if (dirty & /*titles, loops*/ 3 && t_value !== (t_value = /*titles*/ ctx[1][1](/*item1*/ ctx[19]) + "")) set_data(t, t_value); | ||
if (dirty[0] & /*titles, loops*/ 3 && t_value !== (t_value = /*titles*/ ctx[1][1](/*item1*/ ctx[21]) + "")) set_data(t, t_value); | ||
if (dirty & /*$theme*/ 8 && div_class_value !== (div_class_value = /*$theme*/ ctx[3].day)) { | ||
if (dirty[0] & /*$theme*/ 32 && div_class_value !== (div_class_value = /*$theme*/ ctx[5].day)) { | ||
attr(div, "class", div_class_value); | ||
@@ -175,6 +193,6 @@ } | ||
// (28:1) {#each loops[0] as item0} | ||
function create_each_block_2(ctx) { | ||
function create_each_block_5(ctx) { | ||
let div1; | ||
let div0; | ||
let t0_value = /*titles*/ ctx[1][0](/*item0*/ ctx[16]) + ""; | ||
let t0_value = /*titles*/ ctx[1][0](/*item0*/ ctx[18]) + ""; | ||
let t0; | ||
@@ -185,3 +203,3 @@ let div0_class_value; | ||
let div1_class_value; | ||
let if_block = /*loops*/ ctx[0][1].length > 1 && create_if_block(ctx); | ||
let if_block = /*loops*/ ctx[0][1].length > 1 && create_if_block_2(ctx); | ||
@@ -196,4 +214,4 @@ return { | ||
t2 = space(); | ||
attr(div0, "class", div0_class_value = /*$theme*/ ctx[3].day); | ||
attr(div1, "class", div1_class_value = /*$theme*/ ctx[3].resource); | ||
attr(div0, "class", div0_class_value = /*$theme*/ ctx[5].day); | ||
attr(div1, "class", div1_class_value = /*$theme*/ ctx[5].resource); | ||
}, | ||
@@ -209,5 +227,5 @@ m(target, anchor) { | ||
p(ctx, dirty) { | ||
if (dirty & /*titles, loops*/ 3 && t0_value !== (t0_value = /*titles*/ ctx[1][0](/*item0*/ ctx[16]) + "")) set_data(t0, t0_value); | ||
if (dirty[0] & /*titles, loops*/ 3 && t0_value !== (t0_value = /*titles*/ ctx[1][0](/*item0*/ ctx[18]) + "")) set_data(t0, t0_value); | ||
if (dirty & /*$theme*/ 8 && div0_class_value !== (div0_class_value = /*$theme*/ ctx[3].day)) { | ||
if (dirty[0] & /*$theme*/ 32 && div0_class_value !== (div0_class_value = /*$theme*/ ctx[5].day)) { | ||
attr(div0, "class", div0_class_value); | ||
@@ -220,3 +238,3 @@ } | ||
} else { | ||
if_block = create_if_block(ctx); | ||
if_block = create_if_block_2(ctx); | ||
if_block.c(); | ||
@@ -230,3 +248,3 @@ if_block.m(div1, t2); | ||
if (dirty & /*$theme*/ 8 && div1_class_value !== (div1_class_value = /*$theme*/ ctx[3].resource)) { | ||
if (dirty[0] & /*$theme*/ 32 && div1_class_value !== (div1_class_value = /*$theme*/ ctx[5].resource)) { | ||
attr(div1, "class", div1_class_value); | ||
@@ -243,7 +261,193 @@ } | ||
// (27:0) <Header> | ||
function create_default_slot_1(ctx) { | ||
function create_default_slot_2(ctx) { | ||
let each_1_anchor; | ||
let each_value_2 = /*loops*/ ctx[0][0]; | ||
let each_value_5 = /*loops*/ ctx[0][0]; | ||
let each_blocks = []; | ||
for (let i = 0; i < each_value_5.length; i += 1) { | ||
each_blocks[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); | ||
} | ||
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); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*$theme, loops, titles*/ 35) { | ||
each_value_5 = /*loops*/ ctx[0][0]; | ||
let i; | ||
for (i = 0; i < each_value_5.length; i += 1) { | ||
const child_ctx = get_each_context_5(ctx, each_value_5, i); | ||
if (each_blocks[i]) { | ||
each_blocks[i].p(child_ctx, dirty); | ||
} else { | ||
each_blocks[i] = create_each_block_5(child_ctx); | ||
each_blocks[i].c(); | ||
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); | ||
} | ||
} | ||
for (; i < each_blocks.length; i += 1) { | ||
each_blocks[i].d(1); | ||
} | ||
each_blocks.length = each_value_5.length; | ||
} | ||
}, | ||
d(detaching) { | ||
destroy_each(each_blocks, detaching); | ||
if (detaching) detach(each_1_anchor); | ||
} | ||
}; | ||
} | ||
// (41:0) {#if $allDaySlot} | ||
function create_if_block(ctx) { | ||
let header; | ||
let current; | ||
header = new Header({ | ||
props: { | ||
allDay: true, | ||
$$slots: { default: [create_default_slot_1] }, | ||
$$scope: { ctx } | ||
} | ||
}); | ||
return { | ||
c() { | ||
create_component(header.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
mount_component(header, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
const header_changes = {}; | ||
if (dirty[0] & /*$_viewDates, $theme, $_viewResources, $datesAboveResources*/ 60 | dirty[1] & /*$$scope*/ 32) { | ||
header_changes.$$scope = { dirty, ctx }; | ||
} | ||
header.$set(header_changes); | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(header.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(header.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(header, detaching); | ||
} | ||
}; | ||
} | ||
// (51:2) {:else} | ||
function create_else_block(ctx) { | ||
let each_1_anchor; | ||
let current; | ||
let each_value_4 = /*$_viewResources*/ ctx[2]; | ||
let each_blocks = []; | ||
for (let i = 0; i < each_value_4.length; i += 1) { | ||
each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, 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[0] & /*$theme, $_viewDates, $_viewResources*/ 44) { | ||
each_value_4 = /*$_viewResources*/ ctx[2]; | ||
let i; | ||
for (i = 0; i < each_value_4.length; i += 1) { | ||
const child_ctx = get_each_context_4(ctx, each_value_4, 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_4(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_4.length; i < each_blocks.length; i += 1) { | ||
out(i); | ||
} | ||
check_outros(); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
for (let i = 0; i < each_value_4.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); | ||
} | ||
}; | ||
} | ||
// (43:2) {#if $datesAboveResources} | ||
function create_if_block_1(ctx) { | ||
let each_1_anchor; | ||
let current; | ||
let each_value_2 = /*$_viewDates*/ ctx[3]; | ||
let each_blocks = []; | ||
for (let i = 0; i < each_value_2.length; i += 1) { | ||
@@ -253,2 +457,6 @@ each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
}); | ||
return { | ||
@@ -268,6 +476,7 @@ c() { | ||
insert(target, each_1_anchor, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty & /*$theme, loops, titles*/ 11) { | ||
each_value_2 = /*loops*/ ctx[0][0]; | ||
if (dirty[0] & /*$theme, $_viewResources, $_viewDates*/ 44) { | ||
each_value_2 = /*$_viewDates*/ ctx[3]; | ||
let i; | ||
@@ -280,5 +489,7 @@ | ||
each_blocks[i].p(child_ctx, dirty); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block_2(child_ctx); | ||
each_blocks[i].c(); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); | ||
@@ -288,9 +499,29 @@ } | ||
for (; i < each_blocks.length; i += 1) { | ||
each_blocks[i].d(1); | ||
group_outros(); | ||
for (i = each_value_2.length; i < each_blocks.length; i += 1) { | ||
out(i); | ||
} | ||
each_blocks.length = each_value_2.length; | ||
check_outros(); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
for (let i = 0; i < each_value_2.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) { | ||
@@ -303,3 +534,263 @@ destroy_each(each_blocks, detaching); | ||
// (44:3) {#each loops[1] as item1} | ||
// (52:3) {#each $_viewResources as resource} | ||
function create_each_block_4(ctx) { | ||
let div; | ||
let week; | ||
let t; | ||
let div_class_value; | ||
let current; | ||
week = new Week({ | ||
props: { | ||
dates: /*$_viewDates*/ ctx[3], | ||
resource: /*resource*/ ctx[27] | ||
} | ||
}); | ||
return { | ||
c() { | ||
div = element("div"); | ||
create_component(week.$$.fragment); | ||
t = space(); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[5].resource); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
mount_component(week, div, null); | ||
append(div, t); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
const week_changes = {}; | ||
if (dirty[0] & /*$_viewDates*/ 8) week_changes.dates = /*$_viewDates*/ ctx[3]; | ||
if (dirty[0] & /*$_viewResources*/ 4) week_changes.resource = /*resource*/ ctx[27]; | ||
week.$set(week_changes); | ||
if (!current || dirty[0] & /*$theme*/ 32 && div_class_value !== (div_class_value = /*$theme*/ ctx[5].resource)) { | ||
attr(div, "class", div_class_value); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(week.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(week.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
destroy_component(week); | ||
} | ||
}; | ||
} | ||
// (46:5) {#each $_viewResources as resource} | ||
function create_each_block_3(ctx) { | ||
let week; | ||
let current; | ||
week = new Week({ | ||
props: { | ||
dates: [/*date*/ ctx[24]], | ||
resource: /*resource*/ ctx[27] | ||
} | ||
}); | ||
return { | ||
c() { | ||
create_component(week.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
mount_component(week, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
const week_changes = {}; | ||
if (dirty[0] & /*$_viewDates*/ 8) week_changes.dates = [/*date*/ ctx[24]]; | ||
if (dirty[0] & /*$_viewResources*/ 4) week_changes.resource = /*resource*/ ctx[27]; | ||
week.$set(week_changes); | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(week.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(week.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
destroy_component(week, detaching); | ||
} | ||
}; | ||
} | ||
// (44:3) {#each $_viewDates as date} | ||
function create_each_block_2(ctx) { | ||
let div; | ||
let t; | ||
let div_class_value; | ||
let current; | ||
let each_value_3 = /*$_viewResources*/ ctx[2]; | ||
let each_blocks = []; | ||
for (let i = 0; i < each_value_3.length; i += 1) { | ||
each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); | ||
} | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
}); | ||
return { | ||
c() { | ||
div = element("div"); | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].c(); | ||
} | ||
t = space(); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[5].resource); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].m(div, null); | ||
} | ||
append(div, t); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*$_viewDates, $_viewResources*/ 12) { | ||
each_value_3 = /*$_viewResources*/ ctx[2]; | ||
let i; | ||
for (i = 0; i < each_value_3.length; i += 1) { | ||
const child_ctx = get_each_context_3(ctx, each_value_3, 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(div, t); | ||
} | ||
} | ||
group_outros(); | ||
for (i = each_value_3.length; i < each_blocks.length; i += 1) { | ||
out(i); | ||
} | ||
check_outros(); | ||
} | ||
if (!current || dirty[0] & /*$theme*/ 32 && div_class_value !== (div_class_value = /*$theme*/ ctx[5].resource)) { | ||
attr(div, "class", div_class_value); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
for (let i = 0; i < each_value_3.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) { | ||
if (detaching) detach(div); | ||
destroy_each(each_blocks, detaching); | ||
} | ||
}; | ||
} | ||
// (42:1) <Header allDay> | ||
function create_default_slot_1(ctx) { | ||
let current_block_type_index; | ||
let if_block; | ||
let if_block_anchor; | ||
let current; | ||
const if_block_creators = [create_if_block_1, create_else_block]; | ||
const if_blocks = []; | ||
function select_block_type(ctx, dirty) { | ||
if (/*$datesAboveResources*/ ctx[4]) return 0; | ||
return 1; | ||
} | ||
current_block_type_index = select_block_type(ctx); | ||
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); | ||
return { | ||
c() { | ||
if_block.c(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
if_blocks[current_block_type_index].m(target, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
current = true; | ||
}, | ||
p(ctx, dirty) { | ||
let previous_block_index = current_block_type_index; | ||
current_block_type_index = select_block_type(ctx); | ||
if (current_block_type_index === previous_block_index) { | ||
if_blocks[current_block_type_index].p(ctx, dirty); | ||
} else { | ||
group_outros(); | ||
transition_out(if_blocks[previous_block_index], 1, 1, () => { | ||
if_blocks[previous_block_index] = null; | ||
}); | ||
check_outros(); | ||
if_block = if_blocks[current_block_type_index]; | ||
if (!if_block) { | ||
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); | ||
if_block.c(); | ||
} else { | ||
if_block.p(ctx, dirty); | ||
} | ||
transition_in(if_block, 1); | ||
if_block.m(if_block_anchor.parentNode, if_block_anchor); | ||
} | ||
}, | ||
i(local) { | ||
if (current) return; | ||
transition_in(if_block); | ||
current = true; | ||
}, | ||
o(local) { | ||
transition_out(if_block); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if_blocks[current_block_type_index].d(detaching); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
}; | ||
} | ||
// (63:3) {#each loops[1] as item1} | ||
function create_each_block_1(ctx) { | ||
@@ -311,8 +802,8 @@ let day; | ||
props: { | ||
date: /*$datesAboveResources*/ ctx[2] | ||
? /*item0*/ ctx[16] | ||
: /*item1*/ ctx[19], | ||
resource: /*$datesAboveResources*/ ctx[2] | ||
? /*item1*/ ctx[19] | ||
: /*item0*/ ctx[16] | ||
date: /*$datesAboveResources*/ ctx[4] | ||
? /*item0*/ ctx[18] | ||
: /*item1*/ ctx[21], | ||
resource: /*$datesAboveResources*/ ctx[4] | ||
? /*item1*/ ctx[21] | ||
: /*item0*/ ctx[18] | ||
} | ||
@@ -332,9 +823,9 @@ }); | ||
if (dirty & /*$datesAboveResources, loops*/ 5) day_changes.date = /*$datesAboveResources*/ ctx[2] | ||
? /*item0*/ ctx[16] | ||
: /*item1*/ ctx[19]; | ||
if (dirty[0] & /*$datesAboveResources, loops*/ 17) day_changes.date = /*$datesAboveResources*/ ctx[4] | ||
? /*item0*/ ctx[18] | ||
: /*item1*/ ctx[21]; | ||
if (dirty & /*$datesAboveResources, loops*/ 5) day_changes.resource = /*$datesAboveResources*/ ctx[2] | ||
? /*item1*/ ctx[19] | ||
: /*item0*/ ctx[16]; | ||
if (dirty[0] & /*$datesAboveResources, loops*/ 17) day_changes.resource = /*$datesAboveResources*/ ctx[4] | ||
? /*item1*/ ctx[21] | ||
: /*item0*/ ctx[18]; | ||
@@ -358,3 +849,3 @@ day.$set(day_changes); | ||
// (42:1) {#each loops[0] as item0} | ||
// (61:1) {#each loops[0] as item0} | ||
function create_each_block(ctx) { | ||
@@ -385,3 +876,3 @@ let div; | ||
t = space(); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[3].resource); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[5].resource); | ||
}, | ||
@@ -399,3 +890,3 @@ m(target, anchor) { | ||
p(ctx, dirty) { | ||
if (dirty & /*$datesAboveResources, loops*/ 5) { | ||
if (dirty[0] & /*$datesAboveResources, loops*/ 17) { | ||
each_value_1 = /*loops*/ ctx[0][1]; | ||
@@ -427,3 +918,3 @@ let i; | ||
if (!current || dirty & /*$theme*/ 8 && div_class_value !== (div_class_value = /*$theme*/ ctx[3].resource)) { | ||
if (!current || dirty[0] & /*$theme*/ 32 && div_class_value !== (div_class_value = /*$theme*/ ctx[5].resource)) { | ||
attr(div, "class", div_class_value); | ||
@@ -457,3 +948,3 @@ } | ||
// (41:0) <Body> | ||
// (60:0) <Body> | ||
function create_default_slot(ctx) { | ||
@@ -490,3 +981,3 @@ let each_1_anchor; | ||
p(ctx, dirty) { | ||
if (dirty & /*$theme, loops, $datesAboveResources*/ 13) { | ||
if (dirty[0] & /*$theme, loops, $datesAboveResources*/ 49) { | ||
each_value = /*loops*/ ctx[0][0]; | ||
@@ -545,3 +1036,4 @@ let i; | ||
let header; | ||
let t; | ||
let t0; | ||
let t1; | ||
let body; | ||
@@ -552,3 +1044,3 @@ let current; | ||
props: { | ||
$$slots: { default: [create_default_slot_1] }, | ||
$$slots: { default: [create_default_slot_2] }, | ||
$$scope: { ctx } | ||
@@ -558,2 +1050,4 @@ } | ||
let if_block = /*$allDaySlot*/ ctx[6] && create_if_block(ctx); | ||
body = new Body({ | ||
@@ -569,3 +1063,5 @@ props: { | ||
create_component(header.$$.fragment); | ||
t = space(); | ||
t0 = space(); | ||
if (if_block) if_block.c(); | ||
t1 = space(); | ||
create_component(body.$$.fragment); | ||
@@ -575,10 +1071,12 @@ }, | ||
mount_component(header, target, anchor); | ||
insert(target, t, anchor); | ||
insert(target, t0, anchor); | ||
if (if_block) if_block.m(target, anchor); | ||
insert(target, t1, anchor); | ||
mount_component(body, target, anchor); | ||
current = true; | ||
}, | ||
p(ctx, [dirty]) { | ||
p(ctx, dirty) { | ||
const header_changes = {}; | ||
if (dirty & /*$$scope, loops, $theme, titles*/ 67108875) { | ||
if (dirty[0] & /*loops, $theme, titles*/ 35 | dirty[1] & /*$$scope*/ 32) { | ||
header_changes.$$scope = { dirty, ctx }; | ||
@@ -588,5 +1086,29 @@ } | ||
header.$set(header_changes); | ||
if (/*$allDaySlot*/ ctx[6]) { | ||
if (if_block) { | ||
if_block.p(ctx, dirty); | ||
if (dirty[0] & /*$allDaySlot*/ 64) { | ||
transition_in(if_block, 1); | ||
} | ||
} else { | ||
if_block = create_if_block(ctx); | ||
if_block.c(); | ||
transition_in(if_block, 1); | ||
if_block.m(t1.parentNode, t1); | ||
} | ||
} else if (if_block) { | ||
group_outros(); | ||
transition_out(if_block, 1, 1, () => { | ||
if_block = null; | ||
}); | ||
check_outros(); | ||
} | ||
const body_changes = {}; | ||
if (dirty & /*$$scope, loops, $theme, $datesAboveResources*/ 67108877) { | ||
if (dirty[0] & /*loops, $theme, $datesAboveResources*/ 49 | dirty[1] & /*$$scope*/ 32) { | ||
body_changes.$$scope = { dirty, ctx }; | ||
@@ -600,2 +1122,3 @@ } | ||
transition_in(header.$$.fragment, local); | ||
transition_in(if_block); | ||
transition_in(body.$$.fragment, local); | ||
@@ -606,2 +1129,3 @@ current = true; | ||
transition_out(header.$$.fragment, local); | ||
transition_out(if_block); | ||
transition_out(body.$$.fragment, local); | ||
@@ -612,3 +1136,5 @@ current = false; | ||
destroy_component(header, detaching); | ||
if (detaching) detach(t); | ||
if (detaching) detach(t0); | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) detach(t1); | ||
destroy_component(body, detaching); | ||
@@ -626,13 +1152,15 @@ } | ||
let $theme; | ||
let $allDaySlot; | ||
let state = getContext('state'); | ||
let { datesAboveResources, _viewDates, _intlDayHeader, _viewClass, theme } = state; | ||
component_subscribe($$self, datesAboveResources, value => $$invalidate(2, $datesAboveResources = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(12, $_viewDates = value)); | ||
component_subscribe($$self, _intlDayHeader, value => $$invalidate(10, $_intlDayHeader = value)); | ||
component_subscribe($$self, _viewClass, value => $$invalidate(13, $_viewClass = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(3, $theme = value)); | ||
let { datesAboveResources, _viewDates, _intlDayHeader, _viewClass, allDaySlot, theme } = state; | ||
component_subscribe($$self, datesAboveResources, value => $$invalidate(4, $datesAboveResources = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(3, $_viewDates = value)); | ||
component_subscribe($$self, _intlDayHeader, value => $$invalidate(14, $_intlDayHeader = value)); | ||
component_subscribe($$self, _viewClass, value => $$invalidate(15, $_viewClass = value)); | ||
component_subscribe($$self, allDaySlot, value => $$invalidate(6, $allDaySlot = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(5, $theme = value)); | ||
let viewState = new State(state); | ||
setContext('view-state', viewState); | ||
let { _viewResources } = viewState; | ||
component_subscribe($$self, _viewResources, value => $$invalidate(11, $_viewResources = value)); | ||
component_subscribe($$self, _viewResources, value => $$invalidate(2, $_viewResources = value)); | ||
set_store_value(_viewClass, $_viewClass = 'week', $_viewClass); | ||
@@ -642,3 +1170,3 @@ let loops, titles; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*$datesAboveResources, loops, $_viewDates, $_viewResources, titles, $_intlDayHeader*/ 7175) { | ||
if ($$self.$$.dirty[0] & /*$datesAboveResources, loops, $_viewDates, $_viewResources, titles, $_intlDayHeader*/ 16415) { | ||
{ | ||
@@ -662,4 +1190,7 @@ $$invalidate(0, loops = []); | ||
titles, | ||
$_viewResources, | ||
$_viewDates, | ||
$datesAboveResources, | ||
$theme, | ||
$allDaySlot, | ||
datesAboveResources, | ||
@@ -669,7 +1200,6 @@ _viewDates, | ||
_viewClass, | ||
allDaySlot, | ||
theme, | ||
_viewResources, | ||
$_intlDayHeader, | ||
$_viewResources, | ||
$_viewDates | ||
$_intlDayHeader | ||
]; | ||
@@ -681,3 +1211,3 @@ } | ||
super(); | ||
init(this, options, instance, create_fragment, safe_not_equal, {}); | ||
init(this, options, instance, create_fragment, safe_not_equal, {}, null, [-1, -1]); | ||
} | ||
@@ -684,0 +1214,0 @@ } |
{ | ||
"name": "@event-calendar/resource-time-grid", | ||
"version": "0.10.2", | ||
"version": "0.11.0", | ||
"title": "Event Calendar ResourceTimeGrid plugin", | ||
@@ -36,5 +36,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/time-grid": "~0.10.2", | ||
"@event-calendar/time-grid": "~0.11.0", | ||
"svelte": "^3.47.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# Event Calendar [![](https://data.jsdelivr.com/v1/package/npm/@event-calendar/build/badge)](https://www.jsdelivr.com/package/npm/@event-calendar/build) [![Donate](https://img.shields.io/badge/Donate_$10-PayPal-green.svg)](https://www.paypal.me/vkurko/10usd) [![Donate](https://img.shields.io/badge/Donate_$1-PayPal-green.svg)](https://www.paypal.me/vkurko/1usd) | ||
# Event Calendar [![](https://data.jsdelivr.com/v1/package/npm/@event-calendar/build/badge)](https://www.jsdelivr.com/package/npm/@event-calendar/build) [![Sponsor](https://img.shields.io/badge/Sponsor-$10-green.svg)](https://www.paypal.me/vkurko/10usd) [![Sponsor](https://img.shields.io/badge/Sponsor-$1-green.svg)](https://www.paypal.me/vkurko/1usd) | ||
@@ -7,3 +7,3 @@ See [demo](https://vkurko.github.io/calendar/). | ||
* Lightweight (49kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Lightweight (55kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version) | ||
* Zero-dependency (pre-built bundle) | ||
@@ -23,2 +23,4 @@ * Used by [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/) | ||
- [allDayContent](#alldaycontent) | ||
- [allDaySlot](#alldayslot) | ||
- [buttonText](#buttontext) | ||
@@ -43,5 +45,5 @@ - [date](#date) | ||
- [eventDragMinDistance](#eventdragmindistance) | ||
- [eventDragStart](#eventdragstart) | ||
</td><td> | ||
- [eventDragStart](#eventdragstart) | ||
- [eventDragStop](#eventdragstop) | ||
@@ -218,2 +220,37 @@ - [eventDrop](#eventdrop) | ||
### allDayContent | ||
- Type `string`, `object`or `function` | ||
- Default `'all-day'` | ||
Defines the content that is displayed as a title of the `all-day` slot. | ||
This value can be either a string containing HTML `'<p>...</p>'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats: | ||
```js | ||
function (arg) { | ||
// return string or object | ||
} | ||
``` | ||
`arg` is an object with the following properties: | ||
<table> | ||
<tr> | ||
<td> | ||
`text` | ||
</td> | ||
<td> | ||
The default text | ||
</td> | ||
</tr> | ||
</table> | ||
### allDaySlot | ||
- Type `boolean` | ||
- Default `false` | ||
Determines whether the `all-day` slot is displayed at the top of the calendar. | ||
When hidden with false, all-day events will not be displayed in `timeGrid`/`resourceTimeGrid` views. | ||
### buttonText | ||
@@ -1698,2 +1735,11 @@ - Type `object` | ||
`allDay` | ||
</td> | ||
<td> | ||
Boolean (`true` or `false`). Determines if the event is shown in the `all-day` slot</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`start` | ||
@@ -1819,2 +1865,12 @@ </td> | ||
`allDay` | ||
</td> | ||
<td> | ||
`boolean` Determines if the event is shown in the all-day slot. Default `false` | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`start` | ||
@@ -1821,0 +1877,0 @@ </td> |
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
81041
1096
2113
+ Added@event-calendar/common@0.11.2(transitive)
+ Added@event-calendar/time-grid@0.11.2(transitive)
- Removed@event-calendar/common@0.10.2(transitive)
- Removed@event-calendar/time-grid@0.10.2(transitive)