Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@event-calendar/day-grid

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@event-calendar/day-grid - npm Package Compare versions

Comparing version 0.19.0 to 1.0.0

392

index.js

@@ -1,5 +0,5 @@

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 { SvelteComponent, init, safe_not_equal, element, space, attr, insert, append, noop, detach, destroy_each, component_subscribe, text, set_data, create_slot, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, binding_callbacks, construct_svelte_component, create_component, mount_component, action_destroyer, listen, is_function, group_outros, destroy_component, check_outros, run_all, stop_propagation, update_keyed_each, outro_and_destroy_block, empty, set_store_value, bubble } from 'svelte/internal';
import { getContext, onMount, tick, afterUpdate, setContext } from 'svelte';
import { derived, writable } from 'svelte/store';
import { cloneDate, subtractDay, addDay, hasYScroll, setContent, maybeIgnore, toEventWithLocalDates, toViewWithLocalDates, createEventContent, repositionEvent, height, ancestor, outsideEvent, rect, datesEqual, setMidnight, createDate, debounce, toLocalDate, toISOString, assign, createEventChunk, setFn, eventIntersects, prepareEventChunks, intl } from '@event-calendar/common';
import { cloneDate, subtractDay, addDay, setContent, helperEvent, toEventWithLocalDates, toViewWithLocalDates, createEventContent, previewEvent, repositionEvent, height, ancestor, max, outsideEvent, rect, datesEqual, setMidnight, createDate, debounce, assign, createEventChunk, setPayload, bgEvent, eventIntersects, prepareEventChunks, intl } from '@event-calendar/common';

@@ -36,7 +36,7 @@ function days(state) {

/* packages/day-grid/src/Header.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/Header.svelte generated by Svelte v3.58.0 */
function get_each_context$4(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[8] = list[i];
child_ctx[6] = list[i];
return child_ctx;

@@ -48,3 +48,3 @@ }

let div;
let t_value = /*$_intlDayHeader*/ ctx[3].format(/*day*/ ctx[8]) + "";
let t_value = /*$_intlDayHeader*/ ctx[2].format(/*day*/ ctx[6]) + "";
let t;

@@ -64,3 +64,3 @@ let div_class_value;

p(ctx, dirty) {
if (dirty & /*$_intlDayHeader, $_days*/ 12 && t_value !== (t_value = /*$_intlDayHeader*/ ctx[3].format(/*day*/ ctx[8]) + "")) set_data(t, t_value);
if (dirty & /*$_intlDayHeader, $_days*/ 6 && t_value !== (t_value = /*$_intlDayHeader*/ ctx[2].format(/*day*/ ctx[6]) + "")) set_data(t, t_value);

@@ -85,3 +85,3 @@ if (dirty & /*$theme*/ 1 && div_class_value !== (div_class_value = /*$theme*/ ctx[0].day)) {

let div2_class_value;
let each_value = /*$_days*/ ctx[2];
let each_value = /*$_days*/ ctx[1];
let each_blocks = [];

@@ -106,6 +106,3 @@

attr(div1, "class", div1_class_value = /*$theme*/ ctx[0].hiddenScroll);
attr(div2, "class", div2_class_value = "" + (/*$theme*/ ctx[0].header + (/*$_scrollable*/ ctx[1]
? ' ' + /*$theme*/ ctx[0].withScroll
: '')));
attr(div2, "class", div2_class_value = /*$theme*/ ctx[0].header);
},

@@ -117,3 +114,5 @@ m(target, anchor) {

for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div0, null);
if (each_blocks[i]) {
each_blocks[i].m(div0, null);
}
}

@@ -125,4 +124,4 @@

p(ctx, [dirty]) {
if (dirty & /*$theme, $_intlDayHeader, $_days*/ 13) {
each_value = /*$_days*/ ctx[2];
if (dirty & /*$theme, $_intlDayHeader, $_days*/ 7) {
each_value = /*$_days*/ ctx[1];
let i;

@@ -157,5 +156,3 @@

if (dirty & /*$theme, $_scrollable*/ 3 && div2_class_value !== (div2_class_value = "" + (/*$theme*/ ctx[0].header + (/*$_scrollable*/ ctx[1]
? ' ' + /*$theme*/ ctx[0].withScroll
: '')))) {
if (dirty & /*$theme*/ 1 && div2_class_value !== (div2_class_value = /*$theme*/ ctx[0].header)) {
attr(div2, "class", div2_class_value);

@@ -175,22 +172,10 @@ }

let $theme;
let $_scrollable;
let $_days;
let $_intlDayHeader;
let { theme, _intlDayHeader, _scrollable } = getContext('state');
let { theme, _intlDayHeader } = getContext('state');
component_subscribe($$self, theme, value => $$invalidate(0, $theme = value));
component_subscribe($$self, _intlDayHeader, value => $$invalidate(3, $_intlDayHeader = value));
component_subscribe($$self, _scrollable, value => $$invalidate(1, $_scrollable = value));
component_subscribe($$self, _intlDayHeader, value => $$invalidate(2, $_intlDayHeader = value));
let { _days } = getContext('view-state');
component_subscribe($$self, _days, value => $$invalidate(2, $_days = value));
return [
$theme,
$_scrollable,
$_days,
$_intlDayHeader,
theme,
_intlDayHeader,
_scrollable,
_days
];
component_subscribe($$self, _days, value => $$invalidate(1, $_days = value));
return [$theme, $_days, $_intlDayHeader, theme, _intlDayHeader, _days];
}

@@ -205,3 +190,3 @@

/* packages/day-grid/src/Body.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/Body.svelte generated by Svelte v3.58.0 */

@@ -214,6 +199,4 @@ function create_fragment$5(ctx) {

let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[12].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[11], null);
const default_slot_template = /*#slots*/ ctx[7].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[6], null);

@@ -225,6 +208,6 @@ return {

if (default_slot) default_slot.c();
attr(div0, "class", div0_class_value = /*$theme*/ ctx[1].content);
attr(div0, "class", div0_class_value = /*$theme*/ ctx[0].content);
attr(div1, "class", div1_class_value = "" + (/*$theme*/ ctx[1].body + (/*$dayMaxEvents*/ ctx[2] === true
? ' ' + /*$theme*/ ctx[1].uniform
attr(div1, "class", div1_class_value = "" + (/*$theme*/ ctx[0].body + (/*$dayMaxEvents*/ ctx[1] === true
? ' ' + /*$theme*/ ctx[0].uniform
: '')));

@@ -240,21 +223,8 @@ },

/*div1_binding*/ ctx[13](div1);
/*div1_binding*/ ctx[8](div1);
current = true;
if (!mounted) {
dispose = [
listen(window, "resize", /*recheckScrollable*/ ctx[9]),
listen(div1, "scroll", function () {
if (is_function(/*$_scroll*/ ctx[3])) /*$_scroll*/ ctx[3].apply(this, arguments);
})
];
mounted = true;
}
},
p(new_ctx, [dirty]) {
ctx = new_ctx;
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 2048)) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 64)) {
update_slot_base(

@@ -264,6 +234,6 @@ default_slot,

ctx,
/*$$scope*/ ctx[11],
/*$$scope*/ ctx[6],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[11])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[11], dirty, null),
? get_all_dirty_from_scope(/*$$scope*/ ctx[6])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[6], dirty, null),
null

@@ -274,8 +244,8 @@ );

if (!current || dirty & /*$theme*/ 2 && div0_class_value !== (div0_class_value = /*$theme*/ ctx[1].content)) {
if (!current || dirty & /*$theme*/ 1 && div0_class_value !== (div0_class_value = /*$theme*/ ctx[0].content)) {
attr(div0, "class", div0_class_value);
}
if (!current || dirty & /*$theme, $dayMaxEvents*/ 6 && div1_class_value !== (div1_class_value = "" + (/*$theme*/ ctx[1].body + (/*$dayMaxEvents*/ ctx[2] === true
? ' ' + /*$theme*/ ctx[1].uniform
if (!current || dirty & /*$theme, $dayMaxEvents*/ 3 && div1_class_value !== (div1_class_value = "" + (/*$theme*/ ctx[0].body + (/*$dayMaxEvents*/ ctx[1] === true
? ' ' + /*$theme*/ ctx[0].uniform
: '')))) {

@@ -297,5 +267,3 @@ attr(div1, "class", div1_class_value);

if (default_slot) default_slot.d(detaching);
/*div1_binding*/ ctx[13](null);
mounted = false;
run_all(dispose);
/*div1_binding*/ ctx[8](null);
}

@@ -306,24 +274,15 @@ };

function instance$5($$self, $$props, $$invalidate) {
let $_scrollable;
let $_events;
let $theme;
let $dayMaxEvents;
let $_scroll;
let $_bodyEl;
let { $$slots: slots = {}, $$scope } = $$props;
let { dayMaxEvents, _events, _scrollable, _scroll, theme } = getContext('state');
component_subscribe($$self, dayMaxEvents, value => $$invalidate(2, $dayMaxEvents = value));
component_subscribe($$self, _events, value => $$invalidate(10, $_events = value));
component_subscribe($$self, _scrollable, value => $$invalidate(14, $_scrollable = value));
component_subscribe($$self, _scroll, value => $$invalidate(3, $_scroll = value));
component_subscribe($$self, theme, value => $$invalidate(1, $theme = value));
let el;
let { dayMaxEvents, _bodyEl, theme } = getContext('state');
component_subscribe($$self, dayMaxEvents, value => $$invalidate(1, $dayMaxEvents = value));
component_subscribe($$self, _bodyEl, value => $$invalidate(2, $_bodyEl = value));
component_subscribe($$self, theme, value => $$invalidate(0, $theme = value));
function recheckScrollable() {
set_store_value(_scrollable, $_scrollable = hasYScroll(el), $_scrollable);
}
function div1_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
el = $$value;
$$invalidate(0, el);
$_bodyEl = $$value;
_bodyEl.set($_bodyEl);
});

@@ -333,25 +292,12 @@ }

$$self.$$set = $$props => {
if ('$$scope' in $$props) $$invalidate(11, $$scope = $$props.$$scope);
if ('$$scope' in $$props) $$invalidate(6, $$scope = $$props.$$scope);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*el, $_events*/ 1025) {
if (el && $_events) {
setTimeout(recheckScrollable);
}
}
};
return [
el,
$theme,
$dayMaxEvents,
$_scroll,
$_bodyEl,
dayMaxEvents,
_events,
_scrollable,
_scroll,
_bodyEl,
theme,
recheckScrollable,
$_events,
$$scope,

@@ -370,3 +316,3 @@ slots,

/* packages/day-grid/src/Event.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/Event.svelte generated by Svelte v3.58.0 */

@@ -391,3 +337,3 @@ function create_fragment$4(ctx) {

switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
switch_instance.$on("pointerdown", /*createDragHandler*/ ctx[30](true));
switch_instance.$on("pointerdown", /*createDragHandler*/ ctx[31](true));
}

@@ -410,3 +356,3 @@

if (switch_instance) mount_component(switch_instance, div1, null);
/*div1_binding*/ ctx[45](div1);
/*div1_binding*/ ctx[46](div1);
current = true;

@@ -418,16 +364,12 @@

listen(div1, "click", function () {
if (is_function(maybeIgnore(/*createHandler*/ ctx[29](/*$eventClick*/ ctx[8], /*display*/ ctx[6])))) maybeIgnore(/*createHandler*/ ctx[29](/*$eventClick*/ ctx[8], /*display*/ ctx[6])).apply(this, arguments);
if (is_function(/*createHandler*/ ctx[30](/*$eventClick*/ ctx[8], /*display*/ ctx[6]))) /*createHandler*/ ctx[30](/*$eventClick*/ ctx[8], /*display*/ ctx[6]).apply(this, arguments);
}),
listen(div1, "mouseenter", function () {
if (is_function(/*createHandler*/ ctx[29](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]))) /*createHandler*/ ctx[29](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]).apply(this, arguments);
if (is_function(/*createHandler*/ ctx[30](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]))) /*createHandler*/ ctx[30](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]).apply(this, arguments);
}),
listen(div1, "mouseleave", function () {
if (is_function(/*createHandler*/ ctx[29](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]))) /*createHandler*/ ctx[29](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]).apply(this, arguments);
if (is_function(/*createHandler*/ ctx[30](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]))) /*createHandler*/ ctx[30](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]).apply(this, arguments);
}),
listen(div1, "pointerdown", function () {
if (is_function(/*display*/ ctx[6] === 'auto' && /*$_draggable*/ ctx[11](/*event*/ ctx[0])
? /*createDragHandler*/ ctx[30]()
: undefined)) (/*display*/ ctx[6] === 'auto' && /*$_draggable*/ ctx[11](/*event*/ ctx[0])
? /*createDragHandler*/ ctx[30]()
: undefined).apply(this, arguments);
if (is_function(!helperEvent(/*display*/ ctx[6]) && /*$_draggable*/ ctx[11](/*event*/ ctx[0]) && /*createDragHandler*/ ctx[31]())) (!helperEvent(/*display*/ ctx[6]) && /*$_draggable*/ ctx[11](/*event*/ ctx[0]) && /*createDragHandler*/ ctx[31]()).apply(this, arguments);
})

@@ -450,3 +392,3 @@ ];

if (switch_value !== (switch_value = /*$_interaction*/ ctx[7].resizer)) {
if (dirty[0] & /*$_interaction*/ 128 && switch_value !== (switch_value = /*$_interaction*/ ctx[7].resizer)) {
if (switch_instance) {

@@ -465,3 +407,3 @@ group_outros();

switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
switch_instance.$on("pointerdown", /*createDragHandler*/ ctx[30](true));
switch_instance.$on("pointerdown", /*createDragHandler*/ ctx[31](true));
create_component(switch_instance.$$.fragment);

@@ -497,3 +439,3 @@ transition_in(switch_instance.$$.fragment, 1);

if (switch_instance) destroy_component(switch_instance);
/*div1_binding*/ ctx[45](null);
/*div1_binding*/ ctx[46](null);
mounted = false;

@@ -508,2 +450,3 @@ run_all(dispose);

let $dayMaxEvents;
let $_popupDate;
let $_interaction;

@@ -528,20 +471,21 @@ let $_view;

let { dayMaxEvents, displayEventEnd, eventBackgroundColor, eventClick, eventColor, eventContent, eventDidMount, eventMouseEnter, eventMouseLeave, theme, _view, _intlEventTime, _interaction, _classes, _draggable, _resBgColor } = getContext('state');
component_subscribe($$self, dayMaxEvents, value => $$invalidate(48, $dayMaxEvents = value));
component_subscribe($$self, displayEventEnd, value => $$invalidate(40, $displayEventEnd = value));
component_subscribe($$self, eventBackgroundColor, value => $$invalidate(43, $eventBackgroundColor = value));
component_subscribe($$self, dayMaxEvents, value => $$invalidate(49, $dayMaxEvents = value));
component_subscribe($$self, displayEventEnd, value => $$invalidate(41, $displayEventEnd = value));
component_subscribe($$self, eventBackgroundColor, value => $$invalidate(44, $eventBackgroundColor = value));
component_subscribe($$self, eventClick, value => $$invalidate(8, $eventClick = value));
component_subscribe($$self, eventColor, value => $$invalidate(42, $eventColor = value));
component_subscribe($$self, eventContent, value => $$invalidate(39, $eventContent = value));
component_subscribe($$self, eventDidMount, value => $$invalidate(49, $eventDidMount = value));
component_subscribe($$self, eventColor, value => $$invalidate(43, $eventColor = value));
component_subscribe($$self, eventContent, value => $$invalidate(40, $eventContent = value));
component_subscribe($$self, eventDidMount, value => $$invalidate(51, $eventDidMount = value));
component_subscribe($$self, eventMouseEnter, value => $$invalidate(9, $eventMouseEnter = value));
component_subscribe($$self, eventMouseLeave, value => $$invalidate(10, $eventMouseLeave = value));
component_subscribe($$self, theme, value => $$invalidate(1, $theme = value));
component_subscribe($$self, _view, value => $$invalidate(37, $_view = value));
component_subscribe($$self, _intlEventTime, value => $$invalidate(38, $_intlEventTime = value));
component_subscribe($$self, _view, value => $$invalidate(38, $_view = value));
component_subscribe($$self, _intlEventTime, value => $$invalidate(39, $_intlEventTime = value));
component_subscribe($$self, _interaction, value => $$invalidate(7, $_interaction = value));
component_subscribe($$self, _classes, value => $$invalidate(41, $_classes = value));
component_subscribe($$self, _classes, value => $$invalidate(42, $_classes = value));
component_subscribe($$self, _draggable, value => $$invalidate(11, $_draggable = value));
component_subscribe($$self, _resBgColor, value => $$invalidate(44, $_resBgColor = value));
let { _hiddenEvents } = getContext('view-state');
component_subscribe($$self, _hiddenEvents, value => $$invalidate(47, $_hiddenEvents = value));
component_subscribe($$self, _resBgColor, value => $$invalidate(45, $_resBgColor = value));
let { _hiddenEvents, _popupDate } = getContext('view-state');
component_subscribe($$self, _hiddenEvents, value => $$invalidate(48, $_hiddenEvents = value));
component_subscribe($$self, _popupDate, value => $$invalidate(50, $_popupDate = value));
let el;

@@ -569,3 +513,3 @@ let event;

function createHandler(fn, display) {
return display !== 'preview' && is_function(fn)
return !helperEvent(display) && is_function(fn)
? jsEvent => fn({

@@ -581,11 +525,11 @@ event: toEventWithLocalDates(event),

function createDragHandler(resize) {
return jsEvent => $_interaction.action.dragDayGrid(event, el, jsEvent, inPopup, resize);
return jsEvent => $_interaction.action.drag(event, jsEvent, resize, inPopup ? $_popupDate : undefined);
}
function reposition() {
if (!el || display === 'preview' || inPopup) {
if (!el || previewEvent(display) || inPopup) {
return;
}
$$invalidate(35, margin = repositionEvent(chunk, longChunks, height(el)));
$$invalidate(36, margin = repositionEvent(chunk, longChunks, height(el)));

@@ -595,3 +539,3 @@ if ($dayMaxEvents === true) {

} else {
$$invalidate(36, hidden = false);
$$invalidate(37, hidden = false);
}

@@ -603,3 +547,3 @@ }

let h = height(dayEl) - height(dayEl.firstElementChild) - footHeight(dayEl);
$$invalidate(36, hidden = chunk.bottom > h);
$$invalidate(37, hidden = chunk.bottom > h);
let update = false;

@@ -635,3 +579,3 @@

for (let i = 0; i < chunk.days; ++i) {
h = Math.max(h, height(dayEl.lastElementChild));
h = max(h, height(dayEl.lastElementChild));
dayEl = dayEl.nextElementSibling;

@@ -655,13 +599,13 @@

$$self.$$set = $$props => {
if ('chunk' in $$props) $$invalidate(31, chunk = $$props.chunk);
if ('longChunks' in $$props) $$invalidate(32, longChunks = $$props.longChunks);
if ('inPopup' in $$props) $$invalidate(33, inPopup = $$props.inPopup);
if ('chunk' in $$props) $$invalidate(32, chunk = $$props.chunk);
if ('longChunks' in $$props) $$invalidate(33, longChunks = $$props.longChunks);
if ('inPopup' in $$props) $$invalidate(34, inPopup = $$props.inPopup);
};
$$self.$$.update = () => {
if ($$self.$$.dirty[1] & /*chunk*/ 1) {
if ($$self.$$.dirty[1] & /*chunk*/ 2) {
$$invalidate(0, event = chunk.event);
}
if ($$self.$$.dirty[0] & /*event, style, $theme*/ 19 | $$self.$$.dirty[1] & /*$_resBgColor, $eventBackgroundColor, $eventColor, chunk, margin, hidden, $_classes*/ 15409) {
if ($$self.$$.dirty[0] & /*event, style, $theme*/ 19 | $$self.$$.dirty[1] & /*$_resBgColor, $eventBackgroundColor, $eventColor, chunk, margin, hidden, $_classes*/ 30818) {
{

@@ -687,3 +631,3 @@ $$invalidate(6, display = event.display);

if ($$self.$$.dirty[0] & /*$theme*/ 2 | $$self.$$.dirty[1] & /*chunk, $displayEventEnd, $eventContent, $_intlEventTime, $_view*/ 961) {
if ($$self.$$.dirty[0] & /*$theme*/ 2 | $$self.$$.dirty[1] & /*chunk, $displayEventEnd, $eventContent, $_intlEventTime, $_view*/ 1922) {
// Content

@@ -724,2 +668,3 @@ $$invalidate(5, [timeText, content] = createEventContent(chunk, $displayEventEnd, $eventContent, $theme, $_intlEventTime, $_view), content);

_hiddenEvents,
_popupDate,
createHandler,

@@ -756,6 +701,6 @@ createDragHandler,

{
chunk: 31,
longChunks: 32,
inPopup: 33,
reposition: 34
chunk: 32,
longChunks: 33,
inPopup: 34,
reposition: 35
},

@@ -768,7 +713,7 @@ null,

get reposition() {
return this.$$.ctx[34];
return this.$$.ctx[35];
}
}
/* packages/day-grid/src/Popup.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/Popup.svelte generated by Svelte v3.58.0 */

@@ -882,3 +827,5 @@ function get_each_context$3(ctx, list, i) {

for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div1, null);
if (each_blocks[i]) {
each_blocks[i].m(div1, null);
}
}

@@ -957,3 +904,3 @@

function instance$3($$self, $$props, $$invalidate) {
let $_ignoreClick;
let $_interaction;
let $_popupDate;

@@ -963,5 +910,5 @@ let $_popupChunks;

let $_intlDayPopover;
let { theme, _ignoreClick, _intlDayPopover } = getContext('state');
let { theme, _interaction, _intlDayPopover } = getContext('state');
component_subscribe($$self, theme, value => $$invalidate(4, $theme = value));
component_subscribe($$self, _ignoreClick, value => $$invalidate(15, $_ignoreClick = value));
component_subscribe($$self, _interaction, value => $$invalidate(15, $_interaction = value));
component_subscribe($$self, _intlDayPopover, value => $$invalidate(5, $_intlDayPopover = value));

@@ -1031,3 +978,3 @@ let { _popupDate, _popupChunks } = getContext('view-state');

close();
set_store_value(_ignoreClick, $_ignoreClick = true, $_ignoreClick);
$_interaction.action?.noClick();
}

@@ -1063,3 +1010,3 @@

theme,
_ignoreClick,
_interaction,
_intlDayPopover,

@@ -1082,13 +1029,13 @@ _popupDate,

/* packages/day-grid/src/Day.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/Day.svelte generated by Svelte v3.58.0 */
function get_each_context$2(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[48] = list[i];
child_ctx[49] = list;
child_ctx[50] = i;
child_ctx[42] = list[i];
child_ctx[43] = list;
child_ctx[44] = i;
return child_ctx;
}
// (141:4) {#if iChunks[1] && datesEqual(iChunks[1].date, date)}
// (127:4) {#if iChunks[1] && datesEqual(iChunks[1].date, date)}
function create_if_block_3(ctx) {

@@ -1137,3 +1084,3 @@ let div;

// (147:4) {#if iChunks[0] && datesEqual(iChunks[0].date, date)}
// (133:4) {#if iChunks[0] && datesEqual(iChunks[0].date, date)}
function create_if_block_2(ctx) {

@@ -1182,13 +1129,13 @@ let div;

// (153:8) {#each dayChunks as chunk, i (chunk.event)}
// (139:8) {#each dayChunks as chunk, i (chunk.event)}
function create_each_block$2(key_1, ctx) {
let first;
let event;
let i = /*i*/ ctx[50];
let i = /*i*/ ctx[44];
let current;
const assign_event = () => /*event_binding*/ ctx[39](event, i);
const unassign_event = () => /*event_binding*/ ctx[39](null, i);
const assign_event = () => /*event_binding*/ ctx[34](event, i);
const unassign_event = () => /*event_binding*/ ctx[34](null, i);
let event_props = {
chunk: /*chunk*/ ctx[48],
chunk: /*chunk*/ ctx[42],
longChunks: /*longChunks*/ ctx[1]

@@ -1216,5 +1163,5 @@ };

if (i !== /*i*/ ctx[50]) {
if (i !== /*i*/ ctx[44]) {
unassign_event();
i = /*i*/ ctx[50];
i = /*i*/ ctx[44];
assign_event();

@@ -1224,3 +1171,3 @@ }

const event_changes = {};
if (dirty[0] & /*dayChunks*/ 16) event_changes.chunk = /*chunk*/ ctx[48];
if (dirty[0] & /*dayChunks*/ 16) event_changes.chunk = /*chunk*/ ctx[42];
if (dirty[0] & /*longChunks*/ 2) event_changes.longChunks = /*longChunks*/ ctx[1];

@@ -1246,3 +1193,3 @@ event.$set(event_changes);

// (157:4) {#if showPopup}
// (143:4) {#if showPopup}
function create_if_block_1(ctx) {

@@ -1276,3 +1223,3 @@ let popup;

// (161:8) {#if hiddenEvents.size}
// (147:8) {#if hiddenEvents.size}
function create_if_block(ctx) {

@@ -1293,4 +1240,4 @@ let a;

dispose = [
listen(a, "click", stop_propagation(/*showMore*/ ctx[29])),
listen(a, "pointerdown", stop_propagation(/*pointerdown_handler*/ ctx[38])),
listen(a, "click", stop_propagation(/*showMore*/ ctx[25])),
listen(a, "pointerdown", stop_propagation(/*pointerdown_handler*/ ctx[33])),
action_destroyer(setContent_action = setContent.call(null, a, /*moreLink*/ ctx[6]))

@@ -1339,3 +1286,3 @@ ];

let each_value = /*dayChunks*/ ctx[4];
const get_key = ctx => /*chunk*/ ctx[48].event;
const get_key = ctx => /*chunk*/ ctx[42].event;

@@ -1394,3 +1341,5 @@ for (let i = 0; i < each_value.length; i += 1) {

for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div1, null);
if (each_blocks[i]) {
each_blocks[i].m(div1, null);
}
}

@@ -1403,3 +1352,3 @@

if (if_block3) if_block3.m(div2, null);
/*div3_binding*/ ctx[40](div3);
/*div3_binding*/ ctx[35](div3);
current = true;

@@ -1409,14 +1358,11 @@

dispose = [
listen(window, "resize", /*reposition*/ ctx[31]),
listen(div3, "click", function () {
if (is_function(maybeIgnore(/*createClickHandler*/ ctx[27](/*$dateClick*/ ctx[13])))) maybeIgnore(/*createClickHandler*/ ctx[27](/*$dateClick*/ ctx[13])).apply(this, arguments);
}),
listen(window, "resize", /*reposition*/ ctx[26]),
listen(div3, "pointerenter", function () {
if (is_function(/*createPointerEnterHandler*/ ctx[28](/*$_interaction*/ ctx[14]))) /*createPointerEnterHandler*/ ctx[28](/*$_interaction*/ ctx[14]).apply(this, arguments);
if (is_function(/*createPointerEnterHandler*/ ctx[24](/*$_interaction*/ ctx[13]))) /*createPointerEnterHandler*/ ctx[24](/*$_interaction*/ ctx[13]).apply(this, arguments);
}),
listen(div3, "pointerleave", function () {
if (is_function(createPointerLeaveHandler(/*$_interaction*/ ctx[14]))) createPointerLeaveHandler(/*$_interaction*/ ctx[14]).apply(this, arguments);
if (is_function(createPointerLeaveHandler(/*$_interaction*/ ctx[13]))) createPointerLeaveHandler(/*$_interaction*/ ctx[13]).apply(this, arguments);
}),
listen(div3, "pointerdown", function () {
if (is_function(/*createPointerDownHandler*/ ctx[30](/*$_interaction*/ ctx[14], /*$selectable*/ ctx[15]))) /*createPointerDownHandler*/ ctx[30](/*$_interaction*/ ctx[14], /*$selectable*/ ctx[15]).apply(this, arguments);
if (is_function(createPointerDownHandler(/*$_interaction*/ ctx[13], /*$selectable*/ ctx[14]))) createPointerDownHandler(/*$_interaction*/ ctx[13], /*$selectable*/ ctx[14]).apply(this, arguments);
})

@@ -1577,3 +1523,3 @@ ];

if (if_block3) if_block3.d();
/*div3_binding*/ ctx[40](null);
/*div3_binding*/ ctx[35](null);
mounted = false;

@@ -1591,2 +1537,8 @@ run_all(dispose);

function createPointerDownHandler(interaction, selectable) {
return selectable && interaction.action
? interaction.action.select
: undefined;
}
function instance$2($$self, $$props, $$invalidate) {

@@ -1596,3 +1548,2 @@ let $_hiddenEvents;

let $_popupDate;
let $_view;
let $moreLinkContent;

@@ -1602,3 +1553,2 @@ let $highlightedDates;

let $theme;
let $dateClick;
let $_interaction;

@@ -1610,15 +1560,13 @@ let $selectable;

let { iChunks = [] } = $$props;
let { date: currentDate, dateClick, dayMaxEvents, highlightedDates, moreLinkContent, theme, _view, _interaction, selectable, _queue } = getContext('state');
component_subscribe($$self, currentDate, value => $$invalidate(37, $currentDate = value));
component_subscribe($$self, dateClick, value => $$invalidate(13, $dateClick = value));
component_subscribe($$self, highlightedDates, value => $$invalidate(36, $highlightedDates = value));
component_subscribe($$self, moreLinkContent, value => $$invalidate(35, $moreLinkContent = value));
let { date: currentDate, dayMaxEvents, highlightedDates, moreLinkContent, theme, _interaction, selectable, _queue } = getContext('state');
component_subscribe($$self, currentDate, value => $$invalidate(32, $currentDate = value));
component_subscribe($$self, highlightedDates, value => $$invalidate(31, $highlightedDates = value));
component_subscribe($$self, moreLinkContent, value => $$invalidate(30, $moreLinkContent = value));
component_subscribe($$self, theme, value => $$invalidate(12, $theme = value));
component_subscribe($$self, _view, value => $$invalidate(42, $_view = value));
component_subscribe($$self, _interaction, value => $$invalidate(14, $_interaction = value));
component_subscribe($$self, selectable, value => $$invalidate(15, $selectable = 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(33, $_hiddenEvents = value));
component_subscribe($$self, _popupDate, value => $$invalidate(34, $_popupDate = value));
component_subscribe($$self, _popupChunks, value => $$invalidate(41, $_popupChunks = value));
component_subscribe($$self, _hiddenEvents, value => $$invalidate(28, $_hiddenEvents = value));
component_subscribe($$self, _popupDate, value => $$invalidate(29, $_popupDate = value));
component_subscribe($$self, _popupChunks, value => $$invalidate(36, $_popupChunks = value));
let el;

@@ -1635,15 +1583,2 @@ let dayChunks;

function createClickHandler(fn) {
return is_function(fn)
? jsEvent => fn({
allDay: true,
date: toLocalDate(date),
dateStr: toISOString(date),
dayEl: el,
jsEvent,
view: toViewWithLocalDates($_view)
})
: undefined;
}
function createPointerEnterHandler(interaction) {

@@ -1665,8 +1600,2 @@ return interaction.pointer

function createPointerDownHandler(interaction, selectable) {
return selectable && interaction.action
? jsEvent => interaction.action.selectDayGrid(date, el, jsEvent)
: undefined;
}
function reposition() {

@@ -1703,3 +1632,3 @@ $$invalidate(11, refs.length = dayChunks.length, refs);

if ('date' in $$props) $$invalidate(0, date = $$props.date);
if ('chunks' in $$props) $$invalidate(32, chunks = $$props.chunks);
if ('chunks' in $$props) $$invalidate(27, chunks = $$props.chunks);
if ('longChunks' in $$props) $$invalidate(1, longChunks = $$props.longChunks);

@@ -1710,7 +1639,7 @@ if ('iChunks' in $$props) $$invalidate(2, iChunks = $$props.iChunks);

$$self.$$.update = () => {
if ($$self.$$.dirty[0] & /*hiddenEvents, date, dayChunks*/ 49 | $$self.$$.dirty[1] & /*chunks*/ 2) {
if ($$self.$$.dirty[0] & /*hiddenEvents, chunks, date, dayChunks*/ 134217777) {
{
$$invalidate(4, dayChunks = []);
hiddenEvents.clear();
((($$invalidate(5, hiddenEvents), $$invalidate(32, chunks)), $$invalidate(0, date)), $$invalidate(4, dayChunks));
((($$invalidate(5, hiddenEvents), $$invalidate(27, chunks)), $$invalidate(0, date)), $$invalidate(4, dayChunks));

@@ -1730,3 +1659,3 @@ for (let chunk of chunks) {

if ($$self.$$.dirty[0] & /*date*/ 1 | $$self.$$.dirty[1] & /*$currentDate, $highlightedDates*/ 96) {
if ($$self.$$.dirty[0] & /*date*/ 1 | $$self.$$.dirty[1] & /*$currentDate, $highlightedDates*/ 3) {
{

@@ -1739,3 +1668,3 @@ $$invalidate(8, isToday = datesEqual(date, today));

if ($$self.$$.dirty[0] & /*hiddenEvents, moreLink*/ 96 | $$self.$$.dirty[1] & /*$_hiddenEvents, $moreLinkContent*/ 20) {
if ($$self.$$.dirty[0] & /*$_hiddenEvents, hiddenEvents, $moreLinkContent, moreLink*/ 1342177376) {
if ($_hiddenEvents && hiddenEvents.size) {

@@ -1759,3 +1688,3 @@ // make Svelte update this block on $_hiddenEvents update

if ($$self.$$.dirty[0] & /*date*/ 1 | $$self.$$.dirty[1] & /*$_popupDate*/ 8) {
if ($$self.$$.dirty[0] & /*$_popupDate, date*/ 536870913) {
$$invalidate(7, showPopup = $_popupDate && datesEqual(date, $_popupDate));

@@ -1774,7 +1703,12 @@ }

if (el) {
setFn(el, () => date);
setPayload(el, () => ({
allDay: true,
date,
resource: undefined,
dayEl: el
}));
}
}
if ($$self.$$.dirty[1] & /*$_hiddenEvents*/ 4) {
if ($$self.$$.dirty[0] & /*$_hiddenEvents*/ 268435456) {
if ($_hiddenEvents) {

@@ -1800,11 +1734,8 @@ debounce(reposition, debounceHandle, _queue);

$theme,
$dateClick,
$_interaction,
$selectable,
currentDate,
dateClick,
highlightedDates,
moreLinkContent,
theme,
_view,
_interaction,

@@ -1815,6 +1746,4 @@ selectable,

_popupChunks,
createClickHandler,
createPointerEnterHandler,
showMore,
createPointerDownHandler,
reposition,

@@ -1845,3 +1774,3 @@ chunks,

date: 0,
chunks: 32,
chunks: 27,
longChunks: 1,

@@ -1856,3 +1785,3 @@ iChunks: 2

/* packages/day-grid/src/Week.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/Week.svelte generated by Svelte v3.58.0 */

@@ -1939,3 +1868,5 @@ function get_each_context$1(ctx, list, i) {

for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div, null);
if (each_blocks[i]) {
each_blocks[i].m(div, null);
}
}

@@ -2034,3 +1965,3 @@

for (let event of $_events) {
if (event.display !== 'background' && eventIntersects(event, start, end)) {
if (!bgEvent(event.display) && eventIntersects(event, start, end)) {
let chunk = createEventChunk(event, start, end);

@@ -2086,3 +2017,3 @@ chunks.push(chunk);

/* packages/day-grid/src/View.svelte generated by Svelte v3.55.1 */
/* packages/day-grid/src/View.svelte generated by Svelte v3.58.0 */

@@ -2154,3 +2085,5 @@ function get_each_context(ctx, list, i) {

for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
if (each_blocks[i]) {
each_blocks[i].m(target, anchor);
}
}

@@ -2345,3 +2278,2 @@

duration: {months: 1},
monthMode: true,
titleFormat: {year: 'numeric', month: 'long'}

@@ -2348,0 +2280,0 @@ };

{
"name": "@event-calendar/day-grid",
"version": "0.19.0",
"version": "1.0.0",
"title": "Event Calendar DayGrid plugin",

@@ -39,5 +39,5 @@ "description": "Full-sized drag & drop event calendar with resource view",

"dependencies": {
"@event-calendar/common": "~0.19.0",
"@event-calendar/common": "~1.0.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 (38kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
* Lightweight (34kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
* Zero-dependency (pre-built bundle)

@@ -72,8 +72,7 @@ * Used on over 60,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/)

- [longPressDelay](#longpressdelay)
- [monthMode](#monthmode)
- [moreLinkContent](#morelinkcontent)
- [noEventsClick](#noeventsclick)
- [noEventsContent](#noeventscontent)
</td><td>
- [noEventsContent](#noeventscontent)
- [nowIndicator](#nowindicator)

@@ -198,4 +197,4 @@ - [pointer](#pointer)

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.19.0/event-calendar.min.css">
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.19.0/event-calendar.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.0.0/event-calendar.min.css">
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.0.0/event-calendar.min.js"></script>
```

@@ -304,2 +303,3 @@

- Default `undefined`
- Requires `Interaction` plugin

@@ -334,3 +334,3 @@ Callback function that is triggered when the user clicks on a date or a time.

`true` or `false`. Determines if the click has occurred in the `all-day` slot. Clicks in month and list views are treated as all-day too</td>
`true` or `false`. Determines if the click has occurred in the `all-day` slot. Month and list views are also considered as all-day slots</td>
</tr>

@@ -1433,10 +1433,2 @@ <tr>

### monthMode
- Type `boolean`
- Default `false`
> Views override the default value as follows:
> - dayGridMonth `true`
Tells the calendar that visible dates should start from the [firstDay](#firstday) of the week, even if it will display days outside the current range (this is a common case for a month calendar when you can see days from adjacent months).
### moreLinkContent

@@ -1797,3 +1789,3 @@ - Type `string`, `object`or `function`

- Type `object` or `function`
- Default `{active: 'ec-active', allDay: 'ec-all-day', bgEvent: 'ec-bg-event', bgEvents: 'ec-bg-events', body: 'ec-body', button: 'ec-button', buttonGroup: 'ec-button-group', calendar: 'ec', compact: 'ec-compact', content: 'ec-content', day: 'ec-day', dayFoot: 'ec-day-foot', dayHead: 'ec-day-head', daySide: 'ec-day-side', days: 'ec-days', draggable: 'ec-draggable', dragging: 'ec-dragging', event: 'ec-event', eventBody: 'ec-event-body', eventTag: 'ec-event-tag', eventTime: 'ec-event-time', eventTitle: 'ec-event-title', events: 'ec-events', extra: 'ec-extra', ghost: 'ec-ghost', handle: 'ec-handle', header: 'ec-header', hiddenScroll: 'ec-hidden-scroll', hiddenTimes: 'ec-hidden-times', highlight: 'ec-highlight', icon: 'ec-icon', line: 'ec-line', lines: 'ec-lines', list: 'ec-list', month: 'ec-month', noEvents: 'ec-no-events', nowIndicator: 'ec-now-indicator', otherMonth: 'ec-other-month', pointer: 'ec-pointer', popup: 'ec-popup', preview: 'ec-preview', resizer: 'ec-resizer', resizingX: 'ec-resizing-x', resizingY: 'ec-resizing-y', resource: 'ec-resource', resourceTitle: 'ec-resource-title', selecting: 'ec-selecting', sidebar: 'ec-sidebar', sidebarTitle: 'ec-sidebar-title', time: 'ec-time', title: 'ec-title', today: 'ec-today', toolbar: 'ec-toolbar', uniform: 'ec-uniform', week: 'ec-week', withScroll: 'ec-with-scroll'}`
- Default `{active: 'ec-active', allDay: 'ec-all-day', bgEvent: 'ec-bg-event', bgEvents: 'ec-bg-events', body: 'ec-body', button: 'ec-button', buttonGroup: 'ec-button-group', calendar: 'ec', compact: 'ec-compact', content: 'ec-content', day: 'ec-day', dayFoot: 'ec-day-foot', dayHead: 'ec-day-head', daySide: 'ec-day-side', days: 'ec-days', draggable: 'ec-draggable', dragging: 'ec-dragging', event: 'ec-event', eventBody: 'ec-event-body', eventTag: 'ec-event-tag', eventTime: 'ec-event-time', eventTitle: 'ec-event-title', events: 'ec-events', extra: 'ec-extra', ghost: 'ec-ghost', handle: 'ec-handle', header: 'ec-header', hiddenScroll: 'ec-hidden-scroll', highlight: 'ec-highlight', icon: 'ec-icon', line: 'ec-line', lines: 'ec-lines', list: 'ec-list', month: 'ec-month', noEvents: 'ec-no-events', nowIndicator: 'ec-now-indicator', otherMonth: 'ec-other-month', pointer: 'ec-pointer', popup: 'ec-popup', preview: 'ec-preview', resizer: 'ec-resizer', resizingX: 'ec-resizing-x', resizingY: 'ec-resizing-y', resource: 'ec-resource', resourceTitle: 'ec-resource-title', selecting: 'ec-selecting', sidebar: 'ec-sidebar', sidebarTitle: 'ec-sidebar-title', time: 'ec-time', title: 'ec-title', today: 'ec-today', toolbar: 'ec-toolbar', uniform: 'ec-uniform', week: 'ec-week', withScroll: 'ec-with-scroll'}`

@@ -2029,6 +2021,43 @@ Defines the CSS classes that the Event Calendar uses to generate HTML markup.

### dateFromPoint( x, y )
- Return value `Date` or `null`
- Return value `object` or `null`
Returns the date and time as if the [dateClick](#dateclick) event had fired for that point.
Returns an `info` object with data as if the [dateClick](#dateclick) event had fired for that point.
`info` object contains the following properties:
<table>
<tr>
<td>
`date`
</td>
<td>JavaScript Date object for the date and time</td>
</tr>
<tr>
<td>
`allDay`
</td>
<td>
`true` or `false`. Determines if the point is in the `all-day` slot. Month and list views are also considered as all-day slots</td>
</tr>
<tr>
<td>
`dayEl`
</td>
<td>HTML element that represents the whole-day that contains the point</td>
</tr>
<tr>
<td>
`resource`
</td>
<td>
If the current view is a resource view, the [Resource](#resource-object) object that owns this date
</td>
</tr>
</table>
Using this method, you can, for example, find out on which day a click occurred inside a multi-day event. To do this, inside [eventClick](#eventclick), pass the `jsEvent.clientX` and `jsEvent.clientY` coordinates to `dateFromPoint` and get the desired date.

@@ -2035,0 +2064,0 @@

@@ -21,3 +21,2 @@ import View from './View.svelte';

duration: {months: 1},
monthMode: true,
titleFormat: {year: 'numeric', month: 'long'}

@@ -24,0 +23,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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc