@event-calendar/time-grid
Advanced tools
Comparing version 0.0.1-alpha.5 to 0.0.1-alpha.6
44
index.js
@@ -293,3 +293,3 @@ import { SvelteComponent, init, safe_not_equal, element, text, attr, insert, append, set_data, detach, create_slot, space, update_slot, transition_in, transition_out, destroy_each, component_subscribe, listen, set_store_value, binding_callbacks, action_destroyer, is_function, noop, run_all, create_component, mount_component, destroy_component, group_outros, check_outros, empty } from 'svelte/internal'; | ||
const child_ctx = ctx.slice(); | ||
child_ctx[22] = list[i]; | ||
child_ctx[23] = list[i]; | ||
return child_ctx; | ||
@@ -300,10 +300,10 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[25] = list[i]; | ||
child_ctx[26] = list[i]; | ||
return child_ctx; | ||
} | ||
// (33:3) {#each $_times as time} | ||
// (36:3) {#each $_times as time} | ||
function create_each_block_1(ctx) { | ||
let div; | ||
let t_value = /*time*/ ctx[25] + ""; | ||
let t_value = /*time*/ ctx[26] + ""; | ||
let t; | ||
@@ -323,3 +323,3 @@ let div_class_value; | ||
p(ctx, dirty) { | ||
if (dirty & /*$_times*/ 8 && t_value !== (t_value = /*time*/ ctx[25] + "")) set_data(t, t_value); | ||
if (dirty & /*$_times*/ 8 && t_value !== (t_value = /*time*/ ctx[26] + "")) set_data(t, t_value); | ||
@@ -336,3 +336,3 @@ if (dirty & /*$theme*/ 16 && div_class_value !== (div_class_value = /*$theme*/ ctx[4].time)) { | ||
// (39:4) {#each lines as line} | ||
// (42:4) {#each lines as line} | ||
function create_each_block$1(ctx) { | ||
@@ -553,5 +553,5 @@ let div; | ||
let $_times; | ||
let $_slotTimeLimits; | ||
let $_viewDates; | ||
let $scrollTime; | ||
let $_slotTimeLimits; | ||
let $_scrollable; | ||
@@ -561,9 +561,9 @@ let $theme; | ||
let { slotDuration, _intlSlotLabel, _viewDates, scrollTime, _scrollable, theme } = getContext("state"); | ||
component_subscribe($$self, slotDuration, value => $$invalidate(16, $slotDuration = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(17, $_viewDates = value)); | ||
component_subscribe($$self, scrollTime, value => $$invalidate(18, $scrollTime = value)); | ||
component_subscribe($$self, _scrollable, value => $$invalidate(20, $_scrollable = value)); | ||
component_subscribe($$self, slotDuration, value => $$invalidate(17, $slotDuration = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(19, $_viewDates = value)); | ||
component_subscribe($$self, scrollTime, value => $$invalidate(20, $scrollTime = value)); | ||
component_subscribe($$self, _scrollable, value => $$invalidate(21, $_scrollable = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(4, $theme = value)); | ||
let { _slotTimeLimits, _times } = getContext("view-state"); | ||
component_subscribe($$self, _slotTimeLimits, value => $$invalidate(19, $_slotTimeLimits = value)); | ||
component_subscribe($$self, _slotTimeLimits, value => $$invalidate(18, $_slotTimeLimits = value)); | ||
component_subscribe($$self, _times, value => $$invalidate(3, $_times = value)); | ||
@@ -573,2 +573,3 @@ let el; | ||
let lines = []; | ||
let timeLimitMin; | ||
@@ -582,3 +583,3 @@ function recheckScrollable() { | ||
el = $$value; | ||
(((($$invalidate(0, el), $$invalidate(17, $_viewDates)), $$invalidate(18, $scrollTime)), $$invalidate(19, $_slotTimeLimits)), $$invalidate(16, $slotDuration)); | ||
(((((($$invalidate(0, el), $$invalidate(19, $_viewDates)), $$invalidate(20, $scrollTime)), $$invalidate(16, timeLimitMin)), $$invalidate(17, $slotDuration)), $$invalidate(3, $_times)), $$invalidate(18, $_slotTimeLimits)); | ||
}); | ||
@@ -592,16 +593,19 @@ } | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*$slotDuration, $_times*/ 65544) { | ||
if ($$self.$$.dirty & /*$slotDuration, $_times, $_slotTimeLimits*/ 393224) { | ||
{ | ||
$$invalidate(1, compact = $slotDuration.seconds >= 3600); | ||
$$invalidate(2, lines.length = $_times.length, lines); | ||
// Use intermediate variable so that changes in _slotTimeLimits do not trigger setting the el.scrollTop | ||
$$invalidate(16, timeLimitMin = $_slotTimeLimits.min.seconds); | ||
} | ||
} | ||
if ($$self.$$.dirty & /*el, $_viewDates, $scrollTime, $_slotTimeLimits, $slotDuration*/ 983041) { | ||
if ($$self.$$.dirty & /*el, $_viewDates, $scrollTime, timeLimitMin, $slotDuration*/ 1769473) { | ||
if (el && $_viewDates) { | ||
$$invalidate(0, el.scrollTop = ($scrollTime.seconds - $_slotTimeLimits.min.seconds) / $slotDuration.seconds * 24 - 12, el); | ||
$$invalidate(0, el.scrollTop = ($scrollTime.seconds - timeLimitMin) / $slotDuration.seconds * 24 - 12, el); | ||
} | ||
} | ||
if ($$self.$$.dirty & /*el, $_times, $slotDuration*/ 65545) { | ||
if ($$self.$$.dirty & /*el, $_times, $slotDuration*/ 131081) { | ||
if (el && $_times && $slotDuration) { | ||
@@ -825,3 +829,3 @@ tick().then(recheckScrollable); | ||
let bgColor = chunk.event.backgroundColor || $eventBackgroundColor || $eventColor; | ||
$$invalidate(2, style = `top:${top}px;` + `min-height:${height}px;` + `height:${height}px;` + `max-height:${maxHeight}px;` + `z-index:${chunk.column + 1};`); | ||
$$invalidate(2, style = `top:${top}px;` + `min-height:${height}px;` + `height:${height}px;` + `max-height:${maxHeight}px;`); | ||
@@ -838,3 +842,3 @@ if (bgColor) { | ||
$$invalidate(1, className = $theme.event); | ||
$$invalidate(2, style += `left:${100 / chunk.group.columns.length * chunk.column}%;` + `width:${100 / chunk.group.columns.length * 0.5 * (1 + chunk.group.columns.length - chunk.column)}%;`); | ||
$$invalidate(2, style += `z-index:${chunk.column + 1};` + `left:${100 / chunk.group.columns.length * chunk.column}%;` + `width:${100 / chunk.group.columns.length * 0.5 * (1 + chunk.group.columns.length - chunk.column)}%;`); | ||
} | ||
@@ -1184,3 +1188,3 @@ | ||
let chunks, bgChunks; | ||
let today = setMidnight(new Date()), isToday, highlight; | ||
let today = setMidnight(createDate()), isToday, highlight; | ||
@@ -1187,0 +1191,0 @@ function handleClick(jsEvent) { |
{ | ||
"name": "@event-calendar/time-grid", | ||
"version": "0.0.1-alpha.5", | ||
"version": "0.0.1-alpha.6", | ||
"type": "module", | ||
@@ -10,5 +10,5 @@ "exports": { | ||
"dependencies": { | ||
"@event-calendar/common": "~0.0.1-alpha.5", | ||
"@event-calendar/common": "~0.0.1-alpha.6", | ||
"svelte": "^3.25.0" | ||
} | ||
} |
43549
1365