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 1.4.1 to 1.5.0

158

index.js

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

import { derived, writable } from 'svelte/store';
import { cloneDate, subtractDay, addDay, setContent, helperEvent, toEventWithLocalDates, toViewWithLocalDates, createEventClasses, createEventContent, previewEvent, repositionEvent, height, ancestor, max, outsideEvent, rect, datesEqual, setMidnight, createDate, debounce, assign, createEventChunk, setPayload, bgEvent, eventIntersects, prepareEventChunks, intl } from '@event-calendar/core';
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, is_function, create_component, mount_component, action_destroyer, listen, 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, 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/core';
import { getContext, onMount, tick, afterUpdate } from 'svelte';

@@ -27,11 +27,2 @@ function days(state) {

class State {
constructor(state) {
this._days = days(state);
this._hiddenEvents = writable({});
this._popupDate = writable(null);
this._popupChunks = writable([]);
}
}
/* packages/day-grid/src/Header.svelte generated by Svelte v3.59.1 */

@@ -45,3 +36,3 @@

// (10:8) {#each $_days as day}
// (9:8) {#each $_days as day}
function create_each_block$4(ctx) {

@@ -168,6 +159,5 @@ let div;

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

@@ -323,3 +313,3 @@ return [$theme, $_days, $_intlDayHeader, theme, _intlDayHeader, _days];

switch_instance.$on("pointerdown", function () {
if (is_function(/*createDragHandler*/ ctx[31](/*$_interaction*/ ctx[7], true))) /*createDragHandler*/ ctx[31](/*$_interaction*/ ctx[7], true).apply(this, arguments);
if (is_function(/*createDragHandler*/ ctx[32](/*$_interaction*/ ctx[7], true))) /*createDragHandler*/ ctx[32](/*$_interaction*/ ctx[7], true).apply(this, arguments);
});

@@ -343,3 +333,3 @@ }

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

@@ -351,12 +341,12 @@

listen(div1, "click", function () {
if (is_function(/*createHandler*/ ctx[30](/*$eventClick*/ ctx[8], /*display*/ ctx[6]))) /*createHandler*/ ctx[30](/*$eventClick*/ ctx[8], /*display*/ ctx[6]).apply(this, arguments);
if (is_function(/*createHandler*/ ctx[31](/*$eventClick*/ ctx[8], /*display*/ ctx[6]))) /*createHandler*/ ctx[31](/*$eventClick*/ ctx[8], /*display*/ ctx[6]).apply(this, arguments);
}),
listen(div1, "mouseenter", function () {
if (is_function(/*createHandler*/ ctx[30](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]))) /*createHandler*/ ctx[30](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]).apply(this, arguments);
if (is_function(/*createHandler*/ ctx[31](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]))) /*createHandler*/ ctx[31](/*$eventMouseEnter*/ ctx[9], /*display*/ ctx[6]).apply(this, arguments);
}),
listen(div1, "mouseleave", function () {
if (is_function(/*createHandler*/ ctx[30](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]))) /*createHandler*/ ctx[30](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]).apply(this, arguments);
if (is_function(/*createHandler*/ ctx[31](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]))) /*createHandler*/ ctx[31](/*$eventMouseLeave*/ ctx[10], /*display*/ ctx[6]).apply(this, arguments);
}),
listen(div1, "pointerdown", function () {
if (is_function(!helperEvent(/*display*/ ctx[6]) && /*createDragHandler*/ ctx[31](/*$_interaction*/ ctx[7]))) (!helperEvent(/*display*/ ctx[6]) && /*createDragHandler*/ ctx[31](/*$_interaction*/ ctx[7])).apply(this, arguments);
if (is_function(!helperEvent(/*display*/ ctx[6]) && /*createDragHandler*/ ctx[32](/*$_interaction*/ ctx[7]))) (!helperEvent(/*display*/ ctx[6]) && /*createDragHandler*/ ctx[32](/*$_interaction*/ ctx[7])).apply(this, arguments);
})

@@ -395,3 +385,3 @@ ];

switch_instance.$on("pointerdown", function () {
if (is_function(/*createDragHandler*/ ctx[31](/*$_interaction*/ ctx[7], true))) /*createDragHandler*/ ctx[31](/*$_interaction*/ ctx[7], true).apply(this, arguments);
if (is_function(/*createDragHandler*/ ctx[32](/*$_interaction*/ ctx[7], true))) /*createDragHandler*/ ctx[32](/*$_interaction*/ ctx[7], true).apply(this, arguments);
});

@@ -429,3 +419,3 @@

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

@@ -448,3 +438,4 @@ run_all(dispose);

let $displayEventEnd;
let $_classes;
let $eventClassNames;
let $_iClasses;
let $eventTextColor;

@@ -461,23 +452,23 @@ let $_resTxtColor;

let { inPopup = false } = $$props;
let { dayMaxEvents, displayEventEnd, eventBackgroundColor, eventTextColor, eventClick, eventColor, eventContent, eventDidMount, eventMouseEnter, eventMouseLeave, theme, _view, _intlEventTime, _interaction, _classes, _draggable, _resBgColor, _resTxtColor } = getContext('state');
component_subscribe($$self, dayMaxEvents, value => $$invalidate(51, $dayMaxEvents = value));
component_subscribe($$self, displayEventEnd, value => $$invalidate(41, $displayEventEnd = value));
component_subscribe($$self, eventBackgroundColor, value => $$invalidate(46, $eventBackgroundColor = value));
component_subscribe($$self, eventTextColor, value => $$invalidate(43, $eventTextColor = value));
let { dayMaxEvents, displayEventEnd, eventBackgroundColor, eventTextColor, eventClick, eventColor, eventContent, eventClassNames, eventDidMount, eventMouseEnter, eventMouseLeave, theme, _view, _intlEventTime, _interaction, _iClasses, _resBgColor, _resTxtColor, _hiddenEvents, _popupDate } = getContext('state');
component_subscribe($$self, dayMaxEvents, value => $$invalidate(53, $dayMaxEvents = value));
component_subscribe($$self, displayEventEnd, value => $$invalidate(42, $displayEventEnd = value));
component_subscribe($$self, eventBackgroundColor, value => $$invalidate(48, $eventBackgroundColor = value));
component_subscribe($$self, eventTextColor, value => $$invalidate(45, $eventTextColor = value));
component_subscribe($$self, eventClick, value => $$invalidate(8, $eventClick = value));
component_subscribe($$self, eventColor, value => $$invalidate(45, $eventColor = value));
component_subscribe($$self, eventContent, value => $$invalidate(40, $eventContent = value));
component_subscribe($$self, eventDidMount, value => $$invalidate(53, $eventDidMount = value));
component_subscribe($$self, eventColor, value => $$invalidate(47, $eventColor = value));
component_subscribe($$self, eventContent, value => $$invalidate(41, $eventContent = value));
component_subscribe($$self, eventClassNames, value => $$invalidate(43, $eventClassNames = value));
component_subscribe($$self, eventDidMount, value => $$invalidate(55, $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(38, $_view = value));
component_subscribe($$self, _intlEventTime, value => $$invalidate(39, $_intlEventTime = value));
component_subscribe($$self, _view, value => $$invalidate(39, $_view = value));
component_subscribe($$self, _intlEventTime, value => $$invalidate(40, $_intlEventTime = value));
component_subscribe($$self, _interaction, value => $$invalidate(7, $_interaction = value));
component_subscribe($$self, _classes, value => $$invalidate(42, $_classes = value));
component_subscribe($$self, _resBgColor, value => $$invalidate(47, $_resBgColor = value));
component_subscribe($$self, _resTxtColor, value => $$invalidate(44, $_resTxtColor = value));
let { _hiddenEvents, _popupDate } = getContext('view-state');
component_subscribe($$self, _hiddenEvents, value => $$invalidate(50, $_hiddenEvents = value));
component_subscribe($$self, _popupDate, value => $$invalidate(52, $_popupDate = value));
component_subscribe($$self, _iClasses, value => $$invalidate(44, $_iClasses = value));
component_subscribe($$self, _resBgColor, value => $$invalidate(49, $_resBgColor = value));
component_subscribe($$self, _resTxtColor, value => $$invalidate(46, $_resTxtColor = value));
component_subscribe($$self, _hiddenEvents, value => $$invalidate(52, $_hiddenEvents = value));
component_subscribe($$self, _popupDate, value => $$invalidate(54, $_popupDate = value));
let el;

@@ -526,3 +517,3 @@ let event;

$$invalidate(36, margin = repositionEvent(chunk, longChunks, height(el)));
$$invalidate(37, margin = repositionEvent(chunk, longChunks, height(el)));

@@ -532,3 +523,3 @@ if ($dayMaxEvents === true) {

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

@@ -540,3 +531,3 @@ }

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

@@ -591,13 +582,13 @@

$$self.$$set = $$props => {
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);
if ('chunk' in $$props) $$invalidate(33, chunk = $$props.chunk);
if ('longChunks' in $$props) $$invalidate(34, longChunks = $$props.longChunks);
if ('inPopup' in $$props) $$invalidate(35, inPopup = $$props.inPopup);
};
$$self.$$.update = () => {
if ($$self.$$.dirty[1] & /*chunk*/ 2) {
if ($$self.$$.dirty[1] & /*chunk*/ 4) {
$$invalidate(0, event = chunk.event);
}
if ($$self.$$.dirty[0] & /*event, style, $theme*/ 19 | $$self.$$.dirty[1] & /*$_resBgColor, $eventBackgroundColor, $eventColor, $_resTxtColor, $eventTextColor, chunk, margin, hidden, $_classes*/ 129122) {
if ($$self.$$.dirty[0] & /*event, style, $theme*/ 19 | $$self.$$.dirty[1] & /*$_resBgColor, $eventBackgroundColor, $eventColor, $_resTxtColor, $eventTextColor, chunk, margin, hidden, $_iClasses, $eventClassNames, $_view*/ 520644) {
{

@@ -624,7 +615,11 @@ $$invalidate(6, display = event.display);

$$invalidate(3, classes = $_classes($theme.event, event));
$$invalidate(3, classes = [
$theme.event,
...$_iClasses([], event),
...createEventClasses($eventClassNames, event, $_view)
].join(' '));
}
}
if ($$self.$$.dirty[0] & /*$theme*/ 2 | $$self.$$.dirty[1] & /*chunk, $displayEventEnd, $eventContent, $_intlEventTime, $_view*/ 1922) {
if ($$self.$$.dirty[0] & /*$theme*/ 2 | $$self.$$.dirty[1] & /*chunk, $displayEventEnd, $eventContent, $_intlEventTime, $_view*/ 3844) {
// Content

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

eventContent,
eventClassNames,
eventDidMount,

@@ -662,3 +658,3 @@ eventMouseEnter,

_interaction,
_classes,
_iClasses,
_resBgColor,

@@ -680,3 +676,4 @@ _resTxtColor,

$displayEventEnd,
$_classes,
$eventClassNames,
$_iClasses,
$eventTextColor,

@@ -702,6 +699,6 @@ $_resTxtColor,

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

@@ -714,3 +711,3 @@ null,

get reposition() {
return this.$$.ctx[35];
return this.$$.ctx[36];
}

@@ -727,3 +724,3 @@ }

// (84:8) {#each $_popupChunks as chunk (chunk.event)}
// (83:8) {#each $_popupChunks as chunk (chunk.event)}
function create_each_block$3(key_1, ctx) {

@@ -910,7 +907,6 @@ let first;

let $_intlDayPopover;
let { theme, _interaction, _intlDayPopover } = getContext('state');
let { theme, _interaction, _intlDayPopover, _popupDate, _popupChunks } = getContext('state');
component_subscribe($$self, theme, value => $$invalidate(4, $theme = value));
component_subscribe($$self, _interaction, value => $$invalidate(15, $_interaction = value));
component_subscribe($$self, _intlDayPopover, value => $$invalidate(5, $_intlDayPopover = value));
let { _popupDate, _popupChunks } = getContext('view-state');
component_subscribe($$self, _popupDate, value => $$invalidate(3, $_popupDate = value));

@@ -1037,3 +1033,3 @@ component_subscribe($$self, _popupChunks, value => $$invalidate(0, $_popupChunks = value));

// (117:4) {#if iChunks[1] && datesEqual(iChunks[1].date, date)}
// (116:4) {#if iChunks[1] && datesEqual(iChunks[1].date, date)}
function create_if_block_3(ctx) {

@@ -1082,3 +1078,3 @@ let div;

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

@@ -1127,3 +1123,3 @@ let div;

// (129:8) {#each dayChunks as chunk, i (chunk.event)}
// (128:8) {#each dayChunks as chunk, i (chunk.event)}
function create_each_block$2(key_1, ctx) {

@@ -1189,3 +1185,3 @@ let first;

// (133:4) {#if showPopup}
// (132:4) {#if showPopup}
function create_if_block_1(ctx) {

@@ -1219,3 +1215,3 @@ let popup;

// (137:8) {#if hiddenEvents.size}
// (136:8) {#if hiddenEvents.size}
function create_if_block(ctx) {

@@ -1534,3 +1530,3 @@ let a;

let { iChunks = [] } = $$props;
let { date: currentDate, dayMaxEvents, highlightedDates, moreLinkContent, theme, _interaction, _queue } = getContext('state');
let { date: currentDate, dayMaxEvents, highlightedDates, moreLinkContent, theme, _hiddenEvents, _popupDate, _popupChunks, _interaction, _queue } = getContext('state');
component_subscribe($$self, currentDate, value => $$invalidate(30, $currentDate = value));

@@ -1540,7 +1536,6 @@ component_subscribe($$self, highlightedDates, value => $$invalidate(29, $highlightedDates = value));

component_subscribe($$self, theme, value => $$invalidate(12, $theme = value));
component_subscribe($$self, _interaction, value => $$invalidate(13, $_interaction = value));
let { _hiddenEvents, _popupDate, _popupChunks } = getContext('view-state');
component_subscribe($$self, _hiddenEvents, value => $$invalidate(26, $_hiddenEvents = value));
component_subscribe($$self, _popupDate, value => $$invalidate(27, $_popupDate = value));
component_subscribe($$self, _popupChunks, value => $$invalidate(34, $_popupChunks = value));
component_subscribe($$self, _interaction, value => $$invalidate(13, $_interaction = value));
let el;

@@ -1705,6 +1700,6 @@ let dayChunks;

theme,
_interaction,
_hiddenEvents,
_popupDate,
_popupChunks,
_interaction,
createPointerEnterHandler,

@@ -1980,11 +1975,11 @@ showMore,

const child_ctx = ctx.slice();
child_ctx[14] = list[i];
child_ctx[13] = list[i];
return child_ctx;
}
// (37:0) {#each weeks as dates}
// (31:0) {#each weeks as dates}
function create_each_block(ctx) {
let week;
let current;
week = new Week({ props: { dates: /*dates*/ ctx[14] } });
week = new Week({ props: { dates: /*dates*/ ctx[13] } });

@@ -2001,3 +1996,3 @@ return {

const week_changes = {};
if (dirty & /*weeks*/ 1) week_changes.dates = /*dates*/ ctx[14];
if (dirty & /*weeks*/ 1) week_changes.dates = /*dates*/ ctx[13];
week.$set(week_changes);

@@ -2020,3 +2015,3 @@ },

// (36:0) <Body>
// (30:0) <Body>
function create_default_slot(ctx) {

@@ -2136,3 +2131,3 @@ let each_1_anchor;

if (dirty & /*$$scope, weeks*/ 131073) {
if (dirty & /*$$scope, weeks*/ 65537) {
body_changes.$$scope = { dirty, ctx };

@@ -2168,11 +2163,8 @@ }

let $_viewClass;
let { _viewDates, _viewClass, dayMaxEvents, hiddenDays, theme } = getContext('state');
let { _viewDates, _viewClass, _hiddenEvents, dayMaxEvents, hiddenDays, theme } = getContext('state');
component_subscribe($$self, _viewDates, value => $$invalidate(7, $_viewDates = value));
component_subscribe($$self, _viewClass, value => $$invalidate(11, $_viewClass = value));
component_subscribe($$self, _hiddenEvents, value => $$invalidate(10, $_hiddenEvents = value));
component_subscribe($$self, dayMaxEvents, value => $$invalidate(8, $dayMaxEvents = value));
component_subscribe($$self, hiddenDays, value => $$invalidate(9, $hiddenDays = value));
let viewState = new State(getContext('state'));
setContext('view-state', viewState);
let { _hiddenEvents } = viewState;
component_subscribe($$self, _hiddenEvents, value => $$invalidate(10, $_hiddenEvents = value));
set_store_value(_viewClass, $_viewClass = 'month', $_viewClass);

@@ -2206,5 +2198,5 @@ let weeks;

_viewClass,
_hiddenEvents,
dayMaxEvents,
hiddenDays,
_hiddenEvents,
days,

@@ -2246,3 +2238,7 @@ $_viewDates,

createStores(state) {
state._days = days(state);
state._intlDayPopover = intl(state.locale, state.dayPopoverFormat);
state._hiddenEvents = writable({});
state._popupDate = writable(null);
state._popupChunks = writable([]);
}

@@ -2249,0 +2245,0 @@ };

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

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

"dependencies": {
"@event-calendar/core": "~1.4.1",
"@event-calendar/core": "~1.5.0",
"svelte": "^3.59.1"
}
}

@@ -38,2 +38,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)

- [eventBackgroundColor](#eventbackgroundcolor)
- [eventClassNames](#eventclassnames)
- [eventClick](#eventclick)

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

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

@@ -547,2 +548,39 @@

### eventClassNames
- Type `string`, `array` or `function`
- Default `undefined`
Sets additional CSS classes for events.
This value can be either a string containing class names `'class-1 class-2 ...'`, an array of strings `['class-1', 'class-2', ...]` or a function that returns any of the above formats:
```js
function (info) {
// return string or array
}
```
`info` is an object with the following properties:
<table>
<tr>
<td>
`event`
</td>
<td>
The associated [Event](#event-object) object
</td>
</tr>
<tr>
<td>
`view`
</td>
<td>
The current [View](#view-object) object
</td>
</tr>
</table>
### eventClick

@@ -602,3 +640,3 @@ - Type `function`

### eventContent
- Type `string`, `object`or `function`
- Type `string`, `object` or `function`
- Default `undefined`

@@ -605,0 +643,0 @@

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

import {writable} from 'svelte/store';
import {intl} from '@event-calendar/core';
import {days} from './stores.js';
import View from './View.svelte';
import {intl} from '@event-calendar/core';

@@ -26,4 +28,8 @@ export default {

createStores(state) {
state._days = days(state);
state._intlDayPopover = intl(state.locale, state.dayPopoverFormat);
state._hiddenEvents = writable({});
state._popupDate = writable(null);
state._popupChunks = writable([]);
}
}
}

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