@event-calendar/day-grid
Advanced tools
Comparing version 2.0.0 to 2.1.0
34
index.js
import { derived, writable } from 'svelte/store'; | ||
import { cloneDate, subtractDay, addDay, setContent, helperEvent, toEventWithLocalDates, toViewWithLocalDates, createEventClasses, createEventContent, previewEvent, repositionEvent, height, ancestor, max, keyEnter, outsideEvent, rect, datesEqual, setMidnight, createDate, debounce, assign, createEventChunk, setPayload, bgEvent, eventIntersects, prepareEventChunks, btnTextMonth, intl } from '@event-calendar/core'; | ||
import { cloneDate, subtractDay, addDay, setContent, helperEvent, toEventWithLocalDates, toViewWithLocalDates, createEventClasses, createEventContent, previewEvent, repositionEvent, height, ancestor, max, keyEnter, outsideEvent, rect, datesEqual, setMidnight, createDate, debounce, assign, createEventChunk, setPayload, bgEvent, eventIntersects, prepareEventChunks, btnTextMonth, themeView, intl } from '@event-calendar/core'; | ||
import { SvelteComponent, init, safe_not_equal, ensure_array_like, element, space, attr, insert, append, noop, detach, destroy_each, component_subscribe, action_destroyer, is_function, 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, listen, group_outros, destroy_component, check_outros, run_all, text, stop_propagation, update_keyed_each, outro_and_destroy_block, empty, set_store_value, bubble, set_data } from 'svelte/internal'; | ||
@@ -2008,11 +2008,11 @@ import { getContext, onMount, tick, afterUpdate } from 'svelte'; | ||
const child_ctx = ctx.slice(); | ||
child_ctx[13] = list[i]; | ||
child_ctx[10] = list[i]; | ||
return child_ctx; | ||
} | ||
// (31:0) {#each weeks as dates} | ||
// (29:0) {#each weeks as dates} | ||
function create_each_block(ctx) { | ||
let week; | ||
let current; | ||
week = new Week({ props: { dates: /*dates*/ ctx[13] } }); | ||
week = new Week({ props: { dates: /*dates*/ ctx[10] } }); | ||
@@ -2029,3 +2029,3 @@ return { | ||
const week_changes = {}; | ||
if (dirty & /*weeks*/ 1) week_changes.dates = /*dates*/ ctx[13]; | ||
if (dirty & /*weeks*/ 1) week_changes.dates = /*dates*/ ctx[10]; | ||
week.$set(week_changes); | ||
@@ -2048,3 +2048,3 @@ }, | ||
// (30:0) <Body> | ||
// (28:0) <Body> | ||
function create_default_slot(ctx) { | ||
@@ -2167,3 +2167,3 @@ let each_1_anchor; | ||
if (dirty & /*$$scope, weeks*/ 65537) { | ||
if (dirty & /*$$scope, weeks*/ 8193) { | ||
body_changes.$$scope = { dirty, ctx }; | ||
@@ -2201,10 +2201,7 @@ } | ||
let $hiddenDays; | ||
let $_viewClass; | ||
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)); | ||
set_store_value(_viewClass, $_viewClass = 'month', $_viewClass); | ||
let { _viewDates, _hiddenEvents, dayMaxEvents, hiddenDays } = getContext('state'); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(6, $_viewDates = value)); | ||
component_subscribe($$self, _hiddenEvents, value => $$invalidate(9, $_hiddenEvents = value)); | ||
component_subscribe($$self, dayMaxEvents, value => $$invalidate(7, $dayMaxEvents = value)); | ||
component_subscribe($$self, hiddenDays, value => $$invalidate(8, $hiddenDays = value)); | ||
let weeks; | ||
@@ -2214,6 +2211,6 @@ let days; | ||
$$self.$$.update = () => { | ||
if ($$self.$$.dirty & /*$hiddenDays, $dayMaxEvents, $_viewDates, days, weeks*/ 961) { | ||
if ($$self.$$.dirty & /*$hiddenDays, $dayMaxEvents, $_viewDates, days, weeks*/ 481) { | ||
{ | ||
$$invalidate(0, weeks = []); | ||
$$invalidate(6, days = 7 - $hiddenDays.length); | ||
$$invalidate(5, days = 7 - $hiddenDays.length); | ||
set_store_value(_hiddenEvents, $_hiddenEvents = {}, $_hiddenEvents); | ||
@@ -2237,3 +2234,2 @@ | ||
_viewDates, | ||
_viewClass, | ||
_hiddenEvents, | ||
@@ -2266,3 +2262,2 @@ dayMaxEvents, | ||
options.theme.dayFoot = 'ec-day-foot'; | ||
options.theme.month = 'ec-month'; | ||
options.theme.popup = 'ec-popup'; | ||
@@ -2276,2 +2271,3 @@ options.view = 'dayGridMonth'; | ||
duration: {months: 1}, | ||
theme: themeView('ec-day-grid ec-month-view'), | ||
titleFormat: {year: 'numeric', month: 'long'} | ||
@@ -2278,0 +2274,0 @@ }; |
{ | ||
"name": "@event-calendar/day-grid", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"title": "Event Calendar DayGrid plugin", | ||
@@ -29,5 +29,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/core": "~2.0.0", | ||
"@event-calendar/core": "~2.1.0", | ||
"svelte": "^4.1.1" | ||
} | ||
} |
@@ -127,2 +127,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) | ||
</table> | ||
- [Content](#content) | ||
- [Event object](#event-object) | ||
@@ -198,4 +199,4 @@ - [Parsing event from a plain object](#parsing-event-from-a-plain-object) | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.0.0/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.0.0/event-calendar.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.1.0/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.1.0/event-calendar.min.js"></script> | ||
``` | ||
@@ -291,11 +292,11 @@ | ||
> Views override the default value as follows: | ||
> - dayGridMonth `function (text) { return {...text, next: 'Next month', prev: 'Previous month'}; }` | ||
> - listDay `function (text) { return {...text, next: 'Next day', prev: 'Previous day'}; }` | ||
> - listMonth `function (text) { return {...text, next: 'Next month', prev: 'Previous month'}; }` | ||
> - listWeek `function (text) { return {...text, next: 'Next week', prev: 'Previous week'}; }` | ||
> - listYear `function (text) { return {...text, next: 'Next year', prev: 'Previous year'}; }` | ||
> - resourceTimeGridDay `function (text) { return {...text, next: 'Next day', prev: 'Previous day'}; }` | ||
> - resourceTimeGridWeek `function (text) { return {...text, next: 'Next week', prev: 'Previous week'}; }` | ||
> - timeGridDay `function (text) { return {...text, next: 'Next day', prev: 'Previous day'}; }` | ||
> - timeGridWeek `function (text) { return {...text, next: 'Next week', prev: 'Previous week'}; }` | ||
> - dayGridMonth `text => ({...text, next: 'Next month', prev: 'Previous month'})` | ||
> - listDay `text => ({...text, next: 'Next day', prev: 'Previous day'})` | ||
> - listMonth `text => ({...text, next: 'Next month', prev: 'Previous month'})` | ||
> - listWeek `text => ({...text, next: 'Next week', prev: 'Previous week'})` | ||
> - listYear `text => ({...text, next: 'Next year', prev: 'Previous year'})` | ||
> - resourceTimeGridDay `text => ({...text, next: 'Next day', prev: 'Previous day'})` | ||
> - resourceTimeGridWeek `text => ({...text, next: 'Next week', prev: 'Previous week'})` | ||
> - timeGridDay `text => ({...text, next: 'Next day', prev: 'Previous day'})` | ||
> - timeGridWeek `text => ({...text, next: 'Next week', prev: 'Previous week'})` | ||
@@ -1309,3 +1310,3 @@ | ||
This value can be either an object with options for the native JavaScript [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) object, or a callback function that returns a [Content](#content) with formatted string: | ||
This value can be either an object with options for the native JavaScript [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) object, or a callback function that returns a [Content](#content) with the formatted string: | ||
@@ -1912,3 +1913,13 @@ ```js | ||
- 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', 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', 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', view: '', withScroll: 'ec-with-scroll'}` | ||
> Views override the default value as follows: | ||
> - dayGridMonth `theme => ({...theme, view: 'ec-day-grid ec-month-view'})` | ||
> - listDay `theme => ({...theme, view: 'ec-list ec-day-view'})` | ||
> - listMonth `theme => ({...theme, view: 'ec-list ec-month-view'})` | ||
> - listWeek `theme => ({...theme, view: 'ec-list ec-week-view'})` | ||
> - listYear `theme => ({...theme, view: 'ec-list ec-year-view'})` | ||
> - resourceTimeGridDay `theme => ({...theme, view: 'ec-time-grid ec-resource-day-view'})` | ||
> - resourceTimeGridWeek `theme => ({...theme, view: 'ec-time-grid ec-resource-week-view'})` | ||
> - timeGridDay `theme => ({...theme, view: 'ec-time-grid ec-day-view'})` | ||
> - timeGridWeek `theme => ({...theme, view: 'ec-time-grid ec-week-view'})` | ||
@@ -1967,12 +1978,2 @@ Defines the CSS classes that the Event Calendar uses to generate HTML markup. | ||
The callback function can return HTML markup. If you want to use HTML entities in the title, you must use the callback function: | ||
```js | ||
function (date) { | ||
let month = date.toLocaleDateString('en-US', { month: 'long' }) | ||
let year = date.toLocaleDateString('en-US', { year: 'numeric' }) | ||
return `<span class="month">${month}</span> <span class="year">${year}</span>` | ||
} | ||
``` | ||
### unselect | ||
@@ -1979,0 +1980,0 @@ - Type `function` |
import {writable} from 'svelte/store'; | ||
import {btnTextMonth, intl} from '@event-calendar/core'; | ||
import {btnTextMonth, intl, themeView} from '@event-calendar/core'; | ||
import {days} from './stores.js'; | ||
@@ -16,3 +16,2 @@ import View from './View.svelte'; | ||
options.theme.dayFoot = 'ec-day-foot'; | ||
options.theme.month = 'ec-month'; | ||
options.theme.popup = 'ec-popup'; | ||
@@ -26,2 +25,3 @@ options.view = 'dayGridMonth'; | ||
duration: {months: 1}, | ||
theme: themeView('ec-day-grid ec-month-view'), | ||
titleFormat: {year: 'numeric', month: 'long'} | ||
@@ -28,0 +28,0 @@ }; |
Sorry, the diff of this file is not supported yet
2703
139318
2045
+ Added@event-calendar/core@2.1.0(transitive)
- Removed@event-calendar/core@2.0.0(transitive)
Updated@event-calendar/core@~2.1.0