@event-calendar/core 5.4.2 → 5.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -17
- package/dist/index.css +4 -3
- package/dist/index.js +5440 -5647
- package/package.json +2 -2
- package/src/lib/components/ColHead.svelte +2 -0
- package/src/lib/date.js +11 -1
- package/src/plugins/day-grid/Day.svelte +5 -15
- package/src/plugins/day-grid/index.js +1 -2
- package/src/plugins/list/index.js +10 -7
- package/src/plugins/resource-time-grid/index.js +2 -2
- package/src/plugins/resource-timeline/View.svelte +27 -4
- package/src/plugins/resource-timeline/derived.js +41 -2
- package/src/plugins/resource-timeline/index.js +29 -8
- package/src/plugins/resource-timeline/state.svelte.js +6 -1
- package/src/storage/derived.js +4 -1
- package/src/storage/options.js +1 -0
- package/src/storage/state.svelte.js +3 -3
- package/src/styles/days.css +1 -1
- package/src/styles/index.css +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
17
17
|
<tr>
|
|
18
18
|
<td>
|
|
19
19
|
|
|
20
|
+
[](https://github.com/ekwi-tech)
|
|
21
|
+
</td>
|
|
22
|
+
<td>
|
|
23
|
+
|
|
20
24
|
[](https://github.com/steveb85)
|
|
21
25
|
</td>
|
|
22
26
|
<td>
|
|
@@ -99,6 +103,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
99
103
|
- [loading](#loading)
|
|
100
104
|
- [locale](#locale)
|
|
101
105
|
- [longPressDelay](#longpressdelay)
|
|
106
|
+
- [monthHeaderFormat](#monthheaderformat)
|
|
102
107
|
- [moreLinkContent](#morelinkcontent)
|
|
103
108
|
- [noEventsClick](#noeventsclick)
|
|
104
109
|
- [noEventsContent](#noeventscontent)
|
|
@@ -253,8 +258,8 @@ This bundle contains a version of the calendar that includes all plugins and is
|
|
|
253
258
|
|
|
254
259
|
The first step is to include the following lines of code in the `<head>` section of your page:
|
|
255
260
|
```html
|
|
256
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.
|
|
257
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.
|
|
261
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.5.1/dist/event-calendar.min.css">
|
|
262
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.5.1/dist/event-calendar.min.js"></script>
|
|
258
263
|
```
|
|
259
264
|
|
|
260
265
|
<details>
|
|
@@ -349,7 +354,7 @@ When hidden with `false`, all-day events will not be displayed in `timeGrid`/`re
|
|
|
349
354
|
<details>
|
|
350
355
|
<summary>Default</summary>
|
|
351
356
|
|
|
352
|
-
`{collapse: 'Collapse', close: 'Close', dayGridDay: 'day', dayGridMonth: 'month', dayGridWeek: 'week', expand: 'Expand', listDay: '
|
|
357
|
+
`{collapse: 'Collapse', close: 'Close', dayGridDay: 'day', dayGridMonth: 'month', dayGridWeek: 'week', expand: 'Expand', listDay: 'day', listMonth: 'month', listWeek: 'week', listYear: 'year', resourceTimeGridDay: 'day', resourceTimeGridWeek: 'week', resourceTimelineDay: 'day', resourceTimelineMonth: 'month', resourceTimelineWeek: 'week', resourceTimelineYear: 'year', timeGridDay: 'day', timeGridWeek: 'week', today: 'today'}`
|
|
353
358
|
> Views override the default value as follows:
|
|
354
359
|
> - dayGridDay `text => ({...text, next: 'Next day', prev: 'Previous day'})`
|
|
355
360
|
> - dayGridMonth `text => ({...text, next: 'Next month', prev: 'Previous month'})`
|
|
@@ -363,6 +368,7 @@ When hidden with `false`, all-day events will not be displayed in `timeGrid`/`re
|
|
|
363
368
|
> - resourceTimelineDay `text => ({...text, next: 'Next day', prev: 'Previous day'})`
|
|
364
369
|
> - resourceTimelineMonth `text => ({...text, next: 'Next month', prev: 'Previous month'})`
|
|
365
370
|
> - resourceTimelineWeek `text => ({...text, next: 'Next week', prev: 'Previous week'})`
|
|
371
|
+
> - resourceTimelineYear `text => ({...text, next: 'Next year', prev: 'Previous year'})`
|
|
366
372
|
> - timeGridDay `text => ({...text, next: 'Next day', prev: 'Previous day'})`
|
|
367
373
|
> - timeGridWeek `text => ({...text, next: 'Next week', prev: 'Previous week'})`
|
|
368
374
|
|
|
@@ -676,6 +682,7 @@ function (date) {
|
|
|
676
682
|
> - dayGridDay `{weekday: 'long'}`
|
|
677
683
|
> - dayGridMonth `{weekday: 'short'}`
|
|
678
684
|
> - resourceTimelineMonth `{weekday: 'short', day: 'numeric'}`
|
|
685
|
+
> - resourceTimelineYear `{weekday: 'short', day: 'numeric'}`
|
|
679
686
|
> - timeGridDay `{weekday: 'long'}`
|
|
680
687
|
|
|
681
688
|
Defines the text that is displayed on the calendar’s column headings.
|
|
@@ -730,6 +737,7 @@ function (date) {
|
|
|
730
737
|
> - resourceTimelineDay `false`
|
|
731
738
|
> - resourceTimelineMonth `false`
|
|
732
739
|
> - resourceTimelineWeek `false`
|
|
740
|
+
> - resourceTimelineYear `false`
|
|
733
741
|
|
|
734
742
|
Determines whether to display an event’s end time.
|
|
735
743
|
|
|
@@ -761,6 +769,7 @@ Determines whether the calendar should automatically scroll during the event dra
|
|
|
761
769
|
> - resourceTimeGridDay `{days: 1}`
|
|
762
770
|
> - resourceTimelineDay `{days: 1}`
|
|
763
771
|
> - resourceTimelineMonth `{months: 1}`
|
|
772
|
+
> - resourceTimelineYear `{years: 1}`
|
|
764
773
|
> - timeGridDay `{days: 1}`
|
|
765
774
|
|
|
766
775
|
Sets the duration of a view.
|
|
@@ -1950,6 +1959,29 @@ For touch devices, the amount of time (in milliseconds) the user must hold down
|
|
|
1950
1959
|
|
|
1951
1960
|
For a more granular configuration, see [eventLongPressDelay](#eventlongpressdelay) and [selectLongPressDelay](#selectlongpressdelay).
|
|
1952
1961
|
|
|
1962
|
+
### monthHeaderFormat
|
|
1963
|
+
- Type `object` or `function`
|
|
1964
|
+
- Default `{month: 'long'}`
|
|
1965
|
+
|
|
1966
|
+
Defines the text that is displayed in month headings in `resourceTimelineYear` view.
|
|
1967
|
+
|
|
1968
|
+
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:
|
|
1969
|
+
|
|
1970
|
+
```js
|
|
1971
|
+
function (date) {
|
|
1972
|
+
// return Content with the formatted date string
|
|
1973
|
+
}
|
|
1974
|
+
```
|
|
1975
|
+
<table>
|
|
1976
|
+
<tr>
|
|
1977
|
+
<td>
|
|
1978
|
+
|
|
1979
|
+
`date`
|
|
1980
|
+
</td>
|
|
1981
|
+
<td>JavaScript Date object that needs to be formatted</td>
|
|
1982
|
+
</tr>
|
|
1983
|
+
</table>
|
|
1984
|
+
|
|
1953
1985
|
### moreLinkContent
|
|
1954
1986
|
- Type `Content` or `function`
|
|
1955
1987
|
- Default `undefined`
|
|
@@ -2408,6 +2440,7 @@ Defines how many pixels the user’s mouse must move before the selection begins
|
|
|
2408
2440
|
- Default `'00:30:00'`
|
|
2409
2441
|
> Views override the default value as follows:
|
|
2410
2442
|
> - resourceTimelineMonth `{days: 1}`
|
|
2443
|
+
> - resourceTimelineYear `{days: 1}`
|
|
2411
2444
|
|
|
2412
2445
|
Defines the frequency for displaying time slots.
|
|
2413
2446
|
|
|
@@ -2515,6 +2548,7 @@ If not specified, then equal to [slotDuration](#slotduration).
|
|
|
2515
2548
|
> - resourceTimelineDay `theme => ({...theme, view: 'ec-resource ec-timeline ec-day-view'})`
|
|
2516
2549
|
> - resourceTimelineMonth `theme => ({...theme, view: 'ec-resource ec-timeline ec-month-view'})`
|
|
2517
2550
|
> - resourceTimelineWeek `theme => ({...theme, view: 'ec-resource ec-timeline ec-week-view'})`
|
|
2551
|
+
> - resourceTimelineYear `theme => ({...theme, view: 'ec-resource ec-timeline ec-year-view'})`
|
|
2518
2552
|
> - timeGridDay `theme => ({...theme, view: 'ec-time-grid ec-day-view'})`
|
|
2519
2553
|
> - timeGridWeek `theme => ({...theme, view: 'ec-time-grid ec-week-view'})`
|
|
2520
2554
|
</details>
|
|
@@ -2545,6 +2579,9 @@ function (theme) {
|
|
|
2545
2579
|
- Default `{year: 'numeric', month: 'short', day: 'numeric'}`
|
|
2546
2580
|
> Views override the default value as follows:
|
|
2547
2581
|
> - dayGridMonth `{year: 'numeric', month: 'long'}`
|
|
2582
|
+
> - listDay `{year: 'numeric', month: 'long', day: 'numeric'}`
|
|
2583
|
+
> - listMonth `{year: 'numeric', month: 'long'}`
|
|
2584
|
+
> - listYear `{year: 'numeric'}`
|
|
2548
2585
|
> - timeGridDay `{year: 'numeric', month: 'long', day: 'numeric'}`
|
|
2549
2586
|
|
|
2550
2587
|
Defines the text that is displayed in the header toolbar’s title.
|
|
@@ -2682,6 +2719,7 @@ The following values are available:
|
|
|
2682
2719
|
- `'resourceTimelineDay'`
|
|
2683
2720
|
- `'resourceTimelineWeek'`
|
|
2684
2721
|
- `'resourceTimelineMonth'`
|
|
2722
|
+
- `'resourceTimelineYear'`
|
|
2685
2723
|
- `'timeGridDay'`
|
|
2686
2724
|
- `'timeGridWeek'`
|
|
2687
2725
|
|
|
@@ -2761,7 +2799,7 @@ function (arg) {
|
|
|
2761
2799
|
- Type `boolean`
|
|
2762
2800
|
- Default `false`
|
|
2763
2801
|
|
|
2764
|
-
Determines whether week numbers should be displayed in
|
|
2802
|
+
Determines whether week numbers should be displayed in `dayGrid`/`resourceTimeline` views.
|
|
2765
2803
|
|
|
2766
2804
|
The numbering of weeks depends on the value of [firstDay](#firstday). When `firstDay` is `0`, the [Western](https://en.wikipedia.org/wiki/Week#Other_week_numbering_systems) system is used. Any other value uses the [ISO](https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system) system.
|
|
2767
2805
|
|
|
@@ -2771,20 +2809,20 @@ Methods allow you to manipulate EventCalendar after initialization. They are acc
|
|
|
2771
2809
|
In Svelte, methods are available from a component instance:
|
|
2772
2810
|
```html
|
|
2773
2811
|
<script>
|
|
2774
|
-
|
|
2812
|
+
import {Calendar, TimeGrid} from '@event-calendar/core';
|
|
2775
2813
|
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2814
|
+
let ec = $state();
|
|
2815
|
+
let options = $state({
|
|
2816
|
+
view: 'timeGridWeek',
|
|
2817
|
+
eventSources: [{events: function() {
|
|
2818
|
+
console.log('fetching...');
|
|
2819
|
+
return [];
|
|
2820
|
+
}}]
|
|
2821
|
+
});
|
|
2822
|
+
|
|
2823
|
+
function invokeMethod() {
|
|
2824
|
+
ec.refetchEvents();
|
|
2825
|
+
}
|
|
2788
2826
|
</script>
|
|
2789
2827
|
|
|
2790
2828
|
<button onclick={invokeMethod}>Refetch events</button>
|
package/dist/index.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.
|
|
2
|
+
* EventCalendar v5.5.1
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
.ec {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
100% var(--ec-slot-height);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
.ec-timeline:not(.ec-month-view) .ec-body & {
|
|
101
|
+
.ec-timeline:not(.ec-month-view, .ec-year-view) .ec-body & {
|
|
102
102
|
--ec-last-line-color: transparent;
|
|
103
103
|
--ec-direction: to left;
|
|
104
104
|
[dir="rtl"] & {
|
|
@@ -680,7 +680,7 @@
|
|
|
680
680
|
flex-grow: 1;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
.ec-timeline.ec-month-view & {
|
|
683
|
+
.ec-timeline:is(.ec-month-view, .ec-year-view) & {
|
|
684
684
|
grid-template-columns: max-content repeat(var(--ec-grid-cols), var(--ec-col-width));
|
|
685
685
|
}
|
|
686
686
|
|
|
@@ -755,3 +755,4 @@
|
|
|
755
755
|
.ec-hidden {
|
|
756
756
|
visibility: hidden;
|
|
757
757
|
}
|
|
758
|
+
/*$vite$:1*/
|